bullets.vim icon indicating copy to clipboard operation
bullets.vim copied to clipboard

How to disable a default mapping?

Open BSDxxxx opened this issue 5 years ago • 9 comments

Sorry, I'm new to vim, and there is no example in the help file.

How disable <space>x? and How to map it to another key?

BSDxxxx avatar Mar 14 '20 04:03 BSDxxxx

Why did this issue get closed? I'm wondering the same thing. Is there a way to disable only <leader>x and keep all other default mappings?

mawkler avatar Apr 08 '20 21:04 mawkler

@Melkster Kind of solved this problem myself, I asked this question cause I have try remapped <leader>x like:

autocmd filetype vimwiki.markdown.pandoc nnoremap <buffer> <silent> <LEADER>x :VimwikiToggleListItem<CR>

It didn't work before. But somehow It works for now, not sure why.

I do not see how to disable <LEADER>x in help file. One absolute solution for that is using myafter.vim: create a file ~/.vim/after/plugin/after.vim, and insert:

"this script will be load after plugins have been loaded, so it can overwrite plugin settings, but make sure it's in your vim run time path
unmap <Leader>x

BSDxxxx avatar Apr 09 '20 03:04 BSDxxxx

@BSDxxxx What I'm looking to do is to remap the functionality of <leader>x to <leader>X because it conflicts with the ConflictMotions plugin's mappings, which I would like to keep as they are. I think your solution would be kind of messy since I would have to unmap <leader>x and then remap already default ConflictMotions mappings for <leader>x in my ~/.vimrc and I think it would be nice if bullets.vim had something built in for this purpose.

mawkler avatar Apr 09 '20 09:04 mawkler

@Melkster I'll reopen this issue for you.
BTW, switch the position of bullets.vim and ComflictMotions in your vimrc may do the trick.

BSDxxxx avatar Apr 09 '20 09:04 BSDxxxx

@BSDxxxx Thanks!

BTW, switch the position of bullets.vim and ComflictMotions in your vimrc may do the trick.

The problem is that ConflictMotions has only mappings with one more characters after x, like <leader>x> etc. so it's not a direct map conflict, but I'm annoyed by the delay after checking a box using <leader>x since Vim is waiting for more potential characters for ConflictMotions and that's why I want to remap bullets.vim's :ToggleCheckbox to <leader>X.

mawkler avatar Apr 09 '20 10:04 mawkler

@Melkster @BSDxxxx I agree that we should have more granularity in mapping configuration. I'll take a PR for that, otherwise it may be a little bit before I have time to do it myself.

dkarter avatar May 05 '20 17:05 dkarter

Hello, how can I disable <ledaer>x? Since I got several other keybindings like <leader>xa and <leader>xd, <leader>x is just a prefix, <leader>x in bullets.vim make them unaccessible, I would like to rebind :ToggleCheckbox to another mapping like <leader>xx. Keep other keybindings and only change this.

c02y avatar Apr 22 '21 02:04 c02y

@c02y I don't know how to disable <leader>x, but if you just add nnoremap <leader>xx :ToggleCheckbox<CR> it should not conflict with your other bindings.

mawkler avatar Apr 22 '21 09:04 mawkler

Yeah, sorry about that, since the binding of <leader>x is still listed in my which-key and it is still working, I thought the sub-keybindings under <leader>x are not working anymore, actually they are all working.

c02y avatar Apr 22 '21 10:04 c02y

@BSDxxxx I guess new change for making custom mappings would cover your needs. Look for g:bullets_custom_mappings in the README.

wenzel-hoffman avatar Sep 12 '22 20:09 wenzel-hoffman

Thanks @wenzel-hoffman ! Closing this for now since the addition of g:bullets_custom_mappings along with let g:bullets_set_mappings = 0 should provide an adequate solution.

dkarter avatar Sep 14 '22 22:09 dkarter