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.

167 lines
5.0 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. # Bind escape to copy mode
  2. unbind [
  3. bind v 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. # Set the thumbs key to f, I don't use find-window anyways
  19. unbind f
  20. set -g @thumbs-key f
  21. # use 256 colors
  22. set -g default-terminal "tmux-256color"
  23. set -ag terminal-overrides ",xterm-256color:RGB"
  24. # Keep plenty of history for scrollback
  25. set -g history-limit 50000
  26. # mouse
  27. set -g mouse on
  28. # Act like vim in copy mode
  29. set -g status-keys vi
  30. setw -g mode-keys vi
  31. set -g set-clipboard on
  32. set -ag terminal-overrides "vte*:XT:Ms=\\E]52;c;%p2%s\\7,xterm*:XT:Ms=\\E]52;c;%p2%s\\7"
  33. bind-key -Tcopy-mode-vi 'v' send -X begin-selection
  34. bind-key -Tcopy-mode-vi 'y' send -X copy-selection
  35. # Smart pane switching with awareness of Vim splits.
  36. # See: https://github.com/christoomey/vim-tmux-navigator
  37. is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
  38. | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
  39. bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
  40. bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
  41. bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
  42. bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
  43. bind-key -n C-\\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
  44. # Secondary binding for C-l to retain redraw
  45. bind C-l send-keys 'C-l'
  46. # Easy rotating of panes
  47. bind C-k swap-pane -U
  48. # increase display time
  49. set -g display-panes-time 1200
  50. # status bar stuff
  51. set -g status-left-length 40
  52. # Dismiss current pane to background window
  53. bind b break-pane -d
  54. bind-key j command-prompt -p "join pane from: " "join-pane -h -s '%%'"
  55. set -g default-command zsh
  56. # more intuitive keybindings for splitting
  57. bind \\ split-window -h -c "#{pane_current_path}"
  58. bind - split-window -v -c "#{pane_current_path}"
  59. # Easy return to Vim from tmux runner zoom runner pane
  60. 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"
  61. # Make C-j display a selectable list of sessions
  62. bind C-j choose-tree
  63. # Keep window names as I set them
  64. setw -g automatic-rename off
  65. # Reload tmux.conf with prefix-r
  66. bind C-r source-file ~/.config/tmux/tmux.conf \; display "Reloaded ~/.config/tmux/tmux.conf"
  67. # Provide access to the clipboard for pbpaste, pbcopy (details: http://goo.gl/DN82E)
  68. set-window-option -g automatic-rename on
  69. # Enable VI mode
  70. set-window-option -g mode-keys vi
  71. # Set ability to capture on start and restore on exit window data when running an application
  72. setw -g alternate-screen on
  73. # bind resizing of panes to H,J,K,L (resizes by steps of 10 lines/columns)
  74. # # Note, bindings are repeatable (within the default 500ms time limit) so that
  75. # # you don't have to keep entering the prefix. (Prefix-H-H-H resizes by 15)
  76. bind -n S-Left resize-pane -L 2
  77. bind -n S-Right resize-pane -R 2
  78. bind -n S-Down resize-pane -D 1
  79. bind -n S-Up resize-pane -U 1
  80. unbind -n C-Left
  81. unbind -n C-Down
  82. unbind -n C-Up
  83. unbind -n C-Right
  84. bind -n C-Left resize-pane -L 10
  85. bind -n C-Right resize-pane -R 10
  86. bind -n C-Down resize-pane -D 5
  87. bind -n C-Up resize-pane -U 5
  88. unbind %
  89. unbind '"'
  90. # Split panes
  91. bind | split-window -h -c "#{pane_current_path}"
  92. bind _ split-window -v -c "#{pane_current_path}"
  93. bind-key "\\" split-window -fh -c "#{pane_current_path}"
  94. bind-key "_" split-window -fv -c "#{pane_current_path}"
  95. # Disable status bar for weechat sessions
  96. set-hook -g session-created 'if -F "#{==:#{session_name},weechat}" "set status off" "set status on"'
  97. set-hook -g session-created 'if -F "#{==:#{session_name},weechat}" "set status off" "set status on"'
  98. # Plugins
  99. set -g @plugin 'tmux-plugins/tpm'
  100. set -g @plugin 'tmux-plugins/tmux-sensible'
  101. set -g @plugin 'tmux-plugins/tmux-resurrect'
  102. set -g @plugin 'fcsonline/tmux-thumbs'
  103. set -g @plugin 'wfxr/tmux-fzf-url'
  104. set -g @plugin 'tmux-plugins/tmux-yank'
  105. set -g @plugin 'wfxr/tmux-power'
  106. set -g @plugin 'wfxr/tmux-web-reachable'
  107. set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
  108. set -g @plugin 'wfxr/tmux-net-speed'
  109. set -as terminal-overrides ',*:indn@' # This fixes the clear bug on tmate
  110. # status bar theme
  111. set -g status-bg 'colour235'
  112. set -g status-justify 'centre'
  113. set -g status-left-length '100'
  114. set -g status 'on'
  115. set -g status-right-length '100'
  116. # Capture contents on tmux-ressurect save
  117. set -g @resurrect-capture-pane-contents 'on'
  118. # tmux-power config
  119. set -g @tmux_power_theme 'sky'
  120. set -g @tmux_power_show_upload_speed true
  121. set -g @tmux_power_show_download_speed true
  122. set -g @tmux_power_prefix_highlight_pos 'L'
  123. set -g @tmux_power_show_web_reachable true
  124. if "test ! -d ~/.local/share/tmux/plugins/tpm" \
  125. "run 'git clone https://github.com/tmux-plugins/tpm ~/.local/share/tmux/plugins/tpm && ~/.local/share/tmux/plugins/tpm/bin/install_plugins'"
  126. run -b '~/.local/share/tmux/plugins/tpm/tpm'