Advertisement
Guest User

Untitled

a guest
Oct 26th, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.45 KB | None | 0 0
  1. # set <prefix> to Ctrl-s
  2. unbind C-b
  3. set -g prefix C-s
  4.  
  5. # remove esc delay
  6. set -s escape-time 0
  7. set -g repeat-time 0
  8. # reload conf file on "r"
  9. bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf reloaded"
  10.  
  11. # Smart pane switching with awareness of vim splits
  12. # (depends on: https://github.com/christoomey/vim-tmux-navigator)
  13. is_vim='echo "#{pane_current_command}" | grep -iqE "(^|\/)g?(view|n?vim?)(diff)?$"'
  14. bind -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
  15. bind -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
  16. bind -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
  17. bind -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
  18. bind -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
  19.  
  20. # set bindings for pane resizing
  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. bind -n C-Left resize-pane -L 10
  27. bind -n C-Right resize-pane -R 10
  28. bind -n C-Down resize-pane -D 5
  29. bind -n C-Up resize-pane -U 5
  30.  
  31. # window splitting including current dir path
  32. bind-key - split-window -v -c '#{pane_current_path}'
  33. bind-key \ split-window -h -c '#{pane_current_path}'
  34.  
  35. # switching sessions (choose-tree)
  36. bind-key C-j choose-tree
  37.  
  38. # Use vim keybindings in copy mode
  39. setw -g mode-keys vi
  40.  
  41. # Setup vim scroll + copy mode
  42. # (depends on: https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard)
  43.  
  44. # Setup 'v' to begin selection as in Vim
  45. bind-key -t vi-copy v begin-selection
  46. bind-key -t vi-copy y copy-pipe "reattach-to-user-namespace pbcopy"
  47.  
  48. # Update default binding of `Enter` to also use copy-pipe
  49. unbind -t vi-copy Enter
  50. bind-key -t vi-copy Enter copy-pipe "reattach-to-user-namespace pbcopy"
  51.  
  52. # create new windows including current dir path
  53. bind c new-window -c '#{pane_current_path}'
  54.  
  55. # start window indexing from 1 (instead of 0)
  56. set -g base-index 1
  57. set -g renumber-windows on
  58.  
  59. # break pane to new window
  60. bind-key b break-pane -d
  61.  
  62. # set terminal to 256 colors
  63. set -g default-terminal "screen-256color"
  64. # use standard shell commands
  65. set -g status-keys "emacs"
  66.  
  67. # set status bar bg and fg colors
  68. set -g status-bg '#1d2021'
  69. set -g status-fg '#fabd2f'
  70.  
  71. # extend number of characters in status bar
  72. set -g status-left-length 50
  73.  
  74. # add battery level and nicely formatted date to the right side of status bar
  75. set -g status-right "#{?pane_synchronized,--SYNCED--,} #(battery -t -g black) #(date '+%a, %b %d - %I:%M') "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement