tmux.conf 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # {{{ Unbind first
  2. unbind-key C-b #no more C^b
  3. unbind-key [
  4. # }}}
  5. # {{{ Options
  6. set-option -g base-index 1
  7. set-window-option -g pane-base-index 1
  8. set-option -g default-terminal "screen-256color"
  9. # -- vi mode
  10. set-window-option -g mode-keys vi
  11. set-option -g status-keys vi
  12. set-option -g status-keys vi
  13. set-option -g repeat-time 1000
  14. set-option -sg escape-time 0
  15. set-option -g history-limit 4096
  16. # }}}
  17. # {{{ prefix
  18. # Semicolon is the only key that isn't bound by readline
  19. # this creates a problem inside of ttys...
  20. set-option -g prefix C-f
  21. bind-key f send-prefix
  22. # }}}
  23. # Key bindings {{{
  24. bind-key S source-file ~/.tmux.conf \; display-message "source-file done"
  25. # All sorts of Vi-type bindings
  26. # https://github.com/justone/dotfiles/blob/personal/.tmux.shared#L3
  27. # VI for switching between
  28. bind-key h select-pane -L
  29. bind-key j select-pane -D
  30. bind-key k select-pane -U
  31. bind-key l select-pane -R
  32. # keybindings to make resizing easier
  33. bind-key -r C-h resize-pane -L
  34. bind-key -r C-j resize-pane -D
  35. bind-key -r C-k resize-pane -U
  36. bind-key -r C-l resize-pane -R
  37. bind-key | resize-pane -Z \; display-message "Zoom zoom zoom"
  38. # Pane movement
  39. bind-key J command-prompt -p "join pane from:" "join-pane -s '%%'"
  40. bind-key B command-prompt -p "break pane to:" "break-pane -t '%%'"
  41. bind-key M-k move-pane -t ':+'
  42. bind-key M-j move-pane -t ':-'
  43. # Vi copy and paste in tmux
  44. # http://joncairns.com/2013/06/copying-between-tmux-buffers-and-the-system-clipboard/
  45. bind-key Escape copy-mode
  46. # bind-key -T vi-mode-copy 'v' send -X begin-selection
  47. # bind-key -T vi-mode-copy 'y' send -X copy-selection
  48. bind-key -T copy-mode-vi 'v' send -X begin-selection
  49. bind-key -T copy-mode-vi 'y' send -X copy-selection
  50. # }}}
  51. # System Specific {{{
  52. if-shell 'test "$(uname -s)" = "Darwin"' 'bind-key y run-shell "tmux show-buffer | pbcopy" \; display-message "Copied tmux buffer to system clipboard"'
  53. if-shell 'test "$(uname -s)" = "Linux"' 'bind-key y run-shell "tmux show-buffer | xsel -pi" \; display-message "Copied tmux buffer to system clipboard"'
  54. # only if this is the first level of inception do that fancy status bar
  55. if-shell '[ -z "$SSH_CONNECTION" ]' 'source "$HOME/.tmux-local.conf"' 'source "$HOME/.tmux-inception.conf"'
  56. #dumb osx
  57. if-shell 'test "$(uname)" = "Darwin"' 'source "$HOME/.tmux-osx.conf"'
  58. # }}}