Permalink
Browse files

Mess with tmux

  • Loading branch information...
1 parent 3a5940a commit 836391ea1786be78447c6a6a9b731227a78491a5 @dmedvinsky committed Feb 28, 2013
Showing with 111 additions and 46 deletions.
  1. +3 −0 config.fish
  2. +108 −46 tmux.conf
View
@@ -161,6 +161,9 @@ function ga.; git add . $argv; end
function gba; git branch -a $argv; end
function gri; git rebase --interactive $argv; end
+# Tmux
+function ta; tmux attach $argv; end
+
function venv
# Activates Python virtualenv for current project.
# Supports reading .env.
View
154 tmux.conf
@@ -1,26 +1,87 @@
# Keybindings {{{
+# Change prefix.
set -g prefix C-h
bind C-h send-prefix
-
unbind C-b
-unbind "\""
+
+# Unbind stuff I don't use.
+unbind \# # list-buffers
+unbind '$' # command-prompt -I #S "rename-session '%%'"
+unbind % # split-window -h
+unbind & # confirm-before -p "kill-window #W? (y/n)" kill-window
+unbind "'" # command-prompt -p index "select-window -t ':%%'"
+unbind '"' # split-window -v
+unbind ( # switch-client -p
+unbind ) # switch-client -n
+unbind - # delete-buffer
+unbind = # choose-buffer
+unbind [ # copy-mode
+unbind ] # paste-buffer
+unbind , #
+unbind . #
+unbind H #
+unbind J #
+unbind K #
+unbind L #
+unbind d # detach-client
+unbind f # command-prompt "find-window '%%'"
+unbind n # next-window
+unbind o # rotate-window -U
+unbind p # previous-window
+# unbind q # display-panes
+# unbind r # refresh-client
+# unbind t # clock-mode
+unbind y #
+unbind M-n # next-window -a
+unbind M-o # rotate-window -D
+unbind Up
+unbind Down
+unbind Left
+unbind Right
+unbind M-Up
+unbind M-Down
+unbind M-Left
+unbind M-Right
+unbind C-Up
+unbind C-Down
+unbind C-Left
+unbind C-Right
+
bind F12 source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf"
+# Command prompt without shift, becase jumping from control to shift is hard.
bind \; command-prompt
-bind v split-window -h
-bind s split-window -v
-bind h select-pane -L
-bind j select-pane -D
-bind k select-pane -U
-bind l select-pane -R
+# Detach client.
+bind D detach-client
-bind -r C-h resize-pane -L 1
-bind -r C-j resize-pane -D 1
-bind -r C-k resize-pane -U 1
-bind -r C-l resize-pane -R 1
+# New session.
+bind C new-session \; command-prompt "rename-session '%%'"
+# Choose session.
+bind C-s choose-session
+# Rename session.
+bind S command-prompt -I "#S" "rename-session '%%'"
+# New window.
+bind c new-window \; command-prompt "rename-window '%%'"
+# Choose window.
+bind C-w choose-window
+# Rename window.
+bind W command-prompt -I "#W" "rename-window '%%'"
+# Move window to other index.
+bind m command-prompt "move-window -t '%%'"
+# Find window by name.
+bind / command-prompt "find-window '%%'"
+# Jump to recent window, like Vim.
+bind C-^ last-window
+# Next urgent window.
+bind u next-window -a
+# Progressively choose windows.
+bind j next-window
+bind k previous-window
+# Numbers select appropriate windows.
+bind 0 select-window -t 0
bind 1 select-window -t 1
bind 2 select-window -t 2
bind 3 select-window -t 3
@@ -31,55 +92,54 @@ bind 7 select-window -t 7
bind 8 select-window -t 8
bind 9 select-window -t 9
-bind C-^ last-window
-bind W choose-window
-bind u next-window -a
-bind n next-window
-bind p previous-window
-bind / command-prompt "find-window '%%'"
-bind , command-prompt "rename-window '%%'"
-
-bind c new-window \; command-prompt "rename-window '%%'"
-bind C new-window
-
-bind < command-prompt "rename-session '%%'"
-bind S choose-session
-
-bind D detach-client
-
-bind b set -w monitor-activity
-bind m set -g mouse-select-pane \; set -g mouse-resize-pane \; set -g mouse-select-window
-
-# Copy mode
+# Split panes like in Vim.
+bind v split-window -h
+bind s split-window -v
+# Select pane.
+bind C-p display-panes
+# Select panes with control, becase I just used control to issue prefix.
+bind -r C-h select-pane -L
+bind -r C-j select-pane -D
+bind -r C-k select-pane -U
+bind -r C-l select-pane -R
+bind -r C-w select-pane -t :.+
+# Resize panes with capital direction keys.
+bind -r H resize-pane -L 1
+bind -r J resize-pane -D 1
+bind -r K resize-pane -U 1
+bind -r L resize-pane -R 1
+
+# Copy mode.
set -wg mode-keys vi
-bind [ copy-mode
-unbind p
+bind y copy-mode
bind p paste-buffer
bind -t vi-copy v begin-selection
bind -t vi-copy y copy-selection
-# Custom
+# Other.
+bind M-b set -w monitor-activity
+bind M-m set -g mouse-select-pane \; set -g mouse-resize-pane \; set -g mouse-select-window
+# Copy tmux paste buffer to Clipboard.
+bind C-c run "tmux show-buffer | xclip -i -selection clipboard"
+# Copy Clipboard to tmux paste buffer and paste tmux paste buffer.
+bind C-v run "tmux set-buffer -- \"$(xclip -o -selection clipboard)\"; tmux paste-buffer"
bind F1 link-window -s misc:mutt -k -t 0
bind F2 link-window -s misc:cmus -k -t 0
bind F10 unlink-window -t 0
-
-# Copy tmux paste buffer to CLIPBOARD
-bind C-c run "tmux show-buffer | xclip -i -selection clipboard"
-# Copy CLIPBOARD to tmux paste buffer and paste tmux paste buffer
-bind C-v run "tmux set-buffer -- \"$(xclip -o -selection clipboard)\"; tmux paste-buffer"
-
# }}}
# Options {{{
-set -g default-terminal "screen-256color"
+set -g default-terminal "screen-256color"
set -wg utf8 on
set -sg escape-time 0
set -sg repeat-time 600
set -g base-index 1
set -wg pane-base-index 1
+set -g mouse-select-window off
set -g mouse-select-pane off
+set -g mouse-resize-pane off
set -wg monitor-activity on
set -g visual-activity off
@@ -89,20 +149,22 @@ set -g bell-action any
set -g bell-on-alert on
set -g display-panes-time 3000
+
+set -g status on
+set -g status-utf8 on
+set -g status-interval 2
+set -g window-status-activity-attr bold
+set -g message-attr bold
# }}}
# Theme {{{
-# Bad Wolf
set -g status-fg white
set -g status-bg colour234
-set -g window-status-activity-attr bold
set -g pane-border-fg colour245
set -g pane-active-border-fg colour1
set -g message-fg colour16
set -g message-bg colour221
-set -g message-attr bold
-# Status bar
set -g status-left-length 32
set -g status-right-length 150
set -g status-interval 5

0 comments on commit 836391e

Please sign in to comment.