You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

35 lines
1.5 KiB

local options = { noremap = true }
vim.api.nvim_set_keymap('n', 'c', '"_c', options)
-- Easily open splits
vim.api.nvim_set_keymap('n', '<leader>hs', '<cmd>split<cr>', options)
vim.api.nvim_set_keymap('n', '<leader>vs', '<cmd>vsplit<cr>', options)
-- Copy the entire file
vim.api.nvim_set_keymap('n', '<leader>y', 'ggyG<C-o>', options)
-- Easily navigate tabs
vim.api.nvim_set_keymap('n', '<leader>1', '1gt', options)
vim.api.nvim_set_keymap('n', '<leader>2', '2gt', options)
vim.api.nvim_set_keymap('n', '<leader>3', '3gt', options)
vim.api.nvim_set_keymap('n', '<leader>4', '4gt', options)
vim.api.nvim_set_keymap('n', '<leader>5', '5gt', options)
-- Manually store session
vim.api.nvim_set_keymap('n', '<F5>', '<cmd>mksession! ~/.config/nvim/session/manual_session.vim<cr>', options)
-- Restore manually stored session
vim.api.nvim_set_keymap('n', '<F6>', '<cmd>source ~/.config/nvim/session/manual_session.vim<cr>', options)
-- Restore auto saved session created on exit
vim.api.nvim_set_keymap('n', '<F7>', '<cmd>source ~/.config/nvim/session/shutdown_session.vim<CR>', options)
-- Replace all is aliased to S.
vim.api.nvim_set_keymap('n', '<C-s>', '<cmd>%s//g<Left><Left>', options)
-- 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)
-- Spell-check
vim.api.nvim_set_keymap('n', '<leader>o', '<cmd>setlocal spell! spelllang=en_au<cr>', options)