nvim/lua/keymap.lua

46 lines
1.2 KiB
Lua
Raw Normal View History

2023-10-01 17:18:36 +08:00
local opt = {noremap = true}
2023-01-19 18:14:43 +08:00
-- base
2023-01-24 22:27:07 +08:00
G.map({
{'n', '<leader>nh', ':nohlsearch<CR>', opt},
2023-01-28 15:11:37 +08:00
{'n', '<leader>rp', ':%s/',opt},
2023-01-19 18:14:43 +08:00
2023-01-24 22:27:07 +08:00
{'v', 'L', '$', opt},
{'v', 'H', '^', opt},
{'n', 'L', '$', opt},
{'n', 'H', '^', opt},
2023-03-24 21:59:13 +08:00
{'v', '>', '>gv', opt},
{'v', '<', '<gv', opt},
2023-01-19 18:14:43 +08:00
2023-01-24 22:27:07 +08:00
{'n', '>', '>>', opt},
{'n', '<', '<<', opt},
{'n', '?', ':set hlsearch<CR>?', opt},
{'n', '/', ':set hlsearch<CR>/', opt},
2023-01-19 18:14:43 +08:00
2023-01-24 22:27:07 +08:00
{'n', '<A-l>', ':tabn<CR>', opt},
{'n', '<A-h>', ':tabp<CR>', opt},
2023-01-19 20:33:35 +08:00
2023-01-19 18:14:43 +08:00
2023-01-24 22:27:07 +08:00
{'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},
2023-05-12 11:20:06 +08:00
2023-11-15 23:40:02 +08:00
{'n', '<c-c>', ':q<CR>', opt},
{'n', '<c-S>', ':w !sudo tee %<CR>', opt},
{'n', '<c-q>', ':q!<CR>', opt},
2023-01-19 18:14:43 +08:00
2023-11-15 23:40:02 +08:00
{'n', '<leader>y', 'ggyG', opt},
{'n', '<leader>p', 'ggpG', opt},
{'n', '<leader>v', 'ggVG', opt},
2023-01-19 18:14:43 +08:00
2023-01-24 22:27:07 +08:00
{'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},
2023-05-12 11:20:06 +08:00
2023-02-11 14:31:48 +08:00
})
2023-01-19 20:33:35 +08:00