From 0e6fa66a5ce4c00eb9e0d2eadb71b0561eaf4a5a Mon Sep 17 00:00:00 2001 From: Stefan Imhoff Date: Sat, 24 Dec 2022 11:10:06 +0100 Subject: [PATCH] feat: add support for tmux-nvr --- bin/tmux-nvr | 1 + nvim/after/plugin/whichkey.lua | 4 +-- tmux.conf | 46 ++++++++++++++++------------------ zshrc | 9 ++++++- 4 files changed, 33 insertions(+), 27 deletions(-) create mode 120000 bin/tmux-nvr diff --git a/bin/tmux-nvr b/bin/tmux-nvr new file mode 120000 index 0000000..4f1d02c --- /dev/null +++ b/bin/tmux-nvr @@ -0,0 +1 @@ +/Users/kogakure/.tmux/plugins/tmux-nvr \ No newline at end of file diff --git a/nvim/after/plugin/whichkey.lua b/nvim/after/plugin/whichkey.lua index fe66358..ce91c14 100644 --- a/nvim/after/plugin/whichkey.lua +++ b/nvim/after/plugin/whichkey.lua @@ -11,7 +11,7 @@ local mappings = { i = { "silent !open -a iA\\ Writer.app '%:p'", "iA Writer" }, j = { "b#", "Toggle Buffers" }, o = { "SymbolsOutline", "Symbols Outline" }, - p = { "Pounce", "Pounce" }, + p = { "Telescope projects", "Projects" }, q = { "Bdelete!", "Close Buffer" }, s = { "lua require('spectre').open_file_search()", @@ -119,7 +119,7 @@ local mappings = { u = { "Telescope frecency", "MRU (Frequency)" }, }, }, - P = { "Telescope projects", "Projects" }, + P = { "Pounce", "Pounce" }, Q = { "q!", "Quit" }, R = { "lua vim.lsp.buf.rename()", "Rename" }, S = { "lua require('spectre').open_visual({select_word=true})", "Spectre Current Word" }, diff --git a/tmux.conf b/tmux.conf index b0a62f1..f6af841 100644 --- a/tmux.conf +++ b/tmux.conf @@ -1,3 +1,5 @@ +# ========= Settings ========= + set -g default-terminal "tmux-256color" set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' # underscore colours - needs tmux-3.0 @@ -27,9 +29,6 @@ set -g focus-events on # Allow passthrough color excape sequences (Base16) set -g allow-passthrough 1 -# Force a reload of the config file -bind r source-file ~/.tmux.conf\; display "Reloaded!" - # History set-option -g history-limit 50000 @@ -39,12 +38,6 @@ setw -g mode-keys vi # Renumber windows sequentially after closing any of them set -g renumber-windows on -# Pomodoro -set -g @pomodoro_mins 40 -set -g @pomodoro_break_mins 15 -set -g @pomodoro_on " 🍅" -set -g @pomodoro_complete " ✅" - # Status Bar set -g status-position top set -g status-style 'bg=default,fg=white' # transparent status bar @@ -60,27 +53,35 @@ set -g status-left "#[fg=blue,bold] #S #(gitmux -timeout 300ms -cfg $HOME/.gitmu # Bar Right set -g status-right-length 100 -set -g status-right "#{now_playing} #{pomodoro_status} " +set -g status-right "#{now_playing} " # Windows set -g window-status-current-format "#[fg=magenta,bold,bg=default] #I #W " set -g window-status-separator "" set -g window-status-format "#[fg=white,bg=default] #I #W " -# Swap Window to Position 1 -bind-key T swap-window -t 1 - -# Open cht.sh -bind-key -r i run-shell "tmux neww tmux-cht.sh" - # Change the default delay set -sg escape-time 0 # Mouse integration set -g mouse on -# Find a window -bind C-f command-prompt "switch-client -t %%" +# Vi mode +set -g @shell_mode 'vi' + +# ========= Keybindings ========= + +# Force a reload of the config file +bind r source-file ~/.tmux.conf\; display "Reloaded!" + +# Swap Window to Position 1 +bind-key T swap-window -t 1 + +bind G new-window -c "#{pane_current_path}" -n "" lazygit +bind F run-shell "nvr-tmux --remote-send ':Telescope find_files'" + +# Open cht.sh +bind-key -r i run-shell "tmux neww tmux-cht.sh" # Tile all windows bind = select-layout tiled @@ -88,9 +89,6 @@ bind = select-layout tiled # Cycle through panes bind ^B select-pane -t :.+ -# Clear screen -bind C-l send-keys 'C-l' - # Copy/Paste bindings unbind [ bind Escape copy-mode @@ -120,9 +118,9 @@ bind-key -T copy-mode-vi 'C-j' select-pane -D bind-key -T copy-mode-vi 'C-k' select-pane -U bind-key -T copy-mode-vi 'C-l' select-pane -R -set -g @shell_mode 'vi' +# ========= Plugins ========= -# List of plugins (prefix + I to install, prefix + U to update) +# prefix + I to install, prefix + U to update set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-battery' set -g @plugin 'tmux-plugins/tmux-continuum' @@ -137,10 +135,10 @@ set -g @plugin 'tmux-plugins/tmux-urlview' set -g @plugin 'tmux-plugins/tmux-yank' set -g @plugin 'spywhere/tmux-now-playing' # , (Pause) . (Stop) ; (Prev) ' (Next) set -g @plugin 'nhdaly/tmux-better-mouse-mode' +set -g @plugin 'carlocab/tmux-nvr' set -g @plugin 'jbnicolai/tmux-fpp' # f set -g @plugin 'nhdaly/tmux-scroll-copy-mode' set -g @plugin 'wfxr/tmux-fzf-url' # u -set -g @plugin 'olimorris/tmux-pomodoro-plus' # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) run '~/.tmux/plugins/tpm/tpm' diff --git a/zshrc b/zshrc index 8ab7104..6ac7453 100644 --- a/zshrc +++ b/zshrc @@ -40,6 +40,13 @@ export PATH="$HOME/.rd/bin:$PATH" # Rust export PATH="$HOME/.cargo/bin:$PATH" +# TMUX nvr +if [ -n "$TMUX" ]; then + eval "$(tmux show-environment -s NVIM_LISTEN_ADDRESS 2> /dev/null)" +else + export NVIM_LISTEN_ADDRESS=/tmp/nvimsocket +fi + # Conda # >>> conda initialize >>> # !! Contents within this block are managed by 'conda init' !! @@ -304,8 +311,8 @@ antigen bundle dotenv antigen bundle extract antigen bundle fzf antigen bundle gem -antigen bundle git antigen bundle gh +antigen bundle git antigen bundle git-extras antigen bundle gitignore antigen bundle gulp