| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- local demicolon = require('demicolon')
- local MiniBracketed = require('mini.bracketed')
- local Treewalker = require('treewalker')
- -- ,/; for bracket motions too
- demicolon.setup({
- keymaps = {
- disabled_keys = {
- -- this is paste with indent, not a motion
- 'p',
- -- we bind these to ; and ,
- ']',
- '[',
- }
- }
- })
- vim.keymap.set('n', ']]', ';', { remap = true })
- vim.keymap.set('n', '[[', ',', { remap = true })
- -- more bracket motions
- MiniBracketed.setup({
- -- some of our mappings and the builtin mappings overlap with these so enable
- -- only those we actually want to use
- buffer = { suffix = '' },
- comment = { suffix = '' },
- conflict = { suffix = '' },
- diagnostic = { suffix = '' },
- file = { suffix = '' },
- indent = { suffix = '' },
- jump = { suffix = '' },
- location = { suffix = '' },
- oldfile = { suffix = '' },
- quickfix = { suffix = '' },
- treesitter = { suffix = '' },
- window = { suffix = '' },
- yank = { suffix = '' },
- undo = { suffix = 'u' },
- })
- -- Treesitter navigation
- Treewalker.setup()
- vim.keymap.set({ 'n', 'v' }, '<C-k>', '<cmd>Treewalker Up<cr>')
- vim.keymap.set({ 'n', 'v' }, '<C-j>', '<cmd>Treewalker Down<cr>')
- vim.keymap.set({ 'n', 'v' }, '<C-h>', '<cmd>Treewalker Left<cr>')
- vim.keymap.set({ 'n', 'v' }, '<C-l>', '<cmd>Treewalker Right<cr>')
- -- jumplist navigation #bracketed
- vim.keymap.set('n', '[f', '<C-O>')
- vim.keymap.set('n', ']f', '<C-I>')
- -- window navigation #bracketed
- vim.keymap.set('n', '[w', '<C-w>W')
- vim.keymap.set('n', ']w', '<C-w>w')
|