|
@ -1,7 +1,11 @@ |
|
|
local options = { noremap = true } |
|
|
local options = { noremap = true } |
|
|
|
|
|
|
|
|
-- Source init.lua |
|
|
-- Source init.lua |
|
|
vim.api.nvim_set_keymap('n', '<leader>so', '<cmd>source ~/.config/nvim/init.lua<CR>', options) |
|
|
|
|
|
|
|
|
vim.api.nvim_set_keymap('n', |
|
|
|
|
|
'<leader>so', |
|
|
|
|
|
'<cmd>source ~/.config/nvim/init.lua<CR>', |
|
|
|
|
|
options |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
-- Don't copy "c" changes to primary register |
|
|
-- Don't copy "c" changes to primary register |
|
|
vim.api.nvim_set_keymap('n', 'c', '"_c', options) |
|
|
vim.api.nvim_set_keymap('n', 'c', '"_c', options) |
|
@ -14,22 +18,44 @@ vim.api.nvim_set_keymap('n', '<leader>vs', '<cmd>vsplit<cr>', options) |
|
|
vim.api.nvim_set_keymap('n', '<leader>y', 'ggyG<C-o>', options) |
|
|
vim.api.nvim_set_keymap('n', '<leader>y', 'ggyG<C-o>', options) |
|
|
|
|
|
|
|
|
-- Manually store session |
|
|
-- Manually store session |
|
|
vim.api.nvim_set_keymap('n', '<F5>', '<cmd>mksession! ~/.cache//nvim/session/manual_session.vim<CR>', options) |
|
|
|
|
|
|
|
|
vim.api.nvim_set_keymap( |
|
|
|
|
|
'n', |
|
|
|
|
|
'<F5>', |
|
|
|
|
|
'<cmd>mksession! ~/.cache//nvim/session/manual_session.vim<CR>', |
|
|
|
|
|
options |
|
|
|
|
|
) |
|
|
-- Restore manually stored session |
|
|
-- Restore manually stored session |
|
|
vim.api.nvim_set_keymap('n', '<F6>', '<cmd>source ~/.cache/nvim/session/manual_session.vim<CR>', options) |
|
|
|
|
|
|
|
|
vim.api.nvim_set_keymap('n', |
|
|
|
|
|
'<F6>', |
|
|
|
|
|
'<cmd>source ~/.cache/nvim/session/manual_session.vim<CR>', |
|
|
|
|
|
options |
|
|
|
|
|
) |
|
|
-- Restore auto saved session created on exit |
|
|
-- Restore auto saved session created on exit |
|
|
vim.api.nvim_set_keymap('n', '<F7>', '<cmd>source ~/.cache/nvim/session/shutdown_session.vim<CR>', options) |
|
|
|
|
|
|
|
|
vim.api.nvim_set_keymap('n', |
|
|
|
|
|
'<F7>', |
|
|
|
|
|
'<cmd>source ~/.cache/nvim/session/shutdown_session.vim<CR>', |
|
|
|
|
|
options |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
-- Replace all is aliased to S. |
|
|
-- Replace all is aliased to S. |
|
|
vim.api.nvim_set_keymap('n', '<C-s>', '<cmd>%s//g<Left><Left>', options) |
|
|
vim.api.nvim_set_keymap('n', '<C-s>', '<cmd>%s//g<Left><Left>', options) |
|
|
|
|
|
|
|
|
-- Navigating with guides |
|
|
-- Navigating with guides |
|
|
vim.api.nvim_set_keymap('n', '<leader><leader>', '<Esc>/<++><Enter>"_c4l', options) |
|
|
|
|
|
-- vim.api.nvim_set_keymap('i', '<leader><leader>', '<Esc>/<++><Enter>"_c4l', options) |
|
|
|
|
|
vim.api.nvim_set_keymap('v', '<leader><leader>', '<Esc>/<++><Enter>"_c4l', options) |
|
|
|
|
|
|
|
|
vim.api.nvim_set_keymap('n', |
|
|
|
|
|
'<leader><leader>', |
|
|
|
|
|
'<Esc>/<++><Enter>"_c4l', |
|
|
|
|
|
options |
|
|
|
|
|
) |
|
|
|
|
|
vim.api.nvim_set_keymap('v', |
|
|
|
|
|
'<leader><leader>', |
|
|
|
|
|
'<Esc>/<++><Enter>"_c4l', |
|
|
|
|
|
options) |
|
|
|
|
|
|
|
|
-- Spell-check |
|
|
-- Spell-check |
|
|
vim.api.nvim_set_keymap('n', '<leader>o', '<cmd>setlocal spell! spelllang=en_au<cr>', options) |
|
|
|
|
|
|
|
|
vim.api.nvim_set_keymap('n', |
|
|
|
|
|
'<leader>o', |
|
|
|
|
|
'<cmd>setlocal spell! spelllang=en_au<cr>', |
|
|
|
|
|
options) |
|
|
|
|
|
|
|
|
-- Keep highlight when indenting |
|
|
-- Keep highlight when indenting |
|
|
vim.api.nvim_set_keymap('v', '<', '<gv', options) |
|
|
vim.api.nvim_set_keymap('v', '<', '<gv', options) |
|
@ -51,3 +77,7 @@ vim.api.nvim_set_keymap('n', '<leader>ga', '<cmd>Git add .<CR>', options) |
|
|
vim.api.nvim_set_keymap('n', '<leader>gA', '<cmd>Git add<CR>', options) |
|
|
vim.api.nvim_set_keymap('n', '<leader>gA', '<cmd>Git add<CR>', options) |
|
|
vim.api.nvim_set_keymap('n', '<leader>gc', '<cmd>Git commit<CR>', options) |
|
|
vim.api.nvim_set_keymap('n', '<leader>gc', '<cmd>Git commit<CR>', options) |
|
|
vim.api.nvim_set_keymap('n', '<leader>gC', '<cmd>Git commit -a<CR>', options) |
|
|
vim.api.nvim_set_keymap('n', '<leader>gC', '<cmd>Git commit -a<CR>', options) |
|
|
|
|
|
|
|
|
|
|
|
vim.api.nvim_set_keymap("x", "<leader>p", "\"_dP", options) |
|
|
|
|
|
vim.api.nvim_set_keymap("n", "<leader>d", "\"_d", options) |
|
|
|
|
|
vim.api.nvim_set_keymap("v", "<leader>d", "\"_d", options) |