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.

148 lines
4.4 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. bind-key , command-prompt "rename-session '%%'"
  14. bind-key -n M-d detach
  15. bind-key -n M-c copy-mode
  16. bind v split-window -v
  17. is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
  18. | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
  19. bind -T copy-mode-vi y send-keys -X copy-pipe-and-cancel 'xclip -in -selection clipboard'
  20. # }}} #
  21. # panes {{{ #
  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. bind-key -n M-Enter split-window -h
  33. # bind-key -n M-v split-window -h
  34. bind-key -n M-q kill-pane
  35. # }}} panes #
  36. # windows {{{ #
  37. bind-key -n M-w new-window
  38. bind x kill-window
  39. bind-key -n M-a command-prompt "rename-window '%%'"
  40. # bind-key , command-prompt "rename-window '%%'"
  41. bind-key -n M-p previous-window
  42. bind-key -n M-n next-window
  43. bind-key -n C-Left swap-window -t -1
  44. bind-key -n C-Right swap-window -t +1
  45. # }}} windows #
  46. # status bar {{{ #
  47. #
  48. # Powerline Double Cyan - Tmux Theme
  49. # Created by Jim Myhrberg <contact@jimeh.me>.
  50. #
  51. # Inspired by vim-powerline: https://github.com/Lokaltog/powerline
  52. #
  53. # Requires terminal to be using a powerline compatible font, find one here:
  54. # https://github.com/Lokaltog/powerline-fonts
  55. #
  56. # Status update interval
  57. set -g status-interval 60
  58. # Basic status bar colors
  59. set -g status-style fg=colour240,bg=colour233
  60. # Left side of status bar{{{
  61. set -g status-left-style bg=colour233,fg=colour243
  62. set -g status-left-length 40
  63. # 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]"
  64. # set -g status-left "#[fg=colour233,bg=colour39,bold] #S:#P #[fg=colour39,bg=colour233,nobold]"
  65. set -g status-left "#[fg=colour233,bg=colour240] #S #[fg=colour240,bg=colour235] #P #[fg=colour235,bg=colour233]"
  66. # }}}
  67. # Right side of status bar{{{
  68. set -g status-right-style bg=colour233,fg=colour243
  69. set -g status-right-length 150
  70. # 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 "
  71. 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]"
  72. # }}}
  73. # Window status
  74. set -g window-status-format " #I:#W#F "
  75. set -g window-status-current-format "#[fg=colour233,bg=black]#[fg=colour81,nobold] #I:#W#F #[fg=colour233,bg=black,nobold]"
  76. # Current window status
  77. set -g window-status-current-style bg=colour39,fg=colour235
  78. # Window with activity status
  79. set -g window-status-activity-style bg=colour233,fg=colour245
  80. # Window separator
  81. set -g window-status-separator ""
  82. # Window status alignment
  83. set -g status-justify centre
  84. # Pane border
  85. set -g pane-border-style bg=default,fg=colour238
  86. # Active pane border
  87. set -g pane-active-border-style bg=default,fg=colour39
  88. # Pane number indicator
  89. set -g display-panes-colour colour233
  90. set -g display-panes-active-colour colour245
  91. # Clock mode
  92. set -g clock-mode-colour colour39
  93. set -g clock-mode-style 24
  94. # Message
  95. set -g message-style bg=colour39,fg=black
  96. # Command message
  97. set -g message-command-style bg=colour233,fg=black
  98. # Mode
  99. set -g mode-style bg=colour39,fg=colour232
  100. # }}} status bar #
  101. # plugins {{{
  102. set -g @plugin 'tmux-plugins/tpm'
  103. set -g @plugin 'tmux-plugins/tmux-sensible'
  104. # set -g @plugin 'jimeh/tmux-themepack'
  105. # set -g @themepack 'powerline/double/blue'
  106. set -g @plugin 'christoomey/vim-tmux-navigator'
  107. run -b '~/.tmux/plugins/tpm/tpm'
  108. # }}} plugins #