vim exit terminal-mode to normal mode with sane keys

This commit is contained in:
Christoph J. Scherr 2023-02-10 14:27:17 +01:00
parent 836aa54216
commit 3cef2a5672
3 changed files with 21 additions and 0 deletions

View File

@ -74,6 +74,15 @@ map <Leader>" :vsplit<CR>
" split with <Leader>, then %"
map <Leader>% :split<CR>
" automatically enter insert mode on new neovim terminals
augroup terminal
au TermOpen * startinsert
augroup END
" enter normal mode from terminal-emulator with <C-w>
inoremap <C-w> <Esc>
tnoremap <C-w> <C-\><C-n>
" :W to write file as root"
command W :SudaWrite

View File

@ -74,6 +74,15 @@ map <Leader>" :vsplit<CR>
" split with <Leader>, then %"
map <Leader>% :split<CR>
" automatically enter insert mode on new neovim terminals
augroup terminal
au TermOpen * startinsert
augroup END
" enter normal mode from terminal-emulator with <C-w>
inoremap <C-w> <Esc>
tnoremap <C-w> <C-\><C-n>
" :W to write file as root"
command W :SudaWrite

View File

@ -66,6 +66,9 @@ map <Leader>" :vsplit<CR>
" split with <Leader>, then %"
map <Leader>% :split<CR>
" enter normal mode from terminal-emulator width <ESC>
tnoremap <Esc> <C-\><C-n>
" :W to write file as root"
command W :w ! sudo tee %
" Set completeopt to have a better completion experience"