Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why might this vim mapping be slow?

Tags:

vim

I have the following mapping in my vimrc:

noremap <leader>b :buffers<CR>:buffer<Space>

Unfortunately there is about a half second to second delay to display the buffer list. Is there an obvious reason for this? How might I debug it if not?

like image 883
rainkinz Avatar asked Sep 19 '25 12:09

rainkinz


1 Answers

:verbose noremap <leader>b

lists all mappings that start with <Leader>b (and with :verbose, also where they got defined). To make Vim detect the mapping faster, you need to resolve the ambiguity, either by adding more characters to make the mapping keys unique (e.g. <Leader>bb), or by choosing different keys that aren't yet used in another mapping (e.g. <Leader>B).

like image 155
Ingo Karkat Avatar answered Sep 21 '25 05:09

Ingo Karkat