# $Id: t-williams.conf,v 1.1 2009/11/02 18:59:28 nicm Exp $ # # ~/.tmux.conf - tmux terminal multiplexer config # Thayer Williams (http://cinderwick.ca) # "Feel free to do whatever you like with it." # I typically start tmux from ~/.xinitrc with the following: # # urxvt -e bash -c "tmux attach -d -t mysession" & # # and recall it any time thereafter with xbindkeys (Mod4+s): # # "urxvt -e bash -c 'tmux attach -d -t mysession'" # m:0x50 + c:39 set -g mouse on #ERROR? setw -g mode-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; send-keys -M'" #bind -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M" #bind -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M" set -ga terminal-overrides ',xterm*:smcup@:rmcup@' set -ga terminal-overrides ',urxvt*:smcup@:rmcup@' # set prefix key to ctrl+a until I have time to adapt #EDIT unbind C-b #EDIT set -g prefix C-a # send the prefix to client inside window (ala nested sessions) #EDIT bind-key a send-prefix # toggle last window like screen bind-key C-a last-window # confirm before killing a window or the server bind-key k confirm kill-window bind-key K confirm kill-server # toggle statusbar bind-key b set-option status # ctrl+left/right cycles thru windows bind-key -n C-right next bind-key -n C-left prev # open a man page in new window bind / command-prompt "split-window 'exec man %%'" # quick view of processes bind '~' split-window "exec htop" # scrollback buffer n lines set -g history-limit 20000 # listen for activity on all windows set -g bell-action any # on-screen time for display-panes in ms set -g display-panes-time 2000 # start window indexing at one instead of zero set -g base-index 1 # enable wm window titles set -g set-titles on # wm window title string (uses statusbar variables) set -g set-titles-string "tmux.#I.#W" # ThG: set vi mode set-window-option -g mode-keys vi # ThG: force a reload of the .tmux.conf file with Ctrl-a r unbind r bind r source-file ~/.tmux.conf # sample session initialization # Start new session with .tmux-conf settings with: tmux attach # Kill session entirely from a tmux session with: C-a: kill-session #new -n bash #neww -n tab1 'cd ~/; bash' #neww -n tab2 'cd ~/; bash' #neww -n tab3 'cd ~/; bash' #neww -n tab4 'cd ~/; bash' #neww -n tab5 'cd ~/; bash' # #select-window -t 2 # Status bar 1 tab-based-------------------------------------------------------------- # set -g display-time 3000 # # # default statusbar colors # set -g status-fg black # ThG original was: white # set -g status-bg white # set -g status-attr default # # # default window title colors # set-window-option -g window-status-fg black # set-window-option -g window-status-bg white # set-window-option -g window-status-attr dim # # # active window title colors # set-window-option -g window-status-current-fg white # set-window-option -g window-status-current-bg black # set-window-option -g window-status-current-attr dim # # # command/message line colors # set -g message-fg white # set -g message-bg black # set -g message-attr bright # # # center align the window list # set -g status-justify left # centre # # # show some useful stats but only when tmux is started # # outside of Xorg, otherwise dwm statusbar shows these already # # set -g status-right "" # ThG: conflicts with time display # set -g status-left "" # if '[ -z "$DISPLAY" ]' 'set -g status-left "[#[fg=green] #H #[default]]"' # if '[ -z "$DISPLAY" ]' 'set -g status-right "[ #[fg=magenta]#(cat /proc/loadavg | cut -d \" \" -f 1,2,3)#[default] ][ #[fg=cyan,bright]%a %Y-%m-%d %H:%M #[default]]"' # if '[ -z "$DISPLAY" ]' 'set -g status-right-length 50' # Status bar 2 non-tab-based cyan color-------------------------------------------------------------- set -g display-time 3000 # default statusbar colors set -g status-fg cyan # ThG original was: white set -g status-bg default #ERROR? set -g status-attr default # default window title colors #ERROR? set-window-option -g window-status-fg cyan #ERROR? set-window-option -g window-status-bg default #ERROR? set-window-option -g window-status-attr dim # active window title colors #ERROR? set-window-option -g window-status-current-fg white #ERROR? set-window-option -g window-status-current-bg default #ERROR? set-window-option -g window-status-current-attr bright # command/message line colors #ERROR? et -g message-fg white #ERROR? et -g message-bg black #ERROR? et -g message-attr bright # center align the window list set -g status-justify centre # left # show some useful stats but only when tmux is started # outside of Xorg, otherwise dwm statusbar shows these already # set -g status-right "" # ThG: conflicts with time display set -g status-left "" set -g status-right "" if '[ -z "$DISPLAY" ]' 'set -g status-left "[#[fg=green] #H #[default]]"' if '[ -z "$DISPLAY" ]' 'set -g status-right "[ #[fg=magenta]#(cat /proc/loadavg | cut -d \" \" -f 1,2,3)#[default] ][ #[fg=cyan,bright]%a %Y-%m-%d %H:%M #[default]]"' if '[ -z "$DISPLAY" ]' 'set -g status-right-length 50' # Maximizing and restoring panes. unbind + bind + new-window -d -n tmp \; swap-pane -s tmp.0 \; select-window -t tmp unbind - bind - last-window \; swap-pane -s tmp.0 \; kill-window -t tmp ## FOUND ON: https://gist.github.com/quentin/ad4eea0d151e132f180e543a14bd3df0 # selection with mouse copies to clipboard in addition to the default action unbind-key -n -T copy-mode-vi MouseDragEnd1Pane bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -in -sel primary" # middle click to paste from the clipboard unbind-key MouseDown2Pane bind-key -T root MouseDown2Pane run "tmux set-buffer \"$(xclip -o -sel primary)\"; tmux paste-buffer" run-shell ~/tmux-plugins/tmux-resurrect/resurrect.tmux set -g @resurrect-dir '~/.tmux/resurrect' set -g @resurrect-capture-pane-contents 'off' set -g @resurrect-processes 'vifm mutt newsboat' set -g @resurrect-strategy-vim 'session' # pane movement bind-key j command-prompt -p "join pane from:" "join-pane -s '%%'" bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'" #bind-key m switchc -t 'mail' #bind-key M switchc -t 'cmus' #bind-key v switchc -t 'vifm' #bind-key V switchc -t '0' bind -n C-k clear-history #To make italics work (https://rsapkf.xyz/blog/enabling-italics-vim-tmux/) # #$ cat <