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.

41 lines
2.0 KiB

  1. local options = { noremap = true }
  2. vim.api.nvim_set_keymap('n', 'c', '"_c', options)
  3. -- Easily open splits
  4. vim.api.nvim_set_keymap('n', '<leader>hs', '<cmd>split<cr>', options)
  5. vim.api.nvim_set_keymap('n', '<leader>vs', '<cmd>vsplit<cr>', options)
  6. -- Copy the entire file
  7. vim.api.nvim_set_keymap('n', '<leader>y', 'ggyG<C-o>', options)
  8. -- Manually store session
  9. vim.api.nvim_set_keymap('n', '<F5>', '<cmd>mksession! ~/.cache//nvim/session/manual_session.vim<cr>', options)
  10. -- Restore manually stored session
  11. vim.api.nvim_set_keymap('n', '<F6>', '<cmd>source ~/.cache/nvim/session/manual_session.vim<cr>', options)
  12. -- Restore auto saved session created on exit
  13. vim.api.nvim_set_keymap('n', '<F7>', '<cmd>source ~/.cache/nvim/session/shutdown_session.vim<CR>', options)
  14. -- Replace all is aliased to S.
  15. vim.api.nvim_set_keymap('n', '<C-s>', '<cmd>%s//g<Left><Left>', options)
  16. -- Navigating with guides
  17. vim.api.nvim_set_keymap('n', '<leader><leader>', '<Esc>/<++><Enter>"_c4l', options)
  18. vim.api.nvim_set_keymap('i', '<leader><leader>', '<Esc>/<++><Enter>"_c4l', options)
  19. vim.api.nvim_set_keymap('v', '<leader><leader>', '<Esc>/<++><Enter>"_c4l', options)
  20. -- Spell-check
  21. vim.api.nvim_set_keymap('n', '<leader>o', '<cmd>setlocal spell! spelllang=en_au<cr>', options)
  22. vim.api.nvim_set_keymap('n', '<A-<>', '<Cmd>BufferMovePrevious<CR>', options)
  23. vim.api.nvim_set_keymap('n', '<A->>', '<Cmd>BufferMoveNext<CR>', options)
  24. vim.api.nvim_set_keymap('n', '<A-1>', '<Cmd>BufferGoto 1<CR>', options)
  25. vim.api.nvim_set_keymap('n', '<A-2>', '<Cmd>BufferGoto 2<CR>', options)
  26. vim.api.nvim_set_keymap('n', '<A-3>', '<Cmd>BufferGoto 3<CR>', options)
  27. vim.api.nvim_set_keymap('n', '<A-4>', '<Cmd>BufferGoto 4<CR>', options)
  28. vim.api.nvim_set_keymap('n', '<A-5>', '<Cmd>BufferGoto 5<CR>', options)
  29. vim.api.nvim_set_keymap('n', '<A-6>', '<Cmd>BufferGoto 6<CR>', options)
  30. vim.api.nvim_set_keymap('n', '<A-7>', '<Cmd>BufferGoto 7<CR>', options)
  31. vim.api.nvim_set_keymap('n', '<A-8>', '<Cmd>BufferGoto 8<CR>', options)
  32. vim.api.nvim_set_keymap('n', '<A-9>', '<Cmd>BufferGoto 9<CR>', options)