Skip to content

Commit

Permalink
add tmux config
Browse files Browse the repository at this point in the history
  • Loading branch information
jaypei committed Aug 16, 2014
1 parent b7d1673 commit a21fbf3
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 148 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "emacsconf/emacs.d/site-lisp/neotree"]
path = emacsconf/emacs.d/site-lisp/neotree
url = [email protected]:jaypei/emacs-neotree.git
[submodule "tmux/tmux.d/tmux-powerline"]
path = tmux/tmux.d/tmux-powerline
url = https://github.com/erikw/tmux-powerline.git
208 changes: 60 additions & 148 deletions tmux/tmux.conf
Original file line number Diff line number Diff line change
@@ -1,158 +1,70 @@
##########################################
# old config
##########################################

set -g default-terminal "screen-256color"
set -g status-utf8 on

bind M source-file ~/.tmux/mac.session
bind L source-file ~/.tmux/linux.session

# set -g terminal-overrides 'xterm*:smcup@:rmcup@'

# THEME
set -g status-bg black
set -g status-fg white
set -g status-left-length 30
set -g status-right-length 60
set -g status-left ' #[default]'
#set -g status-right '#[fg=colour235]Inbox: #[fg=yellow]#(ls ~/Mails/INBOX/new | wc -l | tr -d " ")#[fg=colour235]/#(ls ~/Mails/INBOX/cur ~/Mails/INBOX/new | wc -l | tr -d " ") | Bugzilla: #[fg=yellow]#(ls ~/Mails/bugzilla/new | wc -l | tr -d " ")#[fg=colour235]/#(ls ~/Mails/bugzilla/cur ~/Mails/bugzilla/new| wc -l | tr -d " ") | ml: #[fg=yellow]#(ls ~/Mails/lists/new | wc -l | tr -d " ")#[fg=colour235]/#(ls ~/Mails/lists/cur ~/Mails/lists/new | wc -l | tr -d " ")#[default] #[fg=colour198]%H:%M#[default]'
set -g status-right '#[fg=colour198]%H:%M @jaypei#[default]'

setw -g window-status-format '#[fg=red]#I #[fg=white]#W#[default] '
#FIXME: I want to be able to use: ⮁
setw -g window-status-current-format '#[bg=white,fg=black]⮀ #[fg=red]#I #[fg=black]#W #[bg=black,fg=white]⮀'

######################### SCREEN BINDINGS ######################

# $Id: screen-keys.conf,v 1.7 2010/07/31 11:39:13 nicm Exp $
#
# By Nicholas Marriott. Public domain.
#
# This configuration file binds many of the common GNU screen key bindings to
# appropriate tmux key bindings. Note that for some key bindings there is no
# tmux analogue and also that this set omits binding some commands available in
# tmux but not in screen.
#
# Note this is only a selection of key bindings and they are in addition to the
# normal tmux key bindings. This is intended as an example not as to be used
# as-is.

# Set the prefix to ^A.
unbind C-b
set -g prefix ^A
bind a send-prefix

# Bind appropriate commands similar to screen.
# lockscreen ^X x
unbind ^X
bind ^X lock-server
unbind x
bind x lock-server

# screen ^C c
unbind ^C
bind ^C new-window
bind c new-window

# detach ^D d
unbind ^D
bind ^D detach

# displays *
unbind *
bind * list-clients

# next ^@ ^N sp n
unbind ^@
bind ^@ next-window
unbind ^N
bind ^N next-window
unbind " "
bind " " next-window
unbind n
bind n next-window

# title A
unbind A
bind A command-prompt "rename-window %%"

# other ^A
unbind ^A
bind ^A last-window

# prev ^H ^P p ^?
unbind ^H
bind ^H previous-window
unbind ^P
bind ^P previous-window
unbind p
bind p previous-window
unbind BSpace
bind BSpace previous-window

# windows ^W w
unbind ^W
bind ^W list-windows
unbind w
bind w list-windows

# quit \
#unbind \
#bind \ confirm-before "kill-server"

# kill K k
unbind K
bind K confirm-before "kill-window"
unbind x
bind x confirm-before "kill-window"

# redisplay ^L l
unbind ^L
bind ^L refresh-client
unbind l
bind l refresh-client

# split -v |
unbind |
bind | split-window

# :kB: focus up
unbind Tab
bind Tab select-pane -t:.+
unbind BTab
bind BTab select-pane -t:.-

# " windowlist -b
unbind '"'
bind '"' choose-window

# split windows like vim
# vim's definition of a horizontal/vertical split is reversed from tmux's
bind s split-window -v
bind v split-window -h

# move around panes with hjkl, as one would in vim after pressing ctrl-w
# status bar

set-option -g status on
set-option -g status-interval 5
set-option -g status-utf8 on
set-option -g status-justify "centre"
set-option -g status-left-length 60
set-option -g status-right-length 60
set-option -g status-left "#(~/.tmux.d/tmux-powerline/powerline.sh left)"
set-option -g status-right "#(~/.tmux.d/tmux-powerline/powerline.sh right)"

# C-b is not acceptable -- Vim uses it
set-option -g prefix C-\\
bind-key C-\ last-window

# Start numbering at 1
set -g base-index 1

# Allows for faster key repetition
set -s escape-time 0

# 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

# Allows us to use C-a a <command> to send commands to a TMUX session inside
# another TMUX session
bind-key a send-prefix

# Activity monitoring
setw -g monitor-activity on
set -g visual-activity on

# Highlight active window
set-window-option -g window-status-current-bg blue
set-window-option -g window-status-current-fg yellow
set-window-option -g window-status-fg white

# Vi copypaste mode
set-window-option -g mode-keys emacs

# hjkl pane traversal
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R

# resize panes like vim
# feel free to change the "1" to however many lines you want to resize by, only
# one at a time can be slow
bind < resize-pane -L 1
bind > resize-pane -R 1
bind - resize-pane -D 1
bind + resize-pane -U 1

# bind : to command-prompt like vim
# this is the default in tmux already
bind : command-prompt
# reload config
bind r source-file ~/.tmux.conf \; display-message "Config reloaded..."

# vi-style controls for copy mode
setw -g mode-keys vi
# split
bind-key | split-window -h
bind-key - split-window -v

# resize
bind-key -r A-Up resize-pane -U
bind-key -r A-Down resize-pane -D
bind-key -r A-Left resize-pane -L
bind-key -r A-Right resize-pane -R

# auto window rename
set-window-option -g automatic-rename

# rm mouse mode fail
set -g mode-mouse off

# color
# set -g default-terminal "screen-256color"
set -g default-terminal "ansi"
1 change: 1 addition & 0 deletions tmux/tmux.d/tmux-powerline
Submodule tmux-powerline added at 19afd8

0 comments on commit a21fbf3

Please sign in to comment.