I use ',' as leader, so when I f/t and I want to go to previous hit, I cannto use ','
I tried using #:
nnoremap # ,
My mapping shows up (I think), :map # shows this
n # * ,
but it does nothing. Something obvious I am missing?
Vi and Vim Stack Exchange is a question and answer site for people using the vi and Vim families of text editors. It only takes a minute to sign up.Sign up to join this community
You mentioned vim-sneak in your comments, and that's probably it here.
vim-sneak will try to map
,. It actually expects you might be using
, as a leader/localleader, it will check for whether you've mapped it and, if so, it will check for whether you've mapped
, and use that instead. You can see the code doing that here.
Since you want to use
# instead, just map it directly to the
<Plug> mapping exposed by vim-plug:
nmap # <Plug>Sneak_, omap # <Plug>Sneak_, xmap # <Plug>Sneak_,
It should be fine to add this to your vimrc (even though the plug-in actually gets loaded later on), but if you run into issues with that, consider creating a file named
~/.vim/after/plugin/*.vim and add those commands there instead, that will run after vim-sneak is loaded.
You could also use that file to remove any vim-sneak mappings from
, (if it happens to be adding any), if you intend to use it as a leader.