Skip to content

Instantly share code, notes, and snippets.

@kosuke55
Created September 17, 2021 02:20
Show Gist options
  • Save kosuke55/96aded0ecff2b4f36c05cc964c8f4310 to your computer and use it in GitHub Desktop.
Save kosuke55/96aded0ecff2b4f36c05cc964c8f4310 to your computer and use it in GitHub Desktop.
# tmux plugin manager
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-yank'
set -g @plugin 'tmux-plugins/tmux-open'
run '~/.tmux/plugins/tpm/tpm'
# reload config file
bind r source-file ~/.tmux.conf
set-option -g prefix C-t
unbind-key C-b
bind-key C-t send-prefix
bind c new-window -c "#{pane_current_path}"
bind 3 split-window -hc "#{pane_current_path}"
bind 2 split-window -vc "#{pane_current_path}"
set-option -g default-shell /bin/bash
set-option -g default-command /bin/bash
# set-option -g default-shell /usr/bin/zsh
# set-option -g default-command /usr/bin/zsh
set-option -g default-terminal screen-256color
set -g terminal-overrides 'xterm:colors=256'
# highlight active window/pane
# setw -g window-status-current-fg white
# setw -g window-status-current-bg red
# setw -g window-status-current-attr bright
# set -g pane-active-border-fg white
# set -g pane-active-border-bg yellow
# limit lines of history in the window
set -g history-limit 100000
# enable mouse
set-option -g mouse on
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'copy-mode -e'"
# status bar
set -g status-interval 1
# set -g status-fg white
set -g status-bg colour10
set -g status-left-length 50
set -g status-left "#[fg=black]Session:[#S] "
set -g status-right-length 50
set -g status-right "#[fg=black][#(tmux show-options -g prefix)][%Y/%m/%d(%a) %H:%M:%S]"
# setw -g window-status-fg black
# setw -g window-status-bg blue
# setw -g window-status-attr dim
# copy
setw -g mode-keys emacs
bind C-w copy-mode
bind M-w copy-mode
bind C-y paste-buffer
# bind-key -T copy-mode C-w send-keys -X copy-pipe-and-cancel 'xsel -ip && xsel -op | xsel -ib'
# bind-key -T copy-mode M-w send-keys -X copy-pipe-and-cancel 'xsel -ip && xsel -op | xsel -ib'
bind-key -T copy-mode M-w send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
bind-key -T copy-mode C-w send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
# unbind -t emacs-copy M-w
# unbind -t emacs-copy C-w
# bind-key -t emacs-copy M-w copy-pipe "xsel -bi"
# bind-key -t emacs-copy C-w copy-pipe "xsel -bi"
# clock
setw -g clock-mode-style 24
# color
set -g default-terminal "xterm-256color"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment