nvim/lua/keymap.lua
2023-11-26 18:13:46 +08:00

46 lines
1.2 KiB
Lua

local opt = {noremap = true}
-- base
G.map({
{'n', '<leader>nh', ':nohlsearch<CR>', opt},
{'n', '<leader>rp', ':%s/',opt},
{'v', 'L', '$', opt},
{'v', 'H', '^', opt},
{'n', 'L', '$', opt},
{'n', 'H', '^', opt},
{'v', '>', '>gv', opt},
{'v', '<', '<gv', opt},
{'n', '>', '>>', opt},
{'n', '<', '<<', opt},
{'n', '?', ':set hlsearch<CR>?', opt},
{'n', '/', ':set hlsearch<CR>/', opt},
{'n', '<A-l>', ':tabn<CR>', opt},
{'n', '<A-h>', ':tabp<CR>', opt},
{'n', '<c-j>', '<c-w>j', opt},
{'n', '<c-h>', '<c-w>h', opt},
{'n', '<c-k>', '<c-w>k', opt},
{'n', '<c-l>', '<c-w>l', opt},
{'n', '<c-c>', ':q<CR>', opt},
{'n', '<c-S>', ':w !sudo tee %<CR>', opt},
{'n', '<c-q>', ':q!<CR>', opt},
{'n', '<leader>y', 'ggyG', opt},
{'n', '<leader>p', 'ggpG', opt},
{'n', '<leader>v', 'ggVG', opt},
{'n', '<up>', ':res -5<CR>', opt},
{'n', '<down>', ':res +5<CR>', opt},
{'n', '<left>', ':vertical resize -5<CR>', opt},
{'n', '<right>', ':vertical resize +5<CR>', opt},
})