# vim:fdm=marker expandtab fdc=3 ft=tmux ts=2 sw=2 sts=2: # # Hierarchy: # Server # ㄴSession # ㄴWindow # ㄴPane set -g @plugin 'tmux-plugins/tpm' set -g @plugin 'tmux-plugins/tmux-yank' set -g @plugin 'tmux-plugins/tmux-sidebar' set -g @plugin 'wfxr/tmux-fzf-url' set -g @plugin 'seebi/tmux-colors-solarized' set -g @plugin 'babarot/tmux-git-prompt' set -g mouse on bind-key -T edit-mode-vi WheelUpPane send-keys -X scroll-up bind-key -T edit-mode-vi WheelDownPane send-keys -X scroll-down set-option -g default-shell /bin/zsh set-option -g default-command /bin/zsh set-option -s escape-time 0 set-option -g prefix C-t bind-key C-t send-prefix unbind-key C-b # Keep the window's name fixed # cf. http://blog.yagni.jp/archives/498 (in japanese) # cf. http://stackoverflow.com/questions/6041178/keep-the-windows-name-fixed-in-tmux set-option -g allow-rename off # System window by supported OS set-option -g set-titles on set-option -g set-titles-string "[tmux] #T @ #H" # Enable clipboard #set-option -g default-command \ #'which reattach-to-user-namespace >/dev/null 2>&1 && \ #reattach-to-user-namespace -l bash || bash' # Display time set-option -g display-time 3500 # Operations ## Clients # Switch clients bind-key N switch-client -n bind-key P switch-client -p ## Window # Start window index 1 origin set-option -g base-index 1 # # Split window # bind-key | split-window -h # # # Vertical split window # bind-key - split-window -v # prefix | bind-key | split-window -h -c "#{pane_current_path}" # prefix - bind-key - split-window -c "#{pane_current_path}" # Change active window bind-key -r C-h select-window -t :- bind-key -r C-l select-window -t :+ ## Pane # Start pane index 1 origin set-window-option -g pane-base-index 1 # Resize pane bind-key -r H resize-pane -L 5 bind-key -r J resize-pane -D 5 bind-key -r K resize-pane -U 5 bind-key -r L resize-pane -R 5 # Change active pane bind-key h select-pane -L bind-key j select-pane -D bind-key k select-pane -U bind-key l select-pane -R # Rotate active pane # bind-key -n C-o run "tmux select-pane -l || tmux select-pane -t :.+" # Break or kill pane bind-key b break-pane bind-key q kill-pane bind-key C-q kill-session #bind-key C-k display-panes\; kill-pane\; #bind-key C-k display-panes\; confirm-before kill-pane\; bind-key C-x run "tmux kill-pane || tmux kill-window" bind-key C-t run "tmux last-pane || tmux last-window || tmux new-window" # Display pane bind-key i display-panes # Key-bindings # Reload config file bind-key r source-file ~/.tmux.conf\; display-message "[tmux] ~/.tmux.conf reloaded!" bind-key C-r source-file ~/.tmux.conf\; display-message "[tmux] ~/.tmux.conf reloaded!" # Look up in a web dictionary bind-key g command-prompt -p "Google Translate en->ja:" "split-window 'source ~/.zshrc >/dev/null; gte %% | less'" bind-key G command-prompt -p "Google Translate ja->en:" "split-window 'source ~/.zshrc >/dev/null; gtj %% | less'" # Look up in a man-page bind-key m command-prompt -p "Man:" "split-window 'man %%'" # Appearance # Status-position to move the status line to the top of the screen # available on tmux -V 1.7 # cf. http://sourceforge.net/projects/tmux/files/tmux/tmux-1.7/ set-option -g status-position top set-option -g default-terminal "screen-256color" # set-option -g pane-active-border-bg colour235 setw -g window-status-activity-style bg="colour235" ## Customize statusline set-option -g status on # Length left set-option -g status-left-length 90 set-option -g status-right-length 90 # set-option -g status-left 'tmux:[#P] #[fg=colour33]#(kube-context 2>&1)#[default] #[fg=colour1]#(gcp-context 2>&1)#[default]' set-option -g status-left 'tmux:[#P] #[fg=blue](#(kube-context 2>&1))#[default] #[fg=red](#(gcp-context 2>&1))#[default]' set-option -g status-right '#[fg=white]#(wifi)#[default] #(battery --tmux) [%Y-%m-%d(%a) %H:%M]' set-window-option -g pane-border-status top # set-window-option -g pane-border-format ' #(~/bin/tmux-git-prompt #{pane_current_path}) ' # Reload statusbar set-option -g status-interval 1 # Centerize set-option -g status-justify centre # Enable visual notification set-window-option -g monitor-activity on # Enable visual notification set-option -g visual-activity on # Enable statusbar top set-option -g status-position top # ## Colorscheme: Solarized # # # Default statusbar colors # set-option -g status-bg colour235 #base02 # set-option -g status-fg colour136 #yellow # set-option -g status-attr default # # # Default window title colors # set-window-option -g window-status-fg colour244 #base0 # set-window-option -g window-status-bg default # set-window-option -g window-status-attr dim # # # Active window title colors # set-window-option -g window-status-current-fg colour166 #orange # set-window-option -g window-status-current-bg default # set-window-option -g window-status-current-attr bright # # # Pane border # set-option -g pane-border-fg colour235 #base02 # set-option -g pane-active-border-fg colour240 #base01 # # # Message text # set-option -g message-bg colour235 #base02 # set-option -g message-fg colour166 #orange # # # Pane number display # set-option -g display-panes-active-colour colour33 #blue # set-option -g display-panes-colour colour166 #orange # # # Clock # set-window-option -g clock-mode-colour colour64 #green # Copy-mode set-window-option -g mode-keys vi bind-key v copy-mode \; display "Copy mode!" bind-key C-v copy-mode \; display "Copy mode!" bind-key C-t copy-mode \; display "Copy mode!" # bind-key p paste-buffer # # Make pbcopy/pbpaste and Vim's * register work. # set-option -g default-command "reattach-to-user-namespace -l zsh" # bind-key -t vi-copy v begin-selection # bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy" # unbind-key -t vi-copy Enter # bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy" # bind-key -T copy-mode-vi v send-keys -X begin-selection bind-key -T edit-mode-vi Up send-keys -X history-up bind-key -T edit-mode-vi Down send-keys -X history-down unbind-key -T copy-mode-vi Space bind-key -T copy-mode-vi v send-keys -X begin-selection unbind-key -T copy-mode-vi Enter bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy" # unbind-key -T copy-mode-vi C-v ;bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle # unbind-key -T copy-mode-vi [ ;bind-key -T copy-mode-vi [ send-keys -X begin-selection # unbind-key -T copy-mode-vi ] ;bind-key -T copy-mode-vi ] send-keys -X copy-selection # Back to indentation ^ # Bottom of history G # Clear selection Escape # Copy selection Enter # Cursor down j # Cursor left h # Cursor right l # Cursor to bottom line L # Cursor to middle line M # Cursor to top line H # Cursor up k # Delete entire line d # Delete/Copy to end of line D # End of line $ # Go to line : # Half page down C-d # Half page up C-u # Jump forward f # Jump to forward t # Jump backward F # Jump to backward T # Jump again ; # Jump again in reverse , # Next page C-f # Next space W # Next space, end of word E # Next word w # Next word end e # Other end of selection o # Paste buffer p # Previous page C-b # Previous word b # Previous space B # Quit mode q # Rectangle toggle v # Scroll down C-Down or C-e # Scroll up C-Up or C-y # Search again n # Search again in reverse N # Search backward ? # Search forward / # Start of line 0 # Start selection Space # Top of history g # bind-key -t vi-copy Escape clear-selection # bind-key -t vi-copy C-c cancel # bind-key -t vi-copy C-v rectangle-toggle # bind-key -t vi-copy C-a start-of-line # bind-key -t vi-copy C-e end-of-line # bind-key -t vi-copy w next-word # bind-key -t vi-copy e next-word-end # bind-key -t vi-copy b previous-word # bind-key -t vi-copy g top-line # bind-key -t vi-copy G bottom-line # #bind-key -t vi-copy Space next-space # bind-key -t vi-copy / search-forward # bind-key -t vi-copy ? search-backward # bind-key -t vi-copy C-n page-up # bind-key -t vi-copy C-f page-down # bind-key -t vi-copy C-u scroll-up # bind-key -t vi-copy C-d scroll-down #bind-key -t vi-copy Y copy-line # unbind-key Space #bind-key -t vi-copy Space begin-selection \; end-of-line #bind-key -t vi-copy V copy-end-of-line # bind-key -t vi-copy V select-line #bind-key -t vi-copy V copy-end-of-line #bind-key -t vi-copy C-b page-up #bind-key -t vi-copy C-c cancel #bind-key -t vi-copy C-e scroll-down #bind-key -t vi-copy C-f page-down #bind-key -t vi-copy C-h cursor-left #bind-key -t vi-copy Enter copy-selection #bind-key -t vi-copy C-y scroll-up #bind-key -t vi-copy Escape clear-selection #bind-key -t vi-copy Space begin-selection #bind-key -t vi-copy $ end-of-line #bind-key -t vi-copy , jump-reverse #bind-key -t vi-copy / search-forward #bind-key -t vi-copy 0 start-of-line #bind-key -t vi-copy 1 start-number-prefix #bind-key -t vi-copy 2 start-number-prefix #bind-key -t vi-copy 3 start-number-prefix #bind-key -t vi-copy 4 start-number-prefix #bind-key -t vi-copy 5 start-number-prefix #bind-key -t vi-copy 6 start-number-prefix #bind-key -t vi-copy 7 start-number-prefix #bind-key -t vi-copy 8 start-number-prefix #bind-key -t vi-copy 9 start-number-prefix #bind-key -t vi-copy : goto-line #bind-key -t vi-copy \; jump-again #bind-key -t vi-copy ? search-backward #bind-key -t vi-copy B previous-space #bind-key -t vi-copy D copy-end-of-line #bind-key -t vi-copy E next-space-end #bind-key -t vi-copy F jump-backward #bind-key -t vi-copy G history-bottom #bind-key -t vi-copy H top-line #bind-key -t vi-copy J scroll-down #bind-key -t vi-copy K scroll-up #bind-key -t vi-copy L bottom-line #bind-key -t vi-copy M middle-line #bind-key -t vi-copy N search-reverse #bind-key -t vi-copy T jump-to-backward #bind-key -t vi-copy W next-space #bind-key -t vi-copy ^ back-to-indentation #bind-key -t vi-copy b previous-word #bind-key -t vi-copy e next-word-end #bind-key -t vi-copy f jump-forward #bind-key -t vi-copy g history-top #bind-key -t vi-copy h cursor-left #bind-key -t vi-copy j cursor-down #bind-key -t vi-copy k cursor-up #bind-key -t vi-copy l cursor-right #bind-key -t vi-copy n search-again #bind-key -t vi-copy q cancel #bind-key -t vi-copy t jump-to-forward #bind-key -t vi-copy v rectangle-toggle #bind-key -t vi-copy w next-word #bind-key -t vi-copy BSpace cursor-left #bind-key -t vi-copy NPage page-down #bind-key -t vi-copy PPage page-up #bind-key -t vi-copy Up cursor-up #bind-key -t vi-copy Down cursor-down #bind-key -t vi-copy Left cursor-left #bind-key -t vi-copy Right cursor-right #bind-key -t vi-copy C-Up scroll-up #bind-key -t vi-copy C-Down scroll-down # Misc #set-option -g pane-active-border-fg white #set-option -g pane-active-border-bg yellow #bind-key C-f command-prompt "switch-client -t %%" #bind-key C-y choose-buffer #bind-key C-g choose-session #bind-key C-g choose-window #bind-key s command-prompt "select-window -t %%" run -b '~/.tmux/plugins/tpm/tpm'