From dfec7d14b4f03c78c66b9626738d012c512dbbc8 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Sun, 14 Jul 2024 17:35:32 +0300 Subject: Neovim: fixed tmux navigation and ; or , for fFtT issues --- .config/nvim/lua/custom/plugins/motions.lua | 8 ++++---- .config/nvim/lua/custom/plugins/treesitter.lua | 10 ++++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) (limited to '.config/nvim/lua/custom/plugins') diff --git a/.config/nvim/lua/custom/plugins/motions.lua b/.config/nvim/lua/custom/plugins/motions.lua index b06981c..229225f 100644 --- a/.config/nvim/lua/custom/plugins/motions.lua +++ b/.config/nvim/lua/custom/plugins/motions.lua @@ -2,10 +2,10 @@ return { { 'christoomey/vim-tmux-navigator', config = function() - vim.keymap.set('n', 'C-h', 'TmuxNavigatorLeft') - vim.keymap.set('n', 'C-j', 'TmuxNavigatorDown') - vim.keymap.set('n', 'C-k', 'TmuxNavigatorUp') - vim.keymap.set('n', 'C-l', 'TmuxNavigatorRight') + vim.keymap.set('n', '', 'TmuxNavigatorLeft') + vim.keymap.set('n', '', 'TmuxNavigatorDown') + vim.keymap.set('nC', '', 'TmuxNavigatorUp') + vim.keymap.set('n', '', 'TmuxNavigatorRight') end, }, { diff --git a/.config/nvim/lua/custom/plugins/treesitter.lua b/.config/nvim/lua/custom/plugins/treesitter.lua index 67814dd..ec3136c 100644 --- a/.config/nvim/lua/custom/plugins/treesitter.lua +++ b/.config/nvim/lua/custom/plugins/treesitter.lua @@ -35,9 +35,9 @@ return { }, selection_modes = { ['@parameter.outer'] = 'v', -- charwise - ['@function.outer'] = 'V', -- linewise + ['@function.outer'] = 'V', -- linewise ['@class.outer'] = '', -- 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, }, } -- cgit v1.3.1