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

Can no longer remap <Plug>SpeedDatingUp if mapping C-a or C-x #36

Open
idbrii opened this issue Feb 25, 2019 · 3 comments
Open

Can no longer remap <Plug>SpeedDatingUp if mapping C-a or C-x #36

idbrii opened this issue Feb 25, 2019 · 3 comments

Comments

@idbrii
Copy link
Contributor

idbrii commented Feb 25, 2019

I remap increment/decrement and use C-a for select all. The addition of integration with other increment plugins in a418667 breaks user remapping of SpeedDating commands.

" .vimrc
let g:speeddating_no_mappings = 1

" .vim/plugin/speeddating-david.vim
if exists("g:loaded_speeddating") && g:loaded_speeddating
	nmap  <C-x><C-s>     <Plug>SpeedDatingUp
	nmap  <C-x><C-x>     <Plug>SpeedDatingDown
endif


:Verbose nmap <c-x>

n  <C-X><C-X>    <Plug>SpeedDatingDown
	Last set from ~/.vim/after/plugin/speeddating-david.vim line 6
n  <C-X><C-S>    <Plug>SpeedDatingUp
	Last set from ~/.vim/after/plugin/speeddating-david.vim line 5

Inserting a 0, leaving insert mode, executing <C-X><C-X> does not increment the 0. Instead, it selects some portion of the buffer.

The SpeedDatingFallback definition is assuming that anything mapped to C-a or C-x is for inc/decrement. But for me it's not:

:Verbose ec maparg('<C-A>', 'n')
1GVG

I'd assume the same is true for users of mswin.vim too.

@tpope
Copy link
Owner

tpope commented Mar 8, 2019

Does something like this fix it?

nnoremap <Plug>SpeedDatingFallbackUp   <C-A>
nnoremap <Plug>SpeedDatingFallbackDown <C-X>

@idbrii
Copy link
Contributor Author

idbrii commented Apr 3, 2019

Looks like it does. Could that be the default value if g:speeddating_no_mappings == 1 ?

Doesn't fix mswin either.

Feels to me like integrating with other plugins should be an option instead of the default. But I can go with your solution if you want to close.

@tpope
Copy link
Owner

tpope commented Apr 4, 2019

I don't really want to change that now, but I'd entertain special casing for not chaining to gggH<C-O>G, or something like that.

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