From 3aec66ff80965912893e22d85a68ae470301c6e0 Mon Sep 17 00:00:00 2001 From: Abdulwahaab Ahmed Date: Mon, 21 Aug 2017 20:42:18 -0400 Subject: [PATCH] Update .tmux.conf --- .tmux.conf | 72 +++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 61 insertions(+), 11 deletions(-) diff --git a/.tmux.conf b/.tmux.conf index 73c39e9..374b981 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -1,4 +1,9 @@ +set -g prefix C-a +unbind C-b +bind C-a send-prefix + set -g status-right-length 50 +set -g status-left-length 50 set -g status-fg white set -g status-bg colour234 @@ -9,19 +14,17 @@ set -g message-fg colour16 set -g message-bg colour221 set -g status-left '#[fg=colour235,bg=colour252] #S #[fg=colour252,bg=colour240] #(~/tmuxPlugins/tmux-cpu-info/tmux-cpu-info)#[fg=colour240,bg=colour236] #(~/tmuxPlugins/tmux-weather/tmux-weather) #[fg=colour236,bg=colour234]' -set -g window-status-format "#[fg=white,bg=colour234] #W " -set -g window-status-current-format "#[fg=colour234,bg=brightcyan] #I | #[fg=black,bg=brightcyan,noreverse]#W#[fg=brightcyan,bg=colour234]" +set -g window-status-format "#[fg=colour236,bg=colour236]#[fg=white,bg=colour236] #I  #W #[fg=colour236,bg=colour234]" +set -g window-status-current-format "#[fg=colour234,bg=brightcyan] #I  #[fg=black,bg=brightcyan,noreverse]#W#[fg=brightcyan,bg=colour234]" set -g status-right '#[fg=colour236,bg=colour234]#[fg=brightcyan,bg=colour236] #(~/tmuxPlugins/tmux-spotify-info/tmux-spotify-info)' -set -g prefix C-a -unbind C-b -bind C-a send-prefix -set -g default-terminal "screen-256color" +# set -g default-terminal "screen-256color" +set -g default-terminal "xterm" set-option -g history-limit 10000 -bind r source-file ~/.tmux.conf \; display-message "Config reloaded..." +bind r source-file ~/.tmux.conf \; display-message "Reloading configs..." set -s escape-time 0 set -g escape-time 0 @@ -29,16 +32,43 @@ set -g escape-time 0 # Act like vim set -g status-keys vi setw -g mode-keys vi -bind-key -t vi-copy v begin-selection -bind-key -t vi-copy y copy-pipe "pbcopy" +# bind-key -t vi-copy v begin-selection +# bind-key -T copy-mode-vi v send-keys -X begin-selection +# bind-key -t vi-copy y copy-pipe "pbcopy" +# bind-key -T copy-mode-vi y send-keys -X copy-pipe "pbcopy" +# bind-key -T vi-copy y send-keys -X copy-pipe-and-cancel "xclip -selection clipboard -i" +# bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -selection clipboard -i" +# set-option -s set-clipboard off - -# Sierra broke copy/paste in vim within tmux >:( +# fixing sierra copy/paste issue set -g default-shell $SHELL set -g default-command "reattach-to-user-namespace -l ${SHELL}" set -g mouse on +# vim-like pane resizing +bind -r C-k resize-pane -U +bind -r C-j resize-pane -D +bind -r C-h resize-pane -L +bind -r C-l resize-pane -R + +# vim-like pane switching +bind -r k select-pane -U +bind -r j select-pane -D +bind -r h select-pane -L +bind -r l select-pane -R + +# and now unbind keys +unbind Up +unbind Down +unbind Left +unbind Right + +unbind C-Up +unbind C-Down +unbind C-Left +unbind C-Right + # Smart pane switching with awareness of vim splits is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"' bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L" @@ -51,3 +81,23 @@ bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l" bind C-l send-keys 'C-l' bind -n C-\ send-keys -R \; clear-history + +set -g @resurrect-save '~' + +# List of plugins +set -g @plugin 'tmux-plugins/tpm' +set -g @plugin 'tmux-plugins/tmux-sensible' +set -g @plugin 'tmux-plugins/tmux-resurrect' + +# Other examples: +# set -g @plugin 'github_username/plugin_name' +# set -g @plugin 'git@github.com/user/plugin' +# set -g @plugin 'git@bitbucket.com/user/plugin' + +# for vim +set -g @resurrect-strategy-vim 'session' +# for neovim +set -g @resurrect-strategy-nvim 'session' + +# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf) +run '~/.tmux/plugins/tpm/tpm'