From 19ff9a308d2c9dbb799e697f209b0ecbcbb55e0f Mon Sep 17 00:00:00 2001 From: quak Date: Sun, 5 Jan 2025 23:27:59 +0100 Subject: [PATCH] [neovim] cleaned up duplicate of tmux-navigation plugin [tmux] added keymaps for copy mode --- nvim/.config/nvim/lua/plugins/misc.lua | 116 ++++++++++++------------- tmux/.config/tmux/keymaps.conf | 33 ++++--- 2 files changed, 75 insertions(+), 74 deletions(-) diff --git a/nvim/.config/nvim/lua/plugins/misc.lua b/nvim/.config/nvim/lua/plugins/misc.lua index 15bafa5..1e62f78 100644 --- a/nvim/.config/nvim/lua/plugins/misc.lua +++ b/nvim/.config/nvim/lua/plugins/misc.lua @@ -1,62 +1,58 @@ -- Standalone plugins with less than 10 lines of config go here return { - { - -- tmux & split window navigation - 'christoomey/vim-tmux-navigator', - }, - { - -- autoclose tags - 'windwp/nvim-ts-autotag', - }, - { - -- detect tabstop and shiftwidth automatically - 'tpope/vim-sleuth', - }, - { - -- Powerful Git integration for Vim - 'tpope/vim-fugitive', - }, - { - -- GitHub integration for vim-fugitive - 'tpope/vim-rhubarb', - }, - { - -- Hints keybinds - 'folke/which-key.nvim', - opts = { - -- win = { - -- border = { - -- { '┌', 'FloatBorder' }, - -- { '─', 'FloatBorder' }, - -- { '┐', 'FloatBorder' }, - -- { '│', 'FloatBorder' }, - -- { '┘', 'FloatBorder' }, - -- { '─', 'FloatBorder' }, - -- { '└', 'FloatBorder' }, - -- { '│', 'FloatBorder' }, - -- }, - -- }, - }, - }, - { - -- Autoclose parentheses, brackets, quotes, etc. - 'windwp/nvim-autopairs', - event = 'InsertEnter', - config = true, - opts = {}, - }, - { - -- Highlight todo, notes, etc in comments - 'folke/todo-comments.nvim', - event = 'VimEnter', - dependencies = { 'nvim-lua/plenary.nvim' }, - opts = { signs = false }, - }, - { - -- high-performance color highlighter - 'norcalli/nvim-colorizer.lua', - config = function() - require('colorizer').setup() - end, - }, - } \ No newline at end of file + { + -- autoclose tags + "windwp/nvim-ts-autotag", + }, + { + -- detect tabstop and shiftwidth automatically + "tpope/vim-sleuth", + }, + { + -- Powerful Git integration for Vim + "tpope/vim-fugitive", + }, + { + -- GitHub integration for vim-fugitive + "tpope/vim-rhubarb", + }, + { + -- Hints keybinds + "folke/which-key.nvim", + opts = { + win = { + border = { + { "┌", "FloatBorder" }, + { "─", "FloatBorder" }, + { "┐", "FloatBorder" }, + { "│", "FloatBorder" }, + { "┘", "FloatBorder" }, + { "─", "FloatBorder" }, + { "└", "FloatBorder" }, + { "│", "FloatBorder" }, + }, + }, + }, + }, + { + -- Autoclose parentheses, brackets, quotes, etc. + "windwp/nvim-autopairs", + event = "InsertEnter", + config = true, + opts = {}, + }, + { + -- Highlight todo, notes, etc in comments + "folke/todo-comments.nvim", + event = "VimEnter", + dependencies = { "nvim-lua/plenary.nvim" }, + opts = { signs = false }, + }, + { + -- high-performance color highlighter + "norcalli/nvim-colorizer.lua", + config = function() + require("colorizer").setup() + end, + }, +} diff --git a/tmux/.config/tmux/keymaps.conf b/tmux/.config/tmux/keymaps.conf index 6054f54..335dee3 100644 --- a/tmux/.config/tmux/keymaps.conf +++ b/tmux/.config/tmux/keymaps.conf @@ -3,15 +3,20 @@ unbind C-b set-option -g prefix C-Space # general keybindings -bind r source-file ~/.config/tmux/tmux.conf \; display-message "config reloaded" +bind-key r source-file ~/.config/tmux/tmux.conf \; display-message "config reloaded" + +# navigation and modes +set-window-option -g mode-keys vi +bind-key -n M-c copy-mode + +bind-key -T copy-mode-vi 'v' send -X begin-selection +bind-key -T copy-mode-vi 'y' send -X copy-selection # window navigation -bind -n M-Left previous-window -bind -n M-Right next-window +bind-key -n M-Left previous-window +bind-key -n M-Right next-window bind-key -n M-S-Left swap-window -t -1 -d bind-key -n M-S-Right swap-window -t +1 -d -#bind-key -n M-S-Left move-window -b -s +0 -t -1 -#bind-key -n M-S-Right move-window -a -s +0 -t +1 # pane navigation bind -n M-j swap-pane -D @@ -38,19 +43,19 @@ bind-key -T copy-mode-vi 'C-l' select-pane -R bind-key -T copy-mode-vi 'C-\' select-pane -l # keymaps for working with split windows -bind v split-pane -v -c "#{pane_current_path}" -bind h split-pane -h -c "#{pane_current_path}" -bind b break-pane +bind-key v split-pane -v -c "#{pane_current_path}" +bind-key h split-pane -h -c "#{pane_current_path}" +bind-key b break-pane unbind t -bind t command-prompt -p "move pane to window:" "join-pane -t '%%'" +bind-key t command-prompt -p "move pane to window:" "join-pane -t '%%'" -bind -n M-F1 select-layout even-horizontal -bind -n M-F2 select-layout main-vertical -bind -n M-F3 select-layout tiled +bind-key -n M-F1 select-layout even-horizontal +bind-key -n M-F2 select-layout main-vertical +bind-key -n M-F3 select-layout tiled unbind x -bind x kill-pane -t +0 +bind-key x kill-pane -t +0 # detach current session and close terminal -bind k run "tmux detach -P" +bind-key k run "tmux detach -P"