tmux
This commit is contained in:
+19
-18
@@ -11,19 +11,19 @@ setw -g monitor-activity off
|
|||||||
setw -g mode-keys vi
|
setw -g mode-keys vi
|
||||||
|
|
||||||
# mouse control (clickable windows, panes, resizable panes)
|
# mouse control (clickable windows, panes, resizable panes)
|
||||||
setw -g mouse on
|
|
||||||
set -g mouse on
|
set -g mouse on
|
||||||
|
|
||||||
# clipboard control
|
# clipboard control
|
||||||
set -g set-clipboard on
|
set -g set-clipboard on
|
||||||
|
set -g allow-passthrough
|
||||||
set -g history-limit 20000
|
set -g history-limit 20000
|
||||||
set -g focus-events on
|
set -g focus-events on
|
||||||
|
|
||||||
# terminal
|
# terminal
|
||||||
set-option -g default-shell /bin/zsh
|
set -g default-shell /bin/zsh
|
||||||
|
|
||||||
# screen colors
|
# screen colors
|
||||||
set-option -ga terminal-overrides ",*-256color*:Tc"
|
set -ga terminal-overrides ",*-256color*:Tc"
|
||||||
|
|
||||||
# Start with index 1
|
# Start with index 1
|
||||||
set -g base-index 1
|
set -g base-index 1
|
||||||
@@ -36,8 +36,8 @@ setw -g pane-border-format ' #{=/-20/…:pane_title} [#{=/-20/…:pane_current_c
|
|||||||
|
|
||||||
|
|
||||||
# Automatically set window title
|
# Automatically set window title
|
||||||
set-window-option -g automatic-rename on
|
setw -g automatic-rename on
|
||||||
set-option -g set-titles on
|
set -g set-titles on
|
||||||
|
|
||||||
######################
|
######################
|
||||||
### KEYBINDS ###
|
### KEYBINDS ###
|
||||||
@@ -71,6 +71,8 @@ bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "xclip -i -f -selection
|
|||||||
bind -T copy-mode-vi r send-keys -X rectangle-toggle
|
bind -T copy-mode-vi r send-keys -X rectangle-toggle
|
||||||
bind -T copy-mode-vi Escape send-keys -X cancel
|
bind -T copy-mode-vi Escape send-keys -X cancel
|
||||||
bind -T copy-mode-vi q send-keys -X clear-selection
|
bind -T copy-mode-vi q send-keys -X clear-selection
|
||||||
|
bind -T copy-mode MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -selection primary -filter | xclip -selection clipboard"
|
||||||
|
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -selection primary -filter | xclip -selection clipboard"
|
||||||
|
|
||||||
# Rename window
|
# Rename window
|
||||||
bind , command-prompt "rename-window %%"
|
bind , command-prompt "rename-window %%"
|
||||||
@@ -140,26 +142,25 @@ bind -n M-0 if-shell 'tmux select-window -t :10' '' 'new-window -t :10'
|
|||||||
bind Q kill-pane
|
bind Q kill-pane
|
||||||
|
|
||||||
# clear selected pane
|
# clear selected pane
|
||||||
bind-key b send-keys -R \; clear-history \; send-keys Enter
|
bind b send-keys -R \; clear-history \; send-keys Enter
|
||||||
|
|
||||||
# Smart pane switching with awareness of Vim splits.
|
# Smart pane switching with awareness of Vim splits.
|
||||||
# See: https://github.com/christoomey/vim-tmux-navigator
|
# See: https://github.com/christoomey/vim-tmux-navigator
|
||||||
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
|
is_vim="ps -o state= -o comm= -t '#{pane_tty}' | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
|
||||||
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
|
bind -n M-h if-shell "$is_vim" "send-keys M-h" "select-pane -L"
|
||||||
bind-key -n M-h if-shell "$is_vim" "send-keys M-h" "select-pane -L"
|
bind -n M-j if-shell "$is_vim" "send-keys M-j" "select-pane -D"
|
||||||
bind-key -n M-j if-shell "$is_vim" "send-keys M-j" "select-pane -D"
|
bind -n M-k if-shell "$is_vim" "send-keys M-k" "select-pane -U"
|
||||||
bind-key -n M-k if-shell "$is_vim" "send-keys M-k" "select-pane -U"
|
bind -n M-l if-shell "$is_vim" "send-keys M-l" "select-pane -R"
|
||||||
bind-key -n M-l if-shell "$is_vim" "send-keys M-l" "select-pane -R"
|
|
||||||
bind M-h "select-pane -L"
|
bind M-h "select-pane -L"
|
||||||
bind M-j "select-pane -D"
|
bind M-j "select-pane -D"
|
||||||
bind M-k "select-pane -U"
|
bind M-k "select-pane -U"
|
||||||
bind M-l "select-pane -R"
|
bind M-l "select-pane -R"
|
||||||
#bind-key -n M-\ if-shell "$is_vim" "send-keys M-\\" "select-pane -l"
|
#bind -n M-\ if-shell "$is_vim" "send-keys M-\\" "select-pane -l"
|
||||||
bind-key -T copy-mode-vi M-h select-pane -L
|
bind -T copy-mode-vi M-h select-pane -L
|
||||||
bind-key -T copy-mode-vi M-j select-pane -D
|
bind -T copy-mode-vi M-j select-pane -D
|
||||||
bind-key -T copy-mode-vi M-k select-pane -U
|
bind -T copy-mode-vi M-k select-pane -U
|
||||||
bind-key -T copy-mode-vi M-l select-pane -R
|
bind -T copy-mode-vi M-l select-pane -R
|
||||||
#bind-key -T copy-mode-vi M-\ select-pane -l
|
#bind -T copy-mode-vi M-\ select-pane -l
|
||||||
|
|
||||||
# fzf binding
|
# fzf binding
|
||||||
set -g @tmux-fzf-launch-key 'f'
|
set -g @tmux-fzf-launch-key 'f'
|
||||||
|
|||||||
Reference in New Issue
Block a user