Permalink
Browse files

tmux FTW! LIKE A BOSS! "[..] until I took an arrow to the knee".

  • Loading branch information...
1 parent 5584721 commit b2b2db01ec011177b01929c4c57ffe67061eadc1 @StanAngeloff committed Jun 12, 2012
Showing with 150 additions and 54 deletions.
  1. +2 −3 .aliases
  2. +1 −1 .gitignore
  3. +0 −47 .screenrc
  4. +142 −0 .tmux.conf
  5. +4 −0 .vimrc
  6. +1 −3 .zshrc
View
@@ -12,9 +12,8 @@ alias rd=rmdir
alias pu='pushd'
alias po='popd'
-# `screen` operations for starting and attaching to a session.
-alias '!'='screen -dR'
-alias '?'='screen -ls'
+# `tmux` operations for starting and attaching to a session.
+alias '!'='tmux -q has-session && exec tmux attach-session -d || exec tmux new-session -s default'
# Directory listing.
alias ll='ls -hal --color=tty'
View
@@ -10,7 +10,7 @@
!.gtkrc-2.0
!.install_profile.sh
!.localrc_stan-inspiron_gnu_linux
-!.screenrc
+!.tmux.conf
!.urxvt/
!.urxvt/ext/
!.vim/
View
@@ -1,47 +0,0 @@
-altscreen on
-autodetach on
-defbce on
-defnonblock on
-defsilence off
-defutf8 on
-startup_message off
-vbell off
-
-term xterm-256color
-termcapinfo xterm* ti@:te@
-attrcolor b ".I"
-
-setenv ALTTERM 'screen'
-
-defscrollback 10240
-hardcopydir $HOME/.screen
-hardcopy_append on
-shell -$SHELL
-silence off
-silencewait 15
-
-hardstatus alwayslastline '%{gk}(%H)%{w} %{y}[%= %?%-Lw%?%{+u}%n*%f %t%?(%u)%?%{-u}%?%+Lw%? %=]%{w} %l %c'
-
-sorendition gb
-activity '%C -> %n%f %t activity!'
-bell_msg 'Bell in window %n'
-pow_detach_msg 'BYE'
-vbell_msg ' *beep* '
-
-bind j focus down
-bind k focus up
-
-bind + resize +1
-bind - resize -1
-
-bind ' ' select 0
-
-bind @ windowlist -m
-
-bindkey " " next
-
-windowlist title 'Num Title'
-windowlist string '%3n %t'
-
-windowlist title 'Flag Num Title'
-windowlist string '%f%04= %3n %t'
View
@@ -0,0 +1,142 @@
+# Time in milliseconds for which tmux waits after an escape, mirror Vim configuration.
+set-option -g escape-time 325
+set-option -g repeat-time 325
+# Keep quiet and don't display warnings.
+set-option -g quiet on
+# Interact with xterm clipboard.
+set-option -g set-clipboard on
+# Window numbering starts from '1', '0' is too far away.
+set-option -g base-index 1
+# Ring the terminal bell from any window, in URxvt this is disabled, but activity is recorded.
+set-option -g bell-action any
+set-option -g bell-on-alert on
+# Pretend to be 'screen', easier as many scripts already recognise the $TERM string.
+set-option -g default-terminal "screen-256color"
+# The maximum number of lines held in history, mirror URxvt configuration.
+set-option -g history-limit 102400
+# Mouse is useful so just go with it.
+set-option -g mouse-resize-pane on
+set-option -g mouse-select-window on
+set-option -g mouse-select-pane on
+set-option -g mouse-utf8 on
+# Redraw the status line more frequently than the default.
+set-option -g status-interval 5
+# Use Vi key bindings on the tmux command line.
+set-option -g status-keys vi
+# Treat top-bit-set characters in the 'status-left' and 'status-right' strings as UTF-8.
+set-option -g status-utf8 on
+# Scrolling with Shift-PageUp/Shift-PageDown.
+set -g terminal-overrides "*rxvt*:smcup@:rmcup@"
+# Disable annoying visual bells.
+set-option -g visual-bell off
+
+# Don't choose a window title for me, thank you.
+set-window-option -g automatic-rename off
+# Preserve any output before running interactive commands, such as Vim.
+set-window-option -g alternate-screen on
+# Use Vi key bindings for copy/paste operations.
+set-window-option -g mode-keys vi
+# Use the mouse wheel to enter copy mode.
+set-window-option -g mode-mouse on
+# Watch for activity in windows and highlight on the status line.
+set-window-option -g monitor-activity on
+# Numbering for panes is same as numbering for windows.
+set-window-option -g pane-base-index 1
+# Enable xterm-style key sequences and modifiers such as Ctrl, Alt and Shift.
+set-window-option -g xterm-keys on
+
+# Key bindings.
+set-option -g prefix C-s
+bind-key C-s send-prefix
+unbind-key C-b
+
+# Re-read the configuration file in a running session.
+bind-key r source-file ~/.tmux.conf
+
+# Clipboard manipulation.
+bind-key C-c run "tmux save-buffer - | xclip -i -selection clipboard"
+bind-key C-v run "tmux set-buffer -- \"$( xclip -o -selection clipboard )\"; tmux paste-buffer"
+
+# Copy and pasting
+bind-key -t vi-copy 'v' begin-selection
+bind-key -t vi-copy 'y' copy-selection
+
+unbind-key -t vi-copy Enter
+unbind-key -t vi-copy Space
+
+# Quick pane cycling with Ctrl-S.
+bind-key C-s select-pane -t :.+
+unbind-key o
+
+# Move around panes like in Vim (only in tmux 1.6).
+bind-key j select-pane -D
+bind-key k select-pane -U
+bind-key l select-pane -R
+bind-key h select-pane -L
+
+unbind-key Up
+unbind-key Down
+unbind-key Left
+unbind-key Right
+
+# Resize panes using Vi-style key bindings.
+bind-key -r C-k resize-pane -U
+bind-key -r C-j resize-pane -D
+bind-key -r C-h resize-pane -L
+bind-key -r C-l resize-pane -R
+
+bind-key -r C-M-k resize-pane -U 5
+bind-key -r C-M-j resize-pane -D 5
+bind-key -r C-M-h resize-pane -L 5
+bind-key -r C-M-l resize-pane -R 5
+
+unbind-key M-Up
+unbind-key M-Down
+unbind-key M-Left
+unbind-key M-Right
+
+unbind-key C-Up
+unbind-key C-Down
+unbind-key C-Left
+unbind-key C-Right
+
+# Split window horizontally and vertically.
+bind-key | split-window -h
+bind-key _ split-window -v
+
+unbind-key '"'
+unbind-key %
+
+# Focus attention in a pane by maximizing it.
+unbind-key +
+unbind-key -
+
+bind-key + new-window -d -n tmux-maximized \; swap-pane -s tmux-maximized.1 \; select-window -t tmux-maximized
+bind-key - last-window \; swap-pane -s tmux-maximized.1 \; kill-window -t tmux-maximized
+
+# Formatting & Colours.
+set-option -g mode-bg colour220
+set-option -g mode-fg colour16
+set-option -g status-bg colour232
+set-option -g status-fg colour247
+set-option -g pane-border-fg colour238
+set-option -g pane-active-border-fg colour248
+set-option -g message-bg colour232
+set-option -g message-fg colour220
+set-option -g message-attr bold
+
+set-window-option -g window-status-activity-fg colour251
+set-window-option -g window-status-bell-fg colour251
+set-window-option -g window-status-content-fg colour251
+
+set-window-option -g window-status-activity-attr bold
+set-window-option -g window-status-bell-attr bold
+set-window-option -g window-status-content-attr bold
+
+set-window-option -g status-left '#[fg=colour252,bg=colour244] #S #[fg=colour244,bg=colour232]⮀'
+set-window-option -g status-right '#[fg=colour244,bg=colour232]⮂#[fg=colour252,bg=colour244] #h '
+set-window-option -g window-status-format " (#I) #W "
+set-window-option -g window-status-current-format "#[fg=colour232,bg=colour39]⮀#[fg=colour16,bg=colour39] #I ⮁ #W #[fg=colour39,bg=colour232]⮀"
+
+set-option -g status-left-length 64
+set-option -g status-right-length 64
View
@@ -461,3 +461,7 @@ Bundle 'bogado/file-line'
Bundle 'tpope/vim-eunuch'
Bundle 'nerdtree-ack'
+
+Bundle 'zaiste/tmux.vim'
+
+Bundle 'benmills/vimux'
View
@@ -180,9 +180,7 @@ function chpwd {
# Fancy terminal title
function _terminal_title {
- if [[ "$TERM" == screen* ]] || [[ "$ALTTERM" == screen* ]]; then
- print -Pn "\ek$1:q\e\\" # Set `screen` hardstatus.
- elif [[ "$TERM" == xterm* ]] || [[ "$TERM" == rxvt* ]]; then
+ if [[ "$TERM" == xterm* ]] || [[ "$TERM" == rxvt* ]]; then
print -Pn "\e]2;$2:q\a" # Set window name.
print -Pn "\e]1;$1:q\a" # Set icon (=tab) name (will override window name on broken terminal).
fi

0 comments on commit b2b2db0

Please sign in to comment.