dotfiles

$HOME is where the <3 is
git clone git://git.alexkarle.com/dotfiles.git
Log | Files | Refs | README | LICENSE

.tmux.conf (2656B) [raw]


      1 # .tmux.conf
      2 set-option -g history-limit 10000
      3 set-option -g mode-keys vi
      4 set-option -g mouse on
      5 set-option -g set-clipboard off
      6 set-option -g copy-command 'xclip -in -selection clipboard'
      7 
      8 # better prefix
      9 set-option -g prefix C-a
     10 unbind-key C-b
     11 bind-key C-a send-prefix
     12 
     13 # plumber! `a` in copy-mode sends to the 'plumb' command (A/Enter splits in new window)
     14 # right-click also opens in the current window (a la Acme)
     15 bind-key -T copy-mode-vi a send-keys -X copy-pipe-no-clear "plumb #{pane_current_path}"
     16 bind-key -T copy-mode-vi A send-keys -X copy-pipe-no-clear "plumb -w #{pane_current_path}"
     17 bind-key -T copy-mode-vi Enter send-keys -X copy-pipe-no-clear "plumb -w #{pane_current_path}"
     18 bind-key -T root MouseDown3Pane \
     19 	select-pane \; copy-mode -M \; send-keys -X begin-selection \; \
     20 	send-keys -X previous-space \; send-keys -X other-end \; send-keys -X next-space-end \; \
     21 	send-keys -X copy-pipe-and-cancel "plumb #{pane_current_path}"
     22 bind-key -T copy-mode-vi MouseDown3Pane \
     23 	select-pane \; copy-mode -M \; send-keys -X begin-selection \; \
     24 	send-keys -X previous-space \; send-keys -X other-end \; send-keys -X next-space-end \; \
     25 	send-keys -X copy-pipe-and-cancel "plumb #{pane_current_path}"
     26 
     27 # Less delay on pressing escape (for vim)
     28 set-option -sg escape-time 10
     29 
     30 # Navigate splits based on vi-keys
     31 bind-key C-h select-pane -L
     32 bind-key C-j select-pane -D
     33 bind-key C-k select-pane -U
     34 bind-key C-l select-pane -R
     35 
     36 # vi-like selection in copy-mode
     37 bind-key -T copy-mode-vi y send-keys -X copy-pipe-and-cancel
     38 bind-key -T copy-mode-vi v send-keys -X begin-selection
     39 
     40 # hotkeys to search for plumb-able content
     41 bind-key H copy-mode \; send-keys -X search-backward "http[^ ]*"
     42 bind-key S copy-mode \; send-keys -X search-backward "[a-f0-9]{6,40}"
     43 bind-key F copy-mode \; send-keys -X search-backward "^[^ :@#]*:[0-9]*:.*"
     44 bind-key P copy-mode \; send-keys -X search-backward "[^ :@#]*/[^:@# ]*"
     45 bind-key M copy-mode \; send-keys -X search-backward "[^ :@#]*\\([1-9]\\)"
     46 
     47 # bind G into git-grep word under cursor (use with F above)
     48 bind-key G copy-mode \; send-keys -X select-word \; \
     49 	send-keys -X copy-pipe-and-cancel "xclip" \; \
     50 	split-window -c "#{pane_current_path}" -l 10 sh -c 'git grep -n "$(xclip -o)" 2>&1 | less'
     51 
     52 # Use | and - for more intuitive splits (in the same location!)
     53 bind-key | split-window -c "#{pane_current_path}" -h
     54 bind-key - split-window -c "#{pane_current_path}" -v
     55 bind-key c new-window -c "#{pane_current_path}"
     56 
     57 # Start numbers at 1 (like the keyboard), and reorder on close
     58 set-option -g base-index 1
     59 set-option -g renumber-windows on
     60 
     61 if-shell "test -e ~/.tmux.conf.local" "source-file ~/.tmux.conf.local"