Skip to content

Commit

Permalink
add tmux conf
Browse files Browse the repository at this point in the history
  • Loading branch information
xwinxu committed Jun 26, 2020
1 parent 0d50336 commit ba183fb
Showing 1 changed file with 101 additions and 0 deletions.
101 changes: 101 additions & 0 deletions .tmux.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix

# copy to buffer
# bind-key -n -t emacs-copy M-w copy-pipe "xclip -i -sel p -f | xclip -i -sel c "
#bind -T copy-mode-vi y send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"

# C-a z to hide inactive windows
# No delay for escape key press
set -sg escape-time 0
# reload config file (change file location to your the tmux.conf you want to use)
bind r source-file ~/.tmux.conf

# Linux only
set -g mouse on
set -g set-clipboard on

#bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
#bind -n WheelDownPane select-pane -t= \; send-keys -M
#bind -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
#bind -T copy-mode-vi C-WheelUpPane send-keys -X halfpage-up
#bind -T copy-mode-vi C-WheelDownPane send-keys -X halfpage-down
#bind -T copy-mode-emacs C-WheelUpPane send-keys -X halfpage-up
#bind -T copy-mode-emacs C-WheelDownPane send-keys -X halfpage-down

# To copy, left click and drag to highlight text in yellow,
# once you release left click yellow text will disappear and will automatically be available in clibboard
# # Use vim keybindings in copy mode
setw -g mode-keys vi
# Update default binding of `Enter` to also use copy-pipe
#unbind -T copy-mode-vi Enter
#bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -selection c"
#bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -in -selection clipboard"

## To copy, left click and drag to highlight text in yellow,
## once you release left click yellow text will disappear and will automatically be available in clibboard
## # Use vim keybindings in copy mode
#setw -g mode-keys vi
## Update default binding of `Enter` to also use copy-pipe
#unbind -T copy-mode-vi Enter
#bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"
#bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"

# copy to clipboard
# set-option -s set-clipboard on

# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window

# THEME
set -g status-bg blue
set -g status-fg white
set -g window-status-current-bg white
set -g window-status-current-fg black
set -g window-status-current-attr bold
set -g status-interval 60
set -g status-left-length 30
set -g status-left '#[fg=white](#S) #(whoami) '
set -g status-right '#[fg=white]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=white]%H:%M#[default]'

# Enable mouse mode (tmux 2.1 and above)
# 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
# Unbind the keys
unbind Up
unbind Down
unbind Left
unbind Right
unbind C-Up
unbind C-Down
unbind C-Left
unbind C-Right

bind P paste-buffer
#bind-key -t vi-copy 'v' begin-selection
#bind-key -t vi-copy 'y' copy-selection
#bind-key -t vi-copy 'r' rectangle-toggle
#bind -t vi-copy y copy-pipe 'xclip -in -selection clipboard'

# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run -b '~/.tmux/plugins/tpm/tpm'

set -g @plugin 'tmux-plugins/tmux-yank'
set -g @yank_with_mouse on # or 'on'
set -g @shell_mode 'vi'

0 comments on commit ba183fb

Please sign in to comment.