tmux.conf 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. ##### My (demuredemeanor) tmux config, a work in progress
  2. # Uses tabstop=4; shiftwidth=4 tabs; foldmarker={{{,}}};
  3. # https://notabug.org/demure/dotfiles/
  4. # legacy repo http://github.com/demure/dotfiles
  5. #
  6. # Note to self: set=set-option; setw=set-window-option; setenv=set-environment;
  7. ### Main Settings ### {{{
  8. ## Fix glitch with underlined text in Terminal.app and hanging Prompt (iOS)
  9. ## From https://github.com/terlar/dotfiles/blob/master/tmux.conf
  10. ## Assume http://sourceforge.net/mailarchive/message.php?msg_id=30825085 is origin
  11. set -ag terminal-overrides ",*:XT@"
  12. new-session # tmux attach makes new, if not running
  13. set -ga update-environment 'DISPLAY' # Maybe fix DISPLAY?
  14. set -g base-index 1 # Window numbering starts at 1
  15. set -g pane-base-index 1 # Pane numbering starts at 1
  16. setw -g automatic-rename on # Auto set window title
  17. setw -g aggressive-resize on # Aggressive windows: For screen size, of diff connections, on diff windows
  18. set -g default-terminal "screen-256color"
  19. set -g history-limit 10000 # Scroll back history
  20. set -g display-panes-time 4000 # Increase show pane time
  21. set -g renumber-windows on # Make windows auto renumber
  22. set -g lock-command vlock # Use vlock as console lock
  23. ### End Main Settings ### }}}
  24. ### Key Bindings ### {{{
  25. unbind C-z # Unbind C-z so I don't suspend, and free for bind
  26. #unbind C-b # Unbind C-b, so I can make C-z the prefix
  27. set -g prefix C-z # Change prefix key to C-z
  28. bind-key C-z last-window # Make <prefix>C-z go to last window
  29. #unbind C-a
  30. bind-key C-a send-prefix # Make <prefix>C-a send C-z literally
  31. ## Join windows: <prefix> s, <prefix> j
  32. bind-key j command-prompt -p "join pane from:" "join-pane -s '%%'"
  33. bind-key s command-prompt -p "send pane to:" "join-pane -t '%%'"
  34. ## URL grab: <prefix> u
  35. bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; new-window -n "urlview" '$SHELL -c "urlview < /tmp/tmux-buffer"'
  36. ## Reload tmux.conf: <prefix> R
  37. bind R source-file ~/.tmux.conf \; display-message "Config reloaded..."
  38. ## Lock screen
  39. bind-key -T prefix X confirm-before -p "lock tmux? (y/n)" lock-session
  40. ### Better Bindings for Splitting ### {{{
  41. bind h split-window -h
  42. bind v split-window -v
  43. ### End Splitting Bindings ### }}}
  44. ## Mouse
  45. set -g mouse on
  46. ### vi Mode for Scroll Back ### {{{
  47. setw -g mode-keys vi
  48. #unbind [
  49. bind Escape copy-mode
  50. unbind p
  51. bind p paste-buffer
  52. bind-key -t vi-copy 'v' begin-selection
  53. bind-key -t vi-copy 'y' copy-selection
  54. bind-key -t vi-copy Escape cancel
  55. bind-key -t vi-copy 'Y' copy-end-of-line
  56. bind-key -t vi-copy 'V' select-line
  57. ### End vi Mode ### }}}
  58. ### Move Window Numbers ### {{{
  59. ## <prefix> Shift left/right
  60. # Inspired by https://superuser.com/questions/343572/how-do-i-reorder-tmux-windows
  61. bind-key S-Left swap-window -t -1
  62. bind-key S-Right swap-window -t +1
  63. ### End Window Numbers ### }}}
  64. ### End Key Bindings ### }}}
  65. ### Theming Settings ### {{{
  66. ## Terminal emulator window title
  67. set -g set-titles on
  68. set -g set-titles-string '#S:#I.#P #W'
  69. ## Notifying if other windows has activities
  70. setw -g monitor-activity on
  71. set -g visual-activity on
  72. ## Clock
  73. setw -g clock-mode-colour green
  74. setw -g clock-mode-style 24
  75. ## Inactive windows
  76. setw -g window-status-format '#[fg=cyan,dim]#I#[fg=blue]:#[default]#W#[fg=grey,dim]#F'
  77. ### Status Bar ### {{{
  78. set -g status-bg black
  79. set -g status-fg white
  80. set -g status-interval 1
  81. set -g status-left '#[fg=green]#H#[default]'
  82. set -g status-right '#[fg=cyan,bold]%Y-%m-%d %H:%M#[default]'
  83. ### Bar Current ### {{{
  84. ## Highlighting the active window in status bar
  85. #setw -g window-status-current-bg blue
  86. setw -g window-status-current-format '#[bg=blue,fg=cyan,bold]#I#[bg=blue,fg=cyan]:#[fg=white]#W#[fg=dim]#F'
  87. ### End Current ### }}}
  88. ### Bar Last ### {{{
  89. #setw -g window-status-last-attr attributes
  90. #setw -g window-status-last-bg color
  91. #setw -g window-status-last-fg color
  92. ### End Last ### }}}
  93. ### End Status Bar ### }}}
  94. ### Message/Message Command ### {{{
  95. set -g message-attr bright
  96. set -g message-bg cyan
  97. set -g message-fg white
  98. set -g message-command-attr bright
  99. set -g message-command-bg cyan
  100. set -g message-command-fg white
  101. ### End Message ### }}}
  102. ### Pane Colors ### {{{
  103. set -g pane-border-fg cyan
  104. set -g pane-active-border-fg cyan
  105. ### End Pane Colors ### }}}
  106. ### End Theming Settings ### }}}