From 833d03c41603cfc0a3a304da99394c6d55039f89 Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Fri, 16 May 2025 17:49:58 -0700 Subject: [PATCH 1/4] Add a visual bell to highlight tmux tabs upon command completion --- .bashrc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.bashrc b/.bashrc index d078e85..64fe8a8 100644 --- a/.bashrc +++ b/.bashrc @@ -82,7 +82,7 @@ if [ "$color_prompt" = yes ]; then context_color=$red prompt_symbol=💀 fi - PROMPT_COMMAND='if [[ $? != 0 && $? != 130 ]];then echo "⚠️";fi' + PROMPT_COMMAND='if [[ $? != 0 && $? != 130 ]];then echo -e "⚠️\a";else echo -e "\a";fi' PS1="$chrome_color┌──"'${debian_chroot:+('${path_color}'$debian_chroot'${chrome_color}')─}${VIRTUAL_ENV:+('${path_color}'$(realpath $VIRTUAL_ENV --relative-to $PWD --relative-base /home)'${chrome_color}')─}'"[${context_color}\u${chrome_color}${prompt_symbol}${context_color}\h${chrome_color}]─(${path_color}\w${chrome_color})\n${chrome_color}└${context_color}${prompt}${color_off} " PS2="$chrome_color└>$color_off " @@ -150,8 +150,8 @@ fi # Customizations -# Use tmux for local shells -if [ -z "${SSH_CONNECTION}" ] && [ -z "${TERM_PROGRAM}" ]; then +# Use tmux for local unelevated shells +if [ -z "${SUDO_USER}" ] && [ -z "${SSH_CONNECTION}" ] && [ -z "${TERM_PROGRAM}" ]; then tmux new -A -s local_tmux fi @@ -179,3 +179,7 @@ PROMPT_COMMAND="${PROMPT_COMMAND};history -a" # Cargo binary path [ -d "${HOME}/.cargo/bin" ] && export PATH="${PATH}:${HOME}/.cargo/bin" + +# Funciton to notify after a long-running command +alias bell="echo -e '\a'" + From 8c71f6e703522081501ceece6c649934baa5cf69 Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Fri, 16 May 2025 17:50:29 -0700 Subject: [PATCH 2/4] Update Alacritty config to use font installed to for portability --- alacritty.toml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/alacritty.toml b/alacritty.toml index e58e0f3..90e1b78 100644 --- a/alacritty.toml +++ b/alacritty.toml @@ -5,7 +5,5 @@ background = "#111111" cyan = '#008b8b' [font.normal] -#family = 'monospace' -#family = 'Hack' -family = 'JetBrainsMono' +family = 'JetBrainsMono Nerd Font Mono' style = 'Regular' From 74a36ba246f32b2da0a32b74a80799da34b591ad Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Fri, 16 May 2025 17:52:32 -0700 Subject: [PATCH 3/4] Include vim-tmux-navigator to support hotkey switching between nvim and tmux panes --- .tmux.conf | 10 +++++++++- .tmux/plugins/vim-tmux-navigator | 1 + nvim/init.lua | 12 +++++++++++- nvim/lua/plugins/nvim-tmux-navigator.lua | 7 +++++++ 4 files changed, 28 insertions(+), 2 deletions(-) create mode 160000 .tmux/plugins/vim-tmux-navigator create mode 100644 nvim/lua/plugins/nvim-tmux-navigator.lua diff --git a/.tmux.conf b/.tmux.conf index 87099fd..a0dde55 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -6,7 +6,7 @@ set -g prefix C-space bind-key C-space send-prefix # Shortcut to custom hints -bind-key -n C-h run-shell "tmux popup -xC -yC -w50% -h75% 'cat ~/.tmux/hints'" +bind h run-shell "tmux popup -xC -yC -w50% -h75% 'cat ~/.tmux/hints'" # Shortcut to sync panes bind C-x setw synchronize-panes @@ -77,5 +77,13 @@ set -g @resurrect-processes 'ssh nano k9s' set -g @plugin 'tmux-plugins/tmux-open' set -g @open-S 'https://search.brave.com/search?q=' +# Integrate with nvim navigation +set -g @plugin 'christoomey/vim-tmux-navigator' +set -g @vim_navigator_mapping_left "C-Left C-h" +set -g @vim_navigator_mapping_right "C-Right C-l" +set -g @vim_navigator_mapping_up "C-Up C-k" +set -g @vim_navigator_mapping_down "C-Down C-j" + + # Load Plugins run '~/.tmux/plugins/tpm/tpm' diff --git a/.tmux/plugins/vim-tmux-navigator b/.tmux/plugins/vim-tmux-navigator new file mode 160000 index 0000000..33afa80 --- /dev/null +++ b/.tmux/plugins/vim-tmux-navigator @@ -0,0 +1 @@ +Subproject commit 33afa80db65113561dc53fa732b7f5e53d5ecfd0 diff --git a/nvim/init.lua b/nvim/init.lua index 8fb9b20..43d9da7 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -4,6 +4,12 @@ vim.cmd("set tabstop=2") vim.cmd("set softtabstop=2") vim.cmd("set shiftwidth=2") +-- Configure Navigation Keys +--vim.keymap.set('n', '', ':wincmd h') +--vim.keymap.set('n', '', ':wincmd l') +--vim.keymap.set('n', '', ':wincmd k') +--vim.keymap.set('n', '', ':wincmd j') + -- Configure Editor Settings vim.cmd("set number") vim.opt.guifont = "JetBrainsMonoNerdFontMono:14" @@ -16,10 +22,14 @@ require("config.lazy") -- Configure Telescope Keymaps local builtin = require("telescope.builtin") vim.keymap.set('n', '', builtin.find_files, {}) -vim.keymap.set('n', 'g', builtin.live_grep, {}) +vim.keymap.set('n', 'gg', builtin.live_grep, {}) -- Init Treesitter Syntax Highlighting --require("config.treesitter") -- Configure NeoTree (FS View) vim.keymap.set('n', 'f', ':Neotree filesystem reveal left') + +-- Configure Git +vim.keymap.set('n', 'gd', ':Gitsigns preview_hunk', {}) +vim.keymap.set('n', 'gb', ':Gitsigns toggle_current_line_blame', {}) diff --git a/nvim/lua/plugins/nvim-tmux-navigator.lua b/nvim/lua/plugins/nvim-tmux-navigator.lua new file mode 100644 index 0000000..1e7cbc3 --- /dev/null +++ b/nvim/lua/plugins/nvim-tmux-navigator.lua @@ -0,0 +1,7 @@ +return { + "christoomey/vim-tmux-navigator", + vim.keymap.set('n', '', ':TmuxNavigateLeft'), + vim.keymap.set('n', '', ':TmuxNavigateRight'), + vim.keymap.set('n', '', ':TmuxNavigateUp'), + vim.keymap.set('n', '', ':TmuxNavigateDown'), +} From 6828f40532abd261c14517fd54e9d0f5ac02cf0a Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Fri, 16 May 2025 17:52:56 -0700 Subject: [PATCH 4/4] Include git plugins in nvim --- nvim/lazy-lock.json | 7 +++++-- nvim/lua/plugins/gitsigns.lua | 7 +++++++ nvim/lua/plugins/vimfugitive.lua | 3 +++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 nvim/lua/plugins/gitsigns.lua create mode 100644 nvim/lua/plugins/vimfugitive.lua diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index 88fe98d..dbbf3cc 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -1,11 +1,14 @@ { "github-theme": { "branch": "main", "commit": "c106c9472154d6b2c74b74565616b877ae8ed31d" }, + "gitsigns.nvim": { "branch": "v1.0.2", "commit": "7010000889bfb6c26065e0b0f7f1e6aa9163edd9" }, "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, "lualine.nvim": { "branch": "master", "commit": "15884cee63a8c205334ab13ab1c891cd4d27101a" }, "neo-tree.nvim": { "branch": "v3.x", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" }, "nui.nvim": { "branch": "main", "commit": "f535005e6ad1016383f24e39559833759453564e" }, "nvim-treesitter": { "branch": "master", "commit": "066fd6505377e3fd4aa219e61ce94c2b8bdb0b79" }, - "nvim-web-devicons": { "branch": "master", "commit": "d360317f8f509b99229bb31d42269987696df6ff" }, + "nvim-web-devicons": { "branch": "master", "commit": "1fb58cca9aebbc4fd32b086cb413548ce132c127" }, "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, - "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" } + "telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "vim-fugitive": { "branch": "master", "commit": "4a745ea72fa93bb15dd077109afbb3d1809383f2" }, + "vim-tmux-navigator": { "branch": "master", "commit": "33afa80db65113561dc53fa732b7f5e53d5ecfd0" } } diff --git a/nvim/lua/plugins/gitsigns.lua b/nvim/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..a742be1 --- /dev/null +++ b/nvim/lua/plugins/gitsigns.lua @@ -0,0 +1,7 @@ +return { + "lewis6991/gitsigns.nvim", + branch="v1.0.2", + config = function() + require("gitsigns").setup({}) + end, +} diff --git a/nvim/lua/plugins/vimfugitive.lua b/nvim/lua/plugins/vimfugitive.lua new file mode 100644 index 0000000..0b426c0 --- /dev/null +++ b/nvim/lua/plugins/vimfugitive.lua @@ -0,0 +1,3 @@ +return { + "tpope/vim-fugitive" +}