chore: separate basic keybindings from advanced
This commit is contained in:
parent
e6e219be26
commit
c3bf916d8a
|
@ -26,13 +26,17 @@ vim.api.nvim_create_user_command("Exit", function()
|
||||||
vim.cmd(":qall")
|
vim.cmd(":qall")
|
||||||
end, {})
|
end, {})
|
||||||
|
|
||||||
|
-- command mode
|
||||||
|
keymap(COMMAND, '<C-a>', '<Home>', { noremap = true })
|
||||||
|
keymap(COMMAND, '<C-e>', '<End>', { noremap = true })
|
||||||
|
keymap(COMMAND, '<C-f>', '<Right>', { noremap = true })
|
||||||
|
keymap(COMMAND, '<C-b>', '<Left>', { noremap = true })
|
||||||
|
keymap(COMMAND, '<C-d>', '<Delete>', { noremap = true })
|
||||||
|
keymap(COMMAND, '<C-n>', '<Down>', { noremap = true })
|
||||||
|
keymap(COMMAND, '<C-p>', '<Up>', { noremap = true })
|
||||||
|
keymap(NORMAL, '<c-s>', ':w<cr>', { noremap = true })
|
||||||
|
keymap(INSERT, '<c-s>', '<esc>:w<cr>a', { noremap = true })
|
||||||
|
|
||||||
keymap(NORMAL, '<c-pagedown>', ':bnext<cr>', { noremap = true })
|
|
||||||
keymap(NORMAL, '<c-pageup>', ':bprev<cr>', { noremap = true })
|
|
||||||
keymap(INSERT, '<c-pagedown>', '<esc>:bnext<cr>', { noremap = true })
|
|
||||||
keymap(INSERT, '<c-pageup>', '<esc>:bprev<cr>', { noremap = true })
|
|
||||||
keymap(NORMAL, '<leader>ss', ':source ~/.config/nvim/init.lua<cr>', { noremap = true })
|
|
||||||
keymap(NORMAL, '<leader>sc', ':source %<cr>', { noremap = true })
|
|
||||||
keymap(NORMAL, '<leader>w', ':w<cr>', { noremap = true })
|
keymap(NORMAL, '<leader>w', ':w<cr>', { noremap = true })
|
||||||
keymap(VISUAL, '<leader>y', '"+y<cr>', { noremap = true })
|
keymap(VISUAL, '<leader>y', '"+y<cr>', { noremap = true })
|
||||||
keymap(NORMAL, '<leader>yp', ':let @+=expand("%:p")<cr>', { noremap = true })
|
keymap(NORMAL, '<leader>yp', ':let @+=expand("%:p")<cr>', { noremap = true })
|
||||||
|
@ -42,14 +46,28 @@ keymap(VISUAL, '<leader>p', '"0p<cr>', { noremap = true })
|
||||||
keymap(NORMAL, '<leader>q', ':bd<cr>', { noremap = true })
|
keymap(NORMAL, '<leader>q', ':bd<cr>', { noremap = true })
|
||||||
keymap(NORMAL, '<leader>qq', ':Exit<cr>', { noremap = true })
|
keymap(NORMAL, '<leader>qq', ':Exit<cr>', { noremap = true })
|
||||||
keymap(NORMAL, '<leader>ne', ':e %:h<cr>', { noremap = true })
|
keymap(NORMAL, '<leader>ne', ':e %:h<cr>', { noremap = true })
|
||||||
keymap(NORMAL, '<c-s>', ':w<cr>', { noremap = true })
|
|
||||||
keymap(INSERT, '<c-s>', '<esc>:w<cr>a', { noremap = true })
|
|
||||||
keymap(NORMAL, '<leader>h', '<c-w>h', { noremap = true })
|
keymap(NORMAL, '<leader>h', '<c-w>h', { noremap = true })
|
||||||
keymap(NORMAL, '<leader>j', '<c-w>j', { noremap = true })
|
keymap(NORMAL, '<leader>j', '<c-w>j', { noremap = true })
|
||||||
keymap(NORMAL, '<leader>k', '<c-w>k', { noremap = true })
|
keymap(NORMAL, '<leader>k', '<c-w>k', { noremap = true })
|
||||||
keymap(NORMAL, '<leader>l', '<c-w>l', { noremap = true })
|
keymap(NORMAL, '<leader>l', '<c-w>l', { noremap = true })
|
||||||
keymap(NORMAL, '<leader>oo', '<c-w>o', { noremap = true })
|
keymap(NORMAL, '<leader>oo', '<c-w>o', { noremap = true })
|
||||||
keymap(NORMAL, '<leader><esc>', ':noh<cr>', { noremap = true })
|
keymap(NORMAL, '<leader><esc>', ':noh<cr>', { noremap = true })
|
||||||
|
keymap(NORMAL, '<leader>cn', ':cnext<cr>', { noremap = true })
|
||||||
|
keymap(NORMAL, '<leader>cp', ':cprev<cr>', { noremap = true })
|
||||||
|
keymap(NORMAL, '<leader>bo', ':CloseOtherBuffers<cr>', { noremap = true })
|
||||||
|
-- search and replace highlighted
|
||||||
|
keymap(VISUAL, '/', "y/\\V<C-R>=escape(@\",'/\\')<CR><CR>", { noremap = true })
|
||||||
|
keymap(NORMAL, '<leader>r', ':%s///g<left><left>', { noremap = true })
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
keymap(NORMAL, '<c-pagedown>', ':bnext<cr>', { noremap = true })
|
||||||
|
keymap(NORMAL, '<c-pageup>', ':bprev<cr>', { noremap = true })
|
||||||
|
keymap(INSERT, '<c-pagedown>', '<esc>:bnext<cr>', { noremap = true })
|
||||||
|
keymap(INSERT, '<c-pageup>', '<esc>:bprev<cr>', { noremap = true })
|
||||||
|
keymap(NORMAL, '<leader>ss', ':source ~/.config/nvim/init.lua<cr>', { noremap = true })
|
||||||
|
keymap(NORMAL, '<leader>sc', ':source %<cr>', { noremap = true })
|
||||||
keymap(NORMAL, '<c-p>', ':Telescope find_files follow=true<cr>', { noremap = true })
|
keymap(NORMAL, '<c-p>', ':Telescope find_files follow=true<cr>', { noremap = true })
|
||||||
keymap(NORMAL, '<leader>t', ':NvimTreeToggle<cr>', { noremap = true })
|
keymap(NORMAL, '<leader>t', ':NvimTreeToggle<cr>', { noremap = true })
|
||||||
keymap(NORMAL, '<leader>tf', ':NvimTreeFindFile<cr>', { noremap = true })
|
keymap(NORMAL, '<leader>tf', ':NvimTreeFindFile<cr>', { noremap = true })
|
||||||
|
@ -68,24 +86,12 @@ keymap(NORMAL, '<leader>gb', ':Git blame<cr>', { noremap = true })
|
||||||
keymap(NORMAL, '<leader>gl', ':Git log<cr>', { noremap = true })
|
keymap(NORMAL, '<leader>gl', ':Git log<cr>', { noremap = true })
|
||||||
keymap(NORMAL, '<leader>gpr', ':!gpr<cr>', { noremap = true })
|
keymap(NORMAL, '<leader>gpr', ':!gpr<cr>', { noremap = true })
|
||||||
keymap(NORMAL, 'gp', ':GotoParent<cr>', { noremap = true })
|
keymap(NORMAL, 'gp', ':GotoParent<cr>', { noremap = true })
|
||||||
keymap(NORMAL, '<leader>cn', ':cnext<cr>', { noremap = true })
|
|
||||||
keymap(NORMAL, '<leader>cp', ':cprev<cr>', { noremap = true })
|
|
||||||
keymap(NORMAL, '<leader>bo', ':CloseOtherBuffers<cr>', { noremap = true })
|
|
||||||
keymap(NORMAL, '<leader>sif', ':SearchInFolder<cr>', { noremap = true })
|
keymap(NORMAL, '<leader>sif', ':SearchInFolder<cr>', { noremap = true })
|
||||||
keymap(NORMAL, '<leader>cx', ':ToggleExecutable<cr>', { noremap = true })
|
keymap(NORMAL, '<leader>cx', ':ToggleExecutable<cr>', { noremap = true })
|
||||||
keymap(NORMAL, '<leader>rs', ':RunScript<cr>', { noremap = true })
|
keymap(NORMAL, '<leader>rs', ':RunScript<cr>', { noremap = true })
|
||||||
keymap(NORMAL, '<leader>do', ':lua vim.diagnostic.open_float()<cr>', { noremap = true })
|
keymap(NORMAL, '<leader>do', ':lua vim.diagnostic.open_float()<cr>', { noremap = true })
|
||||||
|
|
||||||
|
|
||||||
-- command mode
|
|
||||||
keymap(COMMAND, '<C-a>', '<Home>', { noremap = true })
|
|
||||||
keymap(COMMAND, '<C-e>', '<End>', { noremap = true })
|
|
||||||
keymap(COMMAND, '<C-f>', '<Right>', { noremap = true })
|
|
||||||
keymap(COMMAND, '<C-b>', '<Left>', { noremap = true })
|
|
||||||
keymap(COMMAND, '<C-d>', '<Delete>', { noremap = true })
|
|
||||||
keymap(COMMAND, '<C-n>', '<Down>', { noremap = true })
|
|
||||||
keymap(COMMAND, '<C-p>', '<Up>', { noremap = true })
|
|
||||||
|
|
||||||
-- keymap(INSERT, '<C-a>', '<Home>', { noremap = true })
|
-- keymap(INSERT, '<C-a>', '<Home>', { noremap = true })
|
||||||
-- keymap(INSERT, '<C-e>', '<End>', { noremap = true })
|
-- keymap(INSERT, '<C-e>', '<End>', { noremap = true })
|
||||||
-- keymap(INSERT, '<C-f>', '<Right>', { noremap = true })
|
-- keymap(INSERT, '<C-f>', '<Right>', { noremap = true })
|
||||||
|
@ -97,9 +103,6 @@ keymap(COMMAND, '<C-p>', '<Up>', { noremap = true })
|
||||||
vim.g.AutoPairsShortcutToggle = "<leader>ap"
|
vim.g.AutoPairsShortcutToggle = "<leader>ap"
|
||||||
|
|
||||||
|
|
||||||
-- search and replace highlighted
|
|
||||||
keymap(VISUAL, '/', "y/\\V<C-R>=escape(@\",'/\\')<CR><CR>", { noremap = true })
|
|
||||||
keymap(NORMAL, '<leader>r', ':%s///g<left><left>', { noremap = true })
|
|
||||||
-- xnoremap <leader>r :s///g<left><left>
|
-- xnoremap <leader>r :s///g<left><left>
|
||||||
|
|
||||||
-- debugger
|
-- debugger
|
||||||
|
|
Loading…
Reference in New Issue
Block a user