nvim/lua/normal/keymap.lua

68 lines
1.5 KiB
Lua
Raw Normal View History

2023-09-30 20:08:03 +08:00
2023-01-28 15:11:37 +08:00
local G, opt = require('G'), {noremap = true}
2023-01-19 18:14:43 +08:00
-- base
2023-01-24 22:27:07 +08:00
G.map({
{'n', '<leader>y', '"+y', opt},
{'n', '<leader>p', '"+p', opt},
{'n', '<leader>d', '"+d', opt},
2023-01-22 17:20:38 +08:00
2023-01-24 22:27:07 +08:00
{'v', '<leader>y', '"+y', opt},
{'v', '<leader>p', '"+p', opt},
{'v', '<leader>d', '"+d', opt},
2023-01-22 17:20:38 +08:00
2023-01-24 22:27:07 +08:00
{'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-03-24 21:59:13 +08:00
{'n', '<c-c>', ':q<CR>', opt},
{'n', '<c-s>', ':s<CR>', opt},
2023-01-19 18:14:43 +08:00
2023-01-24 22:27:07 +08:00
{'n', '<leader><leader>y', 'ggyG', opt},
{'n', '<leader><leader>p', 'ggpG', opt},
{'n', '<leader><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
2023-02-11 14:31:48 +08:00
--EasyAlign
G.map({
2023-05-08 10:52:46 +08:00
{"v", "ga", ":EasyAlign<CR>", opt},
})
--NvimTree
G.map({
2023-05-08 11:30:06 +08:00
{"n", "<c-e>", ":NERDTreeToggle<CR>", opt},
2023-02-11 14:31:48 +08:00
})
2023-01-19 20:33:35 +08:00