Dotfiles for my tiling window manager + terminal workflow.
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.

78 lines
2.2 KiB

  1. # basic [[[
  2. # reload config file (change file location to your the tmux.conf you want to use)
  3. bind r source-file ~/.tmux.conf
  4. # prefix
  5. unbind C-b
  6. set-option -g prefix C-Space
  7. bind-key C-Space send-prefix
  8. # Enable mouse mode (tmux 2.1 and above)
  9. set -g mouse on
  10. # clear rename prompt
  11. bind-key , command-prompt "rename-window '%%'"
  12. # ]]] #
  13. # panes[[[
  14. bind h split-window -h
  15. bind v split-window -v
  16. unbind '"'
  17. unbind %
  18. # vim-tmux-navigator[[[
  19. is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
  20. | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
  21. {{ if .gui }}
  22. bind-key -n M-h if-shell "$is_vim" "send-keys M-h" "select-pane -L"
  23. bind-key -n M-j if-shell "$is_vim" "send-keys M-j" "select-pane -D"
  24. bind-key -n M-k if-shell "$is_vim" "send-keys M-k" "select-pane -U"
  25. bind-key -n M-l if-shell "$is_vim" "send-keys M-l" "select-pane -R"
  26. bind-key -n M-\ if-shell "$is_vim" "send-keys M-\\" "select-pane -l"
  27. bind-key -T copy-mode-vi M-h select-pane -L
  28. bind-key -T copy-mode-vi M-j select-pane -D
  29. bind-key -T copy-mode-vi M-k select-pane -U
  30. bind-key -T copy-mode-vi M-l select-pane -R
  31. bind-key -T copy-mode-vi M-\ select-pane -l
  32. {{ else }}
  33. bind-key -n C-Left if-shell "$is_vim" "send-keys C-Left" "select-pane -L"
  34. bind-key -n C-Down if-shell "$is_vim" "send-keys C-Down" "select-pane -D"
  35. bind-key -n C-Up if-shell "$is_vim" "send-keys C-Up" "select-pane -U"
  36. bind-key -n C-Right if-shell "$is_vim" "send-keys C-Right" "select-pane -R"
  37. bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
  38. bind-key -T copy-mode-vi C-Left select-pane -L
  39. bind-key -T copy-mode-vi C-Down select-pane -D
  40. bind-key -T copy-mode-vi C-Up select-pane -U
  41. bind-key -T copy-mode-vi C-Right select-pane -R
  42. bind-key -T copy-mode-vi C-\ select-pane -l
  43. {{ end }}
  44. # ]]]
  45. # kill panes without confirmation
  46. bind-key x kill-pane
  47. bind-key & kill-window
  48. # switch panes using Alt-arrow without prefix
  49. # bind -n C-Down select-pane -D
  50. # bind -n C-Up select-pane -U
  51. # bind -n C-Left select-pane -L
  52. # bind -n C-l select-pane -R
  53. # ]]]
  54. # plugins [[[
  55. set -g @plugin 'tmux-plugins/tpm'
  56. set -g @plugin 'tmux-plugins/tmux-sensible'
  57. set -g @plugin 'jimeh/tmux-themepack'
  58. set -g @themepack 'powerline/double/blue'
  59. set -g @plugin 'christoomey/vim-tmux-navigator'
  60. run -b '~/.tmux/plugins/tpm/tpm'
  61. # ]]] plugins #