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.

39 lines
1.7 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. -- Tab navigation
  23. vim.api.nvim_set_keymap('n', '<A-1>', '1gt', options)
  24. vim.api.nvim_set_keymap('n', '<A-2>', '2gt', options)
  25. vim.api.nvim_set_keymap('n', '<A-3>', '3gt', options)
  26. vim.api.nvim_set_keymap('n', '<A-4>', '4gt', options)
  27. vim.api.nvim_set_keymap('n', '<A-5>', '5gt', options)
  28. vim.api.nvim_set_keymap('n', '<A-6>', '6gt', options)
  29. vim.api.nvim_set_keymap('n', '<A-7>', '7gt', options)
  30. vim.api.nvim_set_keymap('n', '<A-8>', '8gt', options)
  31. vim.api.nvim_set_keymap('n', '<A-9>', '9gt', options)