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.

151 lines
4.5 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 m select-pane -m
  35. bind-key j join-pane \; select-layout main-vertical
  36. bind-key -n M-q kill-pane
  37. # }}} panes #
  38. # windows {{{ #
  39. bind-key -n M-w new-window
  40. bind x kill-window
  41. bind-key -n M-a command-prompt "rename-window '%%'"
  42. # bind-key , command-prompt "rename-window '%%'"
  43. bind-key -n M-p previous-window
  44. bind-key -n M-n next-window
  45. bind-key -n C-Left swap-window -t -1
  46. bind-key -n C-Right swap-window -t +1
  47. # }}} windows #
  48. # status bar {{{ #
  49. #
  50. # Powerline Double Cyan - Tmux Theme
  51. # Created by Jim Myhrberg <contact@jimeh.me>.
  52. #
  53. # Inspired by vim-powerline: https://github.com/Lokaltog/powerline
  54. #
  55. # Requires terminal to be using a powerline compatible font, find one here:
  56. # https://github.com/Lokaltog/powerline-fonts
  57. #
  58. # Status update interval
  59. set -g status-interval 60
  60. # Basic status bar colors
  61. set -g status-style fg=colour240,bg=colour233
  62. # Left side of status bar{{{
  63. set -g status-left-style bg=colour233,fg=colour243
  64. set -g status-left-length 40
  65. # 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]"
  66. # set -g status-left "#[fg=colour233,bg=colour39,bold] #S:#P #[fg=colour39,bg=colour233,nobold]"
  67. set -g status-left "#[fg=colour233,bg=colour240] #S #[fg=colour240,bg=colour235] #P #[fg=colour235,bg=colour233]"
  68. # }}}
  69. # Right side of status bar{{{
  70. set -g status-right-style bg=colour233,fg=colour243
  71. set -g status-right-length 150
  72. # 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 "
  73. 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]"
  74. # }}}
  75. # Window status
  76. set -g window-status-format " #I:#W#F "
  77. set -g window-status-current-format "#[fg=colour233,bg=black]#[fg=colour81,nobold] #I:#W#F #[fg=colour233,bg=black,nobold]"
  78. # Current window status
  79. set -g window-status-current-style bg=colour39,fg=colour235
  80. # Window with activity status
  81. set -g window-status-activity-style bg=colour233,fg=colour245
  82. # Window separator
  83. set -g window-status-separator ""
  84. # Window status alignment
  85. set -g status-justify centre
  86. # Pane border
  87. set -g pane-border-style bg=default,fg=colour238
  88. # Active pane border
  89. set -g pane-active-border-style bg=default,fg=colour39
  90. # Pane number indicator
  91. set -g display-panes-colour colour233
  92. set -g display-panes-active-colour colour245
  93. # Clock mode
  94. set -g clock-mode-colour colour39
  95. set -g clock-mode-style 24
  96. # Message
  97. set -g message-style bg=colour39,fg=black
  98. # Command message
  99. set -g message-command-style bg=colour233,fg=black
  100. # Mode
  101. set -g mode-style bg=colour39,fg=colour232
  102. # }}} status bar #
  103. # plugins {{{
  104. set -g @plugin 'tmux-plugins/tpm'
  105. set -g @plugin 'tmux-plugins/tmux-sensible'
  106. # set -g @plugin 'jimeh/tmux-themepack'
  107. # set -g @themepack 'powerline/double/blue'
  108. set -g @plugin 'christoomey/vim-tmux-navigator'
  109. run -b '~/.tmux/plugins/tpm/tpm'
  110. # }}} plugins #