Relativity
Relativity

Reputation: 137

What does <A-1> and <Cmd> mean in VIM?

I'm trying to switch to vim and I'm having some difficulty trying to understand what these remaps mean.

I'm using this tab plugin from https://github.com/romgrk/barbar.nvim.

In the read me file they have something to bounce from tabs with the commands as the following:

nnoremap <silent>    <A-1> <Cmd>BufferGoto 1<CR>
nnoremap <silent>    <A-2> <Cmd>BufferGoto 2<CR>

Can anyone enlighten me and future viewers of this thread, what these commands are and what they mean?

Thank you.

Upvotes: 1

Views: 1278

Answers (1)

chepner
chepner

Reputation: 530853

The various *map commands cause one set of keys to be replaced by another.

<A-1> and <A-2 are special key names representing Alt-1 and Alt-2, respectively (hold down the Alt key, then press 1 or 2).

<Cmd> indicates that the following text should not be used literally, but is a command that should be executed instead.

So pressing Alt+1 switches to buffer 1, and pressing Alt+2 switches to buffer 2.

Upvotes: 2

Related Questions