0

I'm relatively new to vim rebinds; I am trying to map <leader>q to exit vim, but the following rebind does not seem to work:

map <leader>q :q<cr>

However, all of the following seem to be working:

nmap <leader>w :w!<cr>

map <leader>tn :tabnew<cr>
map <leader>to :tabonly<cr>
map <leader>tc :tabclose<cr>
map <leader>tm :tabmove
map <leader>t<leader> :tabnext

I'm using this basic vimrc configuration as a template

Edit: turns out it was a completely unrelated problem, see the answer below.

1 Answer 1

1

As it turned out, I was defining map <leader>q :q<cr> before the line let mapleader = ";", which meant that for <leader>q, the leader key was either undefined or mapped to some other key.

To future beginner vim users out there, always define mapleader before you add any map <leader>X rebinds!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.