navigation.lua 758 B

12345678910111213141516171819202122232425262728
  1. local demicolon = require('demicolon')
  2. local Treewalker = require('treewalker')
  3. -- ,/; for bracket motions too
  4. demicolon.setup({
  5. keymaps = {
  6. disabled_keys = {
  7. -- this is paste with indent, not a motion
  8. 'p',
  9. }
  10. }
  11. })
  12. -- Treesitter navigation
  13. Treewalker.setup()
  14. vim.keymap.set({ 'n', 'v' }, '<C-k>', '<cmd>Treewalker Up<cr>')
  15. vim.keymap.set({ 'n', 'v' }, '<C-j>', '<cmd>Treewalker Down<cr>')
  16. vim.keymap.set({ 'n', 'v' }, '<C-h>', '<cmd>Treewalker Left<cr>')
  17. vim.keymap.set({ 'n', 'v' }, '<C-l>', '<cmd>Treewalker Right<cr>')
  18. -- jumplist navigation #bracketed
  19. vim.keymap.set('n', '[f', '<C-O>')
  20. vim.keymap.set('n', ']f', '<C-I>')
  21. -- window navigation #bracketed
  22. vim.keymap.set('n', '[w', '<C-w>W')
  23. vim.keymap.set('n', ']w', '<C-w>w')