Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes in tmux conf #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 61 additions & 11 deletions .tmux.conf
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,36 +14,61 @@ 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

# 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"
Expand All @@ -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 '[email protected]/user/plugin'
# set -g @plugin '[email protected]/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'