Another copy of my dotfiles. Because I don't completely trust GitHub.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

117 lines
3.3 KiB

4 years ago
  1. # Bind escape to copy mode
  2. unbind [
  3. bind Escape copy-mode
  4. # p = paste
  5. unbind p
  6. bind p paste-buffer
  7. # no escape delay
  8. set -sg escape-time 0
  9. # remap prefix to Control + a
  10. set -g prefix C-a
  11. unbind C-b
  12. bind C-a send-prefix
  13. # Start window numbering at 1 (default => 0)
  14. set -g base-index 1
  15. set -g clock-mode-style 12
  16. # Renumber windows after removing one
  17. set -g renumber-windows on
  18. # use 256 colors
  19. # set -g default-terminal 'tmux-256color-italic'
  20. set-option -ga terminal-overrides ",xterm-256color-italic:Tc"
  21. # set -g default-terminal "tmux-256color-italic"
  22. # change tmux bar colors
  23. set -g status-bg '#B388FF'
  24. set -g status-fg '#EEEEEE'
  25. # Keep plenty of history for scrollback
  26. set -g history-limit 50000
  27. # mouse
  28. set -g mouse on
  29. # Act like vim in copy mode
  30. set -g status-keys vi
  31. setw -g mode-keys vi
  32. bind-key -Tcopy-mode-vi 'v' send -X begin-selection
  33. # Smart pane switching with awareness of Vim splits.
  34. # See: https://github.com/christoomey/vim-tmux-navigator
  35. is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
  36. | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
  37. bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
  38. bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
  39. bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
  40. bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
  41. bind-key -n C-\\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
  42. # Secondary binding for C-l to retain redraw
  43. bind C-l send-keys 'C-l'
  44. # Easy rotating of panes
  45. bind C-k swap-pane -U
  46. # increase display time
  47. set -g display-panes-time 1200
  48. # status bar stuff
  49. set -g status-left-length 40
  50. # Simplify status bar display.
  51. set -g status-left '[#S]'
  52. set -g status-right "%I:%M %p "
  53. # set -g status-right "#[fg=red][44%%]#[default] - %I:%M %p "
  54. # Dismiss current pane to background window
  55. bind b break-pane -d
  56. bind-key j command-prompt -p "join pane from: " "join-pane -h -s '%%'"
  57. # more intuitive keybindings for splitting
  58. bind \\ split-window -h -c "#{pane_current_path}"
  59. bind - split-window -v -c "#{pane_current_path}"
  60. # Easy return to Vim from tmux runner zoom runner pane
  61. bind C-p run "(tmux display-message -p '#{pane_current_command}' | grep -iqE '(^|\/)vim$' && tmux send-keys ':VtrZoomRunnerPane' 'C-m') || tmux send-keys 'C-c' && tmux select-pane -l"
  62. # Make C-j display a selectable list of sessions
  63. bind C-j choose-tree
  64. # Keep window names as I set them
  65. setw -g automatic-rename off
  66. # Reload tmux.conf with prefix-r
  67. bind C-r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf"
  68. # Provide access to the clipboard for pbpaste, pbcopy (details: http://goo.gl/DN82E)
  69. set-window-option -g automatic-rename on
  70. # Enable VI mode
  71. set-window-option -g mode-keys vi
  72. # Set ability to capture on start and restore on exit window data when running an application
  73. setw -g alternate-screen on
  74. # bind resizing of panes to H,J,K,L (resizes by steps of 10 lines/columns)
  75. # # Note, bindings are repeatable (within the default 500ms time limit) so that
  76. # # you don't have to keep entering the prefix. (Prefix-H-H-H resizes by 15)
  77. bind -n S-Left resize-pane -L 2
  78. bind -n S-Right resize-pane -R 2
  79. bind -n S-Down resize-pane -D 1
  80. bind -n S-Up resize-pane -U 1
  81. unbind -n C-Left
  82. unbind -n C-Down
  83. unbind -n C-Up
  84. unbind -n C-Right
  85. bind -n C-Left resize-pane -L 10
  86. bind -n C-Right resize-pane -R 10
  87. bind -n C-Down resize-pane -D 5
  88. bind -n C-Up resize-pane -U 5