feat: add support for tmux-nvr

This commit is contained in:
Stefan Imhoff
2022-12-24 11:10:06 +01:00
parent 470138ea6b
commit 0e6fa66a5c
4 changed files with 33 additions and 27 deletions

1
bin/tmux-nvr Symbolic link
View File

@@ -0,0 +1 @@
/Users/kogakure/.tmux/plugins/tmux-nvr

View File

@@ -11,7 +11,7 @@ local mappings = {
i = { "<CMD>silent !open -a iA\\ Writer.app '%:p'<CR>", "iA Writer" }, i = { "<CMD>silent !open -a iA\\ Writer.app '%:p'<CR>", "iA Writer" },
j = { "<CMD>b#<CR>", "Toggle Buffers" }, j = { "<CMD>b#<CR>", "Toggle Buffers" },
o = { "<CMD>SymbolsOutline<CR>", "Symbols Outline" }, o = { "<CMD>SymbolsOutline<CR>", "Symbols Outline" },
p = { "<CMD>Pounce<CR>", "Pounce" }, p = { "<CMD>Telescope projects<CR>", "Projects" },
q = { "<CMD>Bdelete!<CR>", "Close Buffer" }, q = { "<CMD>Bdelete!<CR>", "Close Buffer" },
s = { s = {
"<CMD>lua require('spectre').open_file_search()<CR>", "<CMD>lua require('spectre').open_file_search()<CR>",
@@ -119,7 +119,7 @@ local mappings = {
u = { "<Cmd>Telescope frecency<CR>", "MRU (Frequency)" }, u = { "<Cmd>Telescope frecency<CR>", "MRU (Frequency)" },
}, },
}, },
P = { "<CMD>Telescope projects<CR>", "Projects" }, P = { "<CMD>Pounce<CR>", "Pounce" },
Q = { "<CMD>q!<CR>", "Quit" }, Q = { "<CMD>q!<CR>", "Quit" },
R = { "<CMD>lua vim.lsp.buf.rename()<CR>", "Rename" }, R = { "<CMD>lua vim.lsp.buf.rename()<CR>", "Rename" },
S = { "<CMD>lua require('spectre').open_visual({select_word=true})<CR>", "Spectre Current Word" }, S = { "<CMD>lua require('spectre').open_visual({select_word=true})<CR>", "Spectre Current Word" },

View File

@@ -1,3 +1,5 @@
# ========= Settings =========
set -g default-terminal "tmux-256color" set -g default-terminal "tmux-256color"
set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' # undercurl support 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 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) # Allow passthrough color excape sequences (Base16)
set -g allow-passthrough 1 set -g allow-passthrough 1
# Force a reload of the config file
bind r source-file ~/.tmux.conf\; display "Reloaded!"
# History # History
set-option -g history-limit 50000 set-option -g history-limit 50000
@@ -39,12 +38,6 @@ setw -g mode-keys vi
# Renumber windows sequentially after closing any of them # Renumber windows sequentially after closing any of them
set -g renumber-windows on 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 # Status Bar
set -g status-position top set -g status-position top
set -g status-style 'bg=default,fg=white' # transparent status bar 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 # Bar Right
set -g status-right-length 100 set -g status-right-length 100
set -g status-right "#{now_playing} #{pomodoro_status} " set -g status-right "#{now_playing} "
# Windows # Windows
set -g window-status-current-format "#[fg=magenta,bold,bg=default] #I #W " set -g window-status-current-format "#[fg=magenta,bold,bg=default] #I #W "
set -g window-status-separator "" set -g window-status-separator ""
set -g window-status-format "#[fg=white,bg=default] #I #W " 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 # Change the default delay
set -sg escape-time 0 set -sg escape-time 0
# Mouse integration # Mouse integration
set -g mouse on set -g mouse on
# Find a window # Vi mode
bind C-f command-prompt "switch-client -t %%" 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 '<ESC>:Telescope find_files<CR>'"
# Open cht.sh
bind-key -r i run-shell "tmux neww tmux-cht.sh"
# Tile all windows # Tile all windows
bind = select-layout tiled bind = select-layout tiled
@@ -88,9 +89,6 @@ bind = select-layout tiled
# Cycle through panes # Cycle through panes
bind ^B select-pane -t :.+ bind ^B select-pane -t :.+
# Clear screen
bind C-l send-keys 'C-l'
# Copy/Paste bindings # Copy/Paste bindings
unbind [ unbind [
bind Escape copy-mode 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-k' select-pane -U
bind-key -T copy-mode-vi 'C-l' select-pane -R 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/tpm'
set -g @plugin 'tmux-plugins/tmux-battery' set -g @plugin 'tmux-plugins/tmux-battery'
set -g @plugin 'tmux-plugins/tmux-continuum' 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 'tmux-plugins/tmux-yank'
set -g @plugin 'spywhere/tmux-now-playing' # , (Pause) . (Stop) ; (Prev) ' (Next) set -g @plugin 'spywhere/tmux-now-playing' # , (Pause) . (Stop) ; (Prev) ' (Next)
set -g @plugin 'nhdaly/tmux-better-mouse-mode' set -g @plugin 'nhdaly/tmux-better-mouse-mode'
set -g @plugin 'carlocab/tmux-nvr'
set -g @plugin 'jbnicolai/tmux-fpp' # f set -g @plugin 'jbnicolai/tmux-fpp' # f
set -g @plugin 'nhdaly/tmux-scroll-copy-mode' set -g @plugin 'nhdaly/tmux-scroll-copy-mode'
set -g @plugin 'wfxr/tmux-fzf-url' # u 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) # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.tmux/plugins/tpm/tpm' run '~/.tmux/plugins/tpm/tpm'

9
zshrc
View File

@@ -40,6 +40,13 @@ export PATH="$HOME/.rd/bin:$PATH"
# Rust # Rust
export PATH="$HOME/.cargo/bin:$PATH" 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
# >>> conda initialize >>> # >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !! # !! Contents within this block are managed by 'conda init' !!
@@ -304,8 +311,8 @@ antigen bundle dotenv
antigen bundle extract antigen bundle extract
antigen bundle fzf antigen bundle fzf
antigen bundle gem antigen bundle gem
antigen bundle git
antigen bundle gh antigen bundle gh
antigen bundle git
antigen bundle git-extras antigen bundle git-extras
antigen bundle gitignore antigen bundle gitignore
antigen bundle gulp antigen bundle gulp