Advertisement
Guest User

Untitled

a guest
May 3rd, 2015
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. # switch to C-s
  2. set -g prefix C-s
  3. unbind C-b
  4.  
  5. # use r for reloading
  6. unbind r
  7. bind r source-file ~/.tmux.conf
  8.  
  9. # Prefer hjkl for moving about the panes
  10. bind-key -n C-h select-pane -L
  11. bind-key -n C-j select-pane -D
  12. bind-key -n C-k select-pane -U
  13. bind-key -n C-l select-pane -R
  14.  
  15. bind-key - split-window -v -c '#{pane_current_path}'
  16. bind-key \ split-window -h -c '#{pane_current_path}'
  17. bind c new-window -c "#{pane_current_path}"
  18. bind-key b break-pane -d
  19.  
  20. # Fine adjustment (1 or 2 cursor cells per bump)
  21. bind -n S-Left resize-pane -L 2
  22. bind -n S-Right resize-pane -R 2
  23. bind -n S-Down resize-pane -D 1
  24. bind -n S-Up resize-pane -U 1
  25.  
  26. set-option -g default-terminal "screen-256color"
  27.  
  28. setw -g mode-keys vi
  29.  
  30. # Setup 'v' to begin selection as in Vim
  31. bind-key -t vi-copy v begin-selection
  32. bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
  33.  
  34. # Update default binding of `Enter` to also use copy-pipe
  35. unbind -t vi-copy Enter
  36. bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
  37.  
  38. # Setup 'v' to begin selection as in Vim
  39. bind-key -t vi-copy v begin-selection
  40. bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
  41.  
  42. # Update default binding of `Enter` to also use copy-pipe
  43. unbind -t vi-copy Enter
  44. bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
  45.  
  46. bind-key j choose-tree
  47. set-option -g status-right " #(date '+%b %d - %I:%M') "
  48. set-option -g status-bg '#666666'
  49. set-option -g status-fg '#aaaaaa'
  50.  
  51. # Smart pane switching with awareness of vim splits
  52. is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
  53. bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
  54. bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
  55. bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
  56. bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
  57. bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
  58.  
  59. # Secondary binding for C-l to retain redraw
  60. bind C-l send-keys 'C-l'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement