nvim: add shortcuts for quitting, remove the ones that can lead to data loss

master
tiyn 9 months ago
parent ec55f21719
commit 9f70da80e3

@ -16,6 +16,7 @@ m.nname("<C-W>", "Navigation")
-- unmap unwanted commands -- unmap unwanted commands
m.nnoremap("Zt", '<NOP>') m.nnoremap("Zt", '<NOP>')
m.nnoremap("ZT", '<NOP>') m.nnoremap("ZT", '<NOP>')
m.nnoremap("ZQ", '<NOP>')
m.nnoremap("<Space>", '<NOP>') m.nnoremap("<Space>", '<NOP>')
m.inoremap("<F2>", '<NOP>') m.inoremap("<F2>", '<NOP>')
m.inoremap("<F3>", '<NOP>') m.inoremap("<F3>", '<NOP>')
@ -32,6 +33,10 @@ m.nnoremap("<F11>", '<NOP>')
m.inoremap("<F12>", '<NOP>') m.inoremap("<F12>", '<NOP>')
m.nnoremap("<F12>", '<NOP>') m.nnoremap("<F12>", '<NOP>')
-- shortcuts for quitting
m.nnoremap("ZZ", ':x<CR>', 'Exit: write and quit current buffer')
m.nnoremap("ZA", ':conf xa<CR>', 'Exit: write and quit all buffers')
-- shortcut for split navigation -- shortcut for split navigation
m.nnoremap("<C-h>", '<C-w>h', 'Navigation: go to left window') m.nnoremap("<C-h>", '<C-w>h', 'Navigation: go to left window')
m.nnoremap("<C-j>", '<C-w>j', 'Navigation: go to lower window') m.nnoremap("<C-j>", '<C-w>j', 'Navigation: go to lower window')

Loading…
Cancel
Save