From e1b90654574c6f80c3adfb764462c3f7755250b0 Mon Sep 17 00:00:00 2001 From: odrling Date: Tue, 6 Sep 2022 19:37:37 +0200 Subject: [PATCH] [tmux] set keybindings to open window at current path --- .tmate.conf | 63 +---------------------------------------------------- .tmux.conf | 5 +++++ 2 files changed, 6 insertions(+), 62 deletions(-) mode change 100644 => 120000 .tmate.conf diff --git a/.tmate.conf b/.tmate.conf deleted file mode 100644 index aef8f55..0000000 --- a/.tmate.conf +++ /dev/null @@ -1,62 +0,0 @@ - -set-option -sg escape-time 9 - -# switch panes using Alt-arrow without prefix -bind -n M-Left select-pane -L -bind -n M-Right select-pane -R -bind -n M-Up select-pane -U -bind -n M-Down select-pane -D - -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 - -# Enable mouse mode (tmux 2.1 and above) -set -g mouse on - -bind-key -n -T copy-mode-vi Enter send-keys -X copy-pipe 'xclip -i -sel p -f | xclip -i -sel c' -bind-key -n -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe 'xclip -i -sel p -f | xclip -i -sel c' - -# only this line might not be enough -set -g default-terminal "tmux-256color" -# Needs this line also to overrides the default color -set-option -ga terminal-overrides ",xterm-256color:Tc" - -# Github colors for Tmux - -set -g mode-style "fg=#24292f,bg=colour255" - -set -g message-style "fg=#24292f,bg=colour255" -set -g message-command-style "fg=#24292f,bg=colour255" - -set -g pane-border-style "fg=#e1e4e8" -set -g pane-active-border-style "fg=#0366d6" - -# status line -set -g status "on" -set -g status-justify "left" -set -g status-interval "5" -set-option -g status-position top - -set -g status-style "fg=#0366d6,bg=colour255" - -set -g status-left-style NONE -set -g status-right-style NONE - -set -g status-left '' -set -g status-right '#[fg=colour233,bg=colour252,bold] #(uptime | rev | cut -d":" -f1 | rev | sed s/,//g) #[fg=colour233,bg=colour245,bold] %H:%M ' - -setw -g window-status-activity-style "underscore,fg=#586069,bg=colour255" -setw -g window-status-separator "" -setw -g window-status-style "NONE,fg=#ffffff,bg=colour255" -setw -g window-status-format "#[fg=#666666,bg=colour255,nobold,nounderscore,noitalics] #I: #W #F #[fg=colour255,bg=colour255,nobold,nounderscore,noitalics]" -setw -g window-status-current-format "#[fg=#24292e,bg=#babbbd,bold] #I: #W #F #[fg=#babbbd,bg=colour255,nobold,nounderscore,noitalics]" - - -# loud or quiet? -set-option -g visual-activity off -set-option -g visual-bell off -set-option -g visual-silence off -set-window-option -g monitor-activity off -set-option -g bell-action none - -if '[ -f ~/.tmate.conf.local ]' 'source ~/.tmate.conf.local' diff --git a/.tmate.conf b/.tmate.conf new file mode 120000 index 0000000..b0541c4 --- /dev/null +++ b/.tmate.conf @@ -0,0 +1 @@ +.tmux.conf \ No newline at end of file diff --git a/.tmux.conf b/.tmux.conf index 0a94c66..f7076df 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -7,6 +7,11 @@ bind -n M-Right select-pane -R bind -n M-Up select-pane -U bind -n M-Down select-pane -D +# open windows at current path +bind '"' split-window -c "#{pane_current_path}" +bind % split-window -h -c "#{pane_current_path}" +bind c new-window -c "#{pane_current_path}" + 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