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.

187 lines
5.3 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. set -s escape-time 0
  11. unbind '"'
  12. unbind %
  13. is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
  14. | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
  15. bind v split-window -v
  16. # ]]] #
  17. {{ if .gui }}# [[[
  18. bind-key , command-prompt "rename-session '%%'"
  19. bind-key -n M-d detach
  20. # panes [[[ #
  21. bind-key -n M-h if-shell "$is_vim" "send-keys M-h" "select-pane -L"
  22. bind-key -n M-j if-shell "$is_vim" "send-keys M-j" "select-pane -D"
  23. bind-key -n M-k if-shell "$is_vim" "send-keys M-k" "select-pane -U"
  24. bind-key -n M-l if-shell "$is_vim" "send-keys M-l" "select-pane -R"
  25. bind-key -n M-\ if-shell "$is_vim" "send-keys M-\\" "select-pane -l"
  26. bind-key -T copy-mode-vi M-h select-pane -L
  27. bind-key -T copy-mode-vi M-j select-pane -D
  28. bind-key -T copy-mode-vi M-k select-pane -U
  29. bind-key -T copy-mode-vi M-l select-pane -R
  30. bind-key -T copy-mode-vi M-\ select-pane -l
  31. bind-key -n M-Enter split-window -h
  32. # bind-key -n M-v split-window -h
  33. bind-key -n M-q kill-pane
  34. # ]]] panes #
  35. # windows [[[ #
  36. bind-key -n M-w new-window
  37. bind x kill-window
  38. bind-key -n M-a command-prompt "rename-window '%%'"
  39. # bind-key , command-prompt "rename-window '%%'"
  40. bind-key -n M-p previous-window
  41. bind-key -n M-n next-window
  42. bind-key -n C-S-[ swap-window -t -1
  43. bind-key -n C-S-] swap-window -t +1
  44. # ]]] windows #
  45. bind-key -n M-c copy-mode
  46. # ]]]
  47. {{ else }}# [[[
  48. # panes [[[ #
  49. bind-key -n C-Left if-shell "$is_vim" "send-keys C-Left" "select-pane -L"
  50. bind-key -n C-Down if-shell "$is_vim" "send-keys C-Down" "select-pane -D"
  51. bind-key -n C-Up if-shell "$is_vim" "send-keys C-Up" "select-pane -U"
  52. bind-key -n C-Right if-shell "$is_vim" "send-keys C-Right" "select-pane -R"
  53. bind-key -n C-\ if-shell "$is_vim" "send-keys C-\\" "select-pane -l"
  54. bind-key -T copy-mode-vi C-Left select-pane -L
  55. bind-key -T copy-mode-vi C-Down select-pane -D
  56. bind-key -T copy-mode-vi C-Up select-pane -U
  57. bind-key -T copy-mode-vi C-Right select-pane -R
  58. bind-key -T copy-mode-vi C-\ select-pane -l
  59. # switch panes using Alt-arrow without prefix
  60. # bind -n C-Down select-pane -D
  61. # bind -n C-Up select-pane -U
  62. # bind -n C-Left select-pane -L
  63. # bind -n C-l select-pane -R
  64. bind h split-window -h
  65. bind-key x kill-pane
  66. # ]]] panes #
  67. bind-key -n C-Left previous-window
  68. bind-key -n C-Right next-window
  69. bind-key & kill-window
  70. {{ end }}# ]]]
  71. # status bar [[[ #
  72. #
  73. # Powerline Double Cyan - Tmux Theme
  74. # Created by Jim Myhrberg <contact@jimeh.me>.
  75. #
  76. # Inspired by vim-powerline: https://github.com/Lokaltog/powerline
  77. #
  78. # Requires terminal to be using a powerline compatible font, find one here:
  79. # https://github.com/Lokaltog/powerline-fonts
  80. #
  81. # Status update interval
  82. set -g status-interval 60
  83. # Basic status bar colors
  84. set -g status-style fg=colour240,bg=colour233
  85. # Left side of status bar[[[
  86. set -g status-left-style bg=colour233,fg=colour243
  87. set -g status-left-length 40
  88. # set -g status-left "#[fg=colour233,bg=colour39,bold] #S #[fg=colour39,bg=colour240,nobold]#[fg=colour233,bg=colour240] #(whoami) #[fg=colour240,bg=colour235]#[fg=colour240,bg=colour235] #I:#P #[fg=colour235,bg=colour233,nobold]"
  89. # set -g status-left "#[fg=colour233,bg=colour39,bold] #S:#P #[fg=colour39,bg=colour233,nobold]"
  90. set -g status-left "#[fg=colour233,bg=colour240] #S #[fg=colour240,bg=colour235] #P #[fg=colour235,bg=colour233]"
  91. # ]]]
  92. # Right side of status bar[[[
  93. set -g status-right-style bg=colour233,fg=colour243
  94. set -g status-right-length 150
  95. # set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %d-%b-%y #[fg=colour39,bg=colour240]#[fg=colour233,bg=colour39,bold] #H "
  96. set -g status-right "#[fg=colour235,bg=colour233]#[fg=colour240,bg=colour235] %H:%M #[fg=colour240,bg=colour235]#[fg=colour233,bg=colour240] %a-%d-%m #[fg=colour39,bg=colour240]"
  97. # ]]]
  98. # Window status
  99. set -g window-status-format " #I:#W#F "
  100. set -g window-status-current-format "#[fg=colour233,bg=black]#[fg=colour81,nobold] #I:#W#F #[fg=colour233,bg=black,nobold]"
  101. # Current window status
  102. set -g window-status-current-style bg=colour39,fg=colour235
  103. # Window with activity status
  104. set -g window-status-activity-style bg=colour233,fg=colour245
  105. # Window separator
  106. set -g window-status-separator ""
  107. # Window status alignment
  108. set -g status-justify centre
  109. # Pane border
  110. set -g pane-border-style bg=default,fg=colour238
  111. # Active pane border
  112. set -g pane-active-border-style bg=default,fg=colour39
  113. # Pane number indicator
  114. set -g display-panes-colour colour233
  115. set -g display-panes-active-colour colour245
  116. # Clock mode
  117. set -g clock-mode-colour colour39
  118. set -g clock-mode-style 24
  119. # Message
  120. set -g message-style bg=colour39,fg=black
  121. # Command message
  122. set -g message-command-style bg=colour233,fg=black
  123. # Mode
  124. set -g mode-style bg=colour39,fg=colour232
  125. # ]]] status bar #
  126. # plugins [[[
  127. set -g @plugin 'tmux-plugins/tpm'
  128. set -g @plugin 'tmux-plugins/tmux-sensible'
  129. # set -g @plugin 'jimeh/tmux-themepack'
  130. # set -g @themepack 'powerline/double/blue'
  131. set -g @plugin 'christoomey/vim-tmux-navigator'
  132. run -b '~/.tmux/plugins/tpm/tpm'
  133. # ]]] plugins #
  134. # vim: fdm=marker ft=tmux.go-template