############################ Miscellanea ###################### ## Setting the pjefix from C-b to C-a. #set -g prefix C-a # confict with Ctrl-a in shell ## Ensure that we can send Ctrl-A to other apps, through Prefix C-a. bind C-b send-prefix ## Free the original Ctrl-b prefix keybinding. #unbind C-b ## how long the message should display in status message, ms. set-option -g display-time 3000 ## set the default bash set-option -g default-shell /usr/bin/bash ## set the history set-option -g history-limit 4096 ## Setting the delay between prefix and command, -g means global. set -sg escape-time 1 ## Reload the file with Prefix r. bind r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf!" ## Set the base index for windows to 1 instead of 0 set -g base-index 1 ## Set the base index for panes to 1 instead of 0 setw -g pane-base-index 1 ## enablk vi keys. setw -g mode-keys vi ## Enable activity alerts. setw -g monitor-activity on set -g visual-activity on ## Display the title on terminal title. set-option -g set-titles on ## Rather than constraining window size to the maximum size of any client ## connected to the *session*, constrain window size to the maximum size of any ## client connected to *that window*. Much more reasonable. setw -g aggressive-resize on ## mouse support, after 2.1 set -g mouse on ## Send focus-events to applications running in tmux. set-option -g focus-events on ## Set the default terminal mode to 256color mode set -g default-terminal "screen-256color" ## RGB capability set, replace with $TERM outside of tmux. set-option -sa terminal-overrides ",*256col*:Tc" ############################ Panes ############################### ## Splitting panes. unbind '"' unbind % bind \ split-window -h -c '#{pane_current_path}' bind - split-window -v -c '#{pane_current_path}' ## Moving between panes. bind h select-pane -L bind j select-pane -D bind k select-pane -U bind l select-pane -R ## Pane resizing. bind -r H resize-pane -L 5 bind -r J resize-pane -D 5 bind -r K resize-pane -U 5 bind -r L resize-pane -R 5 ########################### Windows Settings #################################### ## the sequence of windows will reset auto set -g renumber-windows on ## the name of windows cann't be changed, you can change manually ## OR the windows' name change all the time set-option -g allow-rename off ## auto window rename set-window-option -g automatic-rename ## Make the current window the first window bind T swap-window -t 1 ## set the default name when windows created, display program name by default #bind-key c new-window -c "#{pane_current_path}" -n "/bin/bash" bind-key c new-window -c "#{pane_current_path}" ## Quick window selection, -r means repeatable. Use default, C-n/p #bind -r C-h select-window -t :- # chose the previous win #bind -r C-l select-window -t :+ # chose the next win bind u select-window -t :- # chose the next win bind-key C command-prompt -p "Name of new window: " "new-window -n '%%'" ########################### Status Line #################################### ## Status line left side set -g status-left-length 40 set -g status-left "#[fg=green]S:#S #[fg=yellow]W:#I #[fg=cyan]P:#P" ## Status line right side #set -g status-right "#(~/battery Discharging) | #[fg=cyan]%d %b %R" set -g status-right "#[fg=cyan]%d %b %R" ## Update the status bar every sixty seconds set -g status-interval 60 ## Center the window list set -g status-justify centre ############################ Color Settings #################################### ### pane colors, display which pane is selected. #set -g pane-border-fg white #set -g pane-border-bg default #set -g pane-active-border-fg green #set -g pane-active-border-bg green ### Command / message line colors #set -g message-fg white #set -g message-bg black #set -g message-attr bright ### set the status line's colors set -g status-fg white set -g status-bg black # OR "set -g status-bg default" ### set the color of the window list #setw -g window-status-fg cyan #setw -g window-status-bg default #setw -g window-status-attr dim ### set colors for the active window #setw -g window-status-current-fg white #setw -g window-status-current-bg red #setw -g window-status-current-attr bright ##################### Copy Paste Settings ################### ## Remapping Copy and Paste Keys Like Vim ???? #unbind [ #bind y copy-mode # OR "bind Escape copy-mode" #unbind p #bind p paste-buffer ##bind -t vi-copy 'v' begin-selection # same as Space ##bind -t vi-copy 'y' copy-selection # same as Enter ### Working with the Clipboard on Linux #unbind C-c #unbind C-v ##bind C-c run-shell "tmux save-buffer - | xclip -i -sel clipboard" # copy to xclip #bind C-c run-shell "tmux show-buffer | xclip -i -selection clipboard" \; display-message "Copied tmux buffer to system clipboard" #bind C-v run "tmux set-buffer \"$(xclip -o -sel clipboard)\"; tmux paste-buffer" # copy to tmux-buffer ## list all buffers #bind i choose-buffer ####################### ## Open panes in the same directory using the tmux-panes script,?????????? #unbind v #unbind n #bind v send-keys " ~/tmux-panes -h" C-m #bind n send-keys " ~/tmux-panes -v" C-m # Log output to a text file on demand #bind P pipe-pane -o "cat >>~/#W.log" \; display "Toggled logging to ~/#W.log" # Toggle log to file # bind H pipe-pane -o 'cat >>$HOME/#W-tmux.log' '\;' display-message 'Toggled logging to $HOME/#W-tmux.log' # # bind h pipe-pane \; display-message 'Ended logging to $HOME/#W-tmux.log'