From 193447d5d70982ad2a6455ddc7f1849d0f2680cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Av=C3=A9?= Date: Sun, 17 Apr 2022 11:57:20 +0200 Subject: [PATCH] Add tmux config --- .tmux.conf | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .tmux.conf diff --git a/.tmux.conf b/.tmux.conf new file mode 100644 index 0000000..f1446d1 --- /dev/null +++ b/.tmux.conf @@ -0,0 +1,59 @@ +# Renumber windows of one is closed: 0,1,2 -> 0,1 instead of 0,2 +set-option -g renumber-windows on +# Use vi keybindings in copy mode +set-window-option -g mode-keys vi +bind-key -T copy-mode-vi 'v' send -X begin-selection +bind-key -T copy-mode-vi 'y' send -X copy-selection + +# Use C-a as prefix +unbind C-b +set-option -g prefix C-a +bind-key C-a send-prefix + +# More visual split commands +bind | split-window -h -c "#{pane_current_path}" +bind - split-window -v -c "#{pane_current_path}" +bind c new-window -c "#{pane_current_path}" +unbind '"' +unbind % + +# Allow to use the mouse +set -g mouse on + +# theme +set -g @themepack 'powerline/double/blue' + +# Allow using ctrl + arrow keys +set-option -g xterm-keys on + +# status bar +# set -g status-right '#{net_speed} | #{prefix_highlight} #{battery_icon}#{battery_percentage} | %a %h-%d %H:%M' +set-window-option -g status-left " #S " +set-window-option -g status-right " #{prefix_highlight} \"#(hostname)\" %H:%M %d-%b-%y " +set-window-option -g window-status-format " #I: #W " +set-window-option -g window-status-current-format " #I: #W " + +# Vim integration +# See: https://github.com/christoomey/vim-tmux-navigator +is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?x?)(diff)?$"' +bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L" +bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D" +bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U" +bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R" +set -g default-terminal "screen-256color" +# bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"" + +# Plugins (Keep this last) +set -g @plugin 'tmux-plugins/tpm' +# set -g @plugin 'tmux-plugins/tmux-battery' +set -g @plugin 'tmux-plugins/tmux-copycat' +set -g @plugin 'tmux-plugins/tmux-open' +# set -g @plugin 'tmux-plugins/tmux-online-status' +set -g @plugin 'tmux-plugins/tmux-prefix-highlight' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'tmux-plugins/tmux-yank' +# set -g @plugin 'seebi/tmux-colors-solarized' + set -g @plugin 'jimeh/tmux-themepack' +run '~/.tmux/plugins/tpm/tpm' +#ZSH +set -g default-shell /bin/zsh