Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotkey conflict? #30

Open
Freed-Wu opened this issue Apr 24, 2020 · 5 comments
Open

hotkey conflict? #30

Freed-Wu opened this issue Apr 24, 2020 · 5 comments

Comments

@Freed-Wu
Copy link

this plugin use , . some plugins like https://github.com/tpope/vim-speeddating also use them.
how can it provide some function to avoid conflict? such as

nmap <expr> <c-a> swap#canswap()? '<plug>(swap-next)': '<plug>blabla'

thanks!

@mjbrownie
Copy link
Owner

Sure that has been a passthrough set up thanks to a contributor. It looks like it might not be in the main docuentation.

https://github.com/mjbrownie/swapit/blob/master/plugin/swapit.vim
" To integrate with other incrementor scripts (such as
" speeddating.vim or monday.vim), map
" SwapItFallbackIncrement and SwapItFallbackDecrement
" to the keys that should be invoked when swapit doesn't have a
" proper option. For example for speeddating.vim:
"
" nmap SwapItFallbackIncrement SpeedDatingUp
" nmap SwapItFallbackDecrement SpeedDatingDown
" vmap SwapItFallbackIncrement SpeedDatingUp
" vmap SwapItFallbackDecrement SpeedDatingDown
"

@Freed-Wu
Copy link
Author

yes. it truly can integrate with speedating. i recommend move this comment to doc/help.txt.

and except speedating, monday, can it integrate with https://www.github.com/nishigori/increment-activator?

@mjbrownie
Copy link
Owner

It's possible to chain these type of plugins together so long as they support them. (I've only done it for speed dating myself) The increment-activator may need the equivalent SwapItFallbackIncrement or you could set it as the last point. eg.

swapit -> speeddating -> increment-activator

if that plugin cant do it then perhaps offer a pr for them simliar to SwapItFallbackIncrement
https://github.com/mjbrownie/swapit/blob/master/plugin/swapit.vim#L242

It looks like increment-activator covers similar use cases as swapit so you could possibly ditch one if you don't need the features.. Their camel case changing looks nice. If you don't need swapit's xml/html start/end matching or the css stuff I'd just use that instead for now.

also there are a couple of alternatives switch.vim/cycle.vim

@Freed-Wu
Copy link
Author

Freed-Wu commented May 5, 2020

when i use swapit and speeddating together, i found if i press Ctrla in a word not date, it will return this error:

|| Error detected while processing function
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| speeddating#increment[18]
|| SwapWord[26]
|| ProcessMatches[5]
|| E169: Command too recursive

this is vimrc

set nocompatible
set runtimepath +=$GITHUBWORKSPACE/mjbrownie/swapit
set runtimepath +=$GITHUBWORKSPACE/tpope/vim-speeddating

nmap <Plug>SwapItFallbackIncrement <Plug>SpeedDatingUp
nmap <Plug>SwapItFallbackDecrement <Plug>SpeedDatingDown
xmap <Plug>SwapItFallbackIncrement <Plug>SpeedDatingUp
xmap <Plug>SwapItFallbackDecrement <Plug>SpeedDatingDown

i will take a try for these plugin which you recommended. thanks!

@Freed-Wu
Copy link
Author

Freed-Wu commented May 5, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants