Neovim: fixed tmux navigation and ; or , for fFtT issues

This commit is contained in:
Kyren223
2024-07-14 17:35:32 +03:00
parent 282c1c9db7
commit dfec7d14b4
2 changed files with 12 additions and 6 deletions

View File

@@ -2,10 +2,10 @@ return {
{
'christoomey/vim-tmux-navigator',
config = function()
vim.keymap.set('n', 'C-h', '<cmd>TmuxNavigatorLeft<CR>')
vim.keymap.set('n', 'C-j', '<cmd>TmuxNavigatorDown<CR>')
vim.keymap.set('n', 'C-k', '<cmd>TmuxNavigatorUp<CR>')
vim.keymap.set('n', 'C-l', '<cmd>TmuxNavigatorRight<CR>')
vim.keymap.set('n', '<C-h>', '<cmd>TmuxNavigatorLeft<CR>')
vim.keymap.set('n', '<C-j>', '<cmd>TmuxNavigatorDown<CR>')
vim.keymap.set('nC', '<C-k>', '<cmd>TmuxNavigatorUp<CR>')
vim.keymap.set('n', '<C-l>', '<cmd>TmuxNavigatorRight<CR>')
end,
},
{

View File

@@ -35,9 +35,9 @@ return {
},
selection_modes = {
['@parameter.outer'] = 'v', -- charwise
['@function.outer'] = 'V', -- linewise
['@function.outer'] = 'V', -- linewise
['@class.outer'] = '<c-v>', -- blockwise
['@assignment.rhs'] = 'v', -- charwise
['@assignment.rhs'] = 'v', -- charwise
},
},
swap = {
@@ -56,6 +56,12 @@ return {
-- Repeat movement with ; and ,
vim.keymap.set({ 'n', 'x', 'o' }, ';', ts_repeat_move.repeat_last_move_next)
vim.keymap.set({ 'n', 'x', 'o' }, ',', ts_repeat_move.repeat_last_move_previous)
-- NOTE: You need this, otherwise the normal ; and , won't work for fFtT
vim.keymap.set({ 'n', 'x', 'o' }, 'f', ts_repeat_move.builtin_f_expr, { expr = true })
vim.keymap.set({ 'n', 'x', 'o' }, 'F', ts_repeat_move.builtin_F_expr, { expr = true })
vim.keymap.set({ 'n', 'x', 'o' }, 't', ts_repeat_move.builtin_t_expr, { expr = true })
vim.keymap.set({ 'n', 'x', 'o' }, 'T', ts_repeat_move.builtin_T_expr, { expr = true })
end,
},
}