Skip to content

Latest commit

 

History

History
79 lines (59 loc) · 2.79 KB

File metadata and controls

79 lines (59 loc) · 2.79 KB

This project is deprecated and unmaintained. Proceed with caution!

tips on how to improve your efficiency using tmux and vim together. also a loud keyboard?

Notes from the video:

These are the vim plugins I used:

" vimrc

Plugin 'benmills/vimux'
Plugin 'edkolev/tmuxline.vim'
Plugin 'christoomey/vim-tmux-navigator'
Plugin 'tpope/vim-dispatch'

Bash aliases I used (not talked about during screencast):

alias clr="clear && tmux clear-history"
alias tl="tmux ls"
alias ta="tmux attach-session -t"
alias t="tmux new-session -s"

These are the important parts of my tmux config. (Full version here).

# tmux.conf

# Smart pane switching with awareness of vim splits
# Source: https://github.com/christoomey/vim-tmux-navigator
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys C-l) || tmux select-pane -R"
# bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim(diff)?$' && tmux send-keys 'C-\\') || tmux select-pane -l"

# clear scrollback
bind k send-keys -R \; clear-history \; send-keys Enter

# source the mac os x specific conf file
if-shell 'test "$(uname)" = "Darwin"' 'source ~/.tmux-osx.conf'
# tmux-osx.conf
set-option -g default-command "reattach-to-user-namespace -l bash"

Other cool tmux references

Thoughtbots

Other references