I try to configure my .vimrc
file adding new shortcuts for my daily routing.
One of my basic operations in every single IDE is switching between "tabs". I suppose to put the same key binding for each IDE i'm using on actually and ViM also suitable for me (sometimes).
The next code (.vimrc
) works perfectly with any existed file I've opened in Vim.
" Create / Navigate through Tabs
nnoremap <C-t> :tabnew<CR>
nnoremap <C-]> :tabnext<CR>
inoremap <C-t> <Esc>:tabnew<CR>
inoremap <C-]> <Esc>:tabnext<CR>i
Here's just 2 commands: create new tab and move to next. But I want to move back as well!
Next code
nnoremap <C-[> :tabprevious<CR>
inoremap <C-[> <Esc>:tabprevious<CR>i
provides strange behaviour for opened files (existed only).
The Questions
How can I fix such shortcut code and make it correct for ViM?
Ctrl-[
is the same as pressingEsc
? In insert mode typeCtrl-V
then one of them thenCtrl-V
and the other. Same output.Ctrl-[
to my needs? @BLayer<C-[>
breaking because it duplicates<Esc>
. But anyway for this kind of questions How to debug a mapping can be useful, the part aboutRemember that some key combinations are equivalent
especially.