DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

Tmux Configurations for Unity Desktop


Verified on Ubuntu 14.04, 2015-6-18.

Prefix

M-f will activate the Unity HUB, so use M-q as tmux prefix: set -g prefix M-q.

Get Help

  • List all shortcuts: prefix ?

  • List all commands: tmux list-commands

Open a new Window/Pane

bind -n M-/ split-window -h bind -n M-- split-window -v bind -n M-n new-window

Resize Pane in a Window

Use Ctrl- arrow key to resize pane:

bind -n -r ^Left resize-pane -L 5
bind -n -r ^Down resize-pane -D 5
bind -n -r ^Up resize-pane -U 5
bind -n -r ^Right resize-pane -R 5

Use M-z to maximize/restore a pane: bind -n M-z resize-pane -Z.

Rotate Panes in a Window

Use default settings: prefix + Space

Jump between Window and Pane

Alt-(1~9): jump between windows;

Alt-h/j/k/l: jump between panes;

bind -n M-1 select-window -t 1
bind -n M-2 select-window -t 2
bind -n M-3 select-window -t 3
bind -n M-4 select-window -t 4
bind -n M-5 select-window -t 5
bind -n M-6 select-window -t 6
bind -n M-7 select-window -t 7
bind -n M-8 select-window -t 8
bind -n M-9 select-window -t 9

bind -n M-k select-pane -U
bind -n M-j select-pane -D
bind -n M-h select-pane -L
bind -n M-l select-pane -R

Move Window

Moving window behaves different with i3wm. If the target window exists, you have to use join-pane, otherwise break-pane.

I use if-shell to test if the target window exists.

Then add target window number provided by user (%1, which means the first user-input parameter) after "-t" option of join-pane. The default target format is #{session_name}:#{window_index}.#{pane_index}. See man tmux for details.

bind -n M-i command-prompt -p "move current pane to window:" "if-shell 'tmux list-windows |grep \"^%1\":' 'join-pane -t:\"%1\"' 'break-pane'"

Other helpful resources

Use ^A to represent "Ctrl-A".

Shutdown visual alerts:

setw -g monitor-activity on
set -g visual-activity off

Commands

  • clock-mode: display a large clock on the terminal

Shortcuts

bind -n M-a command-prompt
bind -n M-r command-prompt -p "rename window name to:" "rename-window '%%'"
bind r source-file ~/.tmux.conf \; display "Reloaded!"


Published

Jun 18, 2015

Last Updated

Jun 18, 2015

Category

Tech

Tags

  • target format 1
  • tmux 10
  • ubuntu 61
  • unity 4

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor