Greg
Greg

Reputation: 51

VIM taglist toggle on/off

I'm using taglist in VIM and i have remapped F12 so that it will call :TaglistToggle

nnoremap <F12> :TaglistToggle

is there a way that i can hit F12 and it will toggle the list on/off without having to hit return.

At the moment F12 will just place the command TaglistToggle in the command buffer and then i have to hit return to carry out the command.

Thanks

Upvotes: 1

Views: 1171

Answers (2)

chrullrich
chrullrich

Reputation: 1

You can include keystrokes in the command as well:

nnoremap <F12> :TaglistToggle<enter>

Upvotes: 0

Sven Koschnicke
Sven Koschnicke

Reputation: 6711

put <CR> (which is interpreted as carriage return) behind it:

nnoremap <F12> :TaglistToggle<CR>

Upvotes: 5

Related Questions