.tmux.conf 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. #redefine existing well-known key bidings by changing the starting path
  2. bind -N "Create a new window (starting with the current pane path)" c new-window -c "#{pane_current_path}"
  3. #bind -N "Split window vertically (starting with the current pane path)" " split-window -v -c '#{pane_current_path}'
  4. #bind -N "Split window horizontally (starting with the current pane path)" % split-window -h -c '#{pane_current_path}'
  5. # switch panes using Alt-arrow without prefix
  6. #bind -n M-Left select-pane -L
  7. #bind -n M-Right select-pane -R
  8. #bind -n M-Up select-pane -U
  9. #bind -n M-Down select-pane -D
  10. # Enable mouse mode (tmux 2.1 and above)
  11. set -g mouse on
  12. bind -N "Change to copy mode" Escape copy-mode
  13. bind -N "Paste the buffer" P paste-buffer
  14. bind-key -T copy-mode-vi v send-keys -X begin-selection
  15. bind-key -T copy-mode-vi y send-keys -X copy-selection
  16. bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
  17. bind -N "Save the content of the buffer into the clipboard" C-c run "tmux save-buffer - | xsel -bpi"
  18. set-option -g history-limit 100000
  19. set-option -g renumber-windows on
  20. set -g default-terminal "tmux-256color"
  21. #set -g utf8 on
  22. # hack pour profiter du scroll du terminal (xterm ...)
  23. set -g terminal-overrides 'xterm*:smcup@:rmcup@'
  24. ##fix dirty bug of end/home note working vm/tmux
  25. #bind-key -n Home send Escape "OH"
  26. #bind-key -n End send Escape "OF"
  27. # Redraw the client (if interrupted by wall, etc.)
  28. bind -N "Redraw the client (if interrupted by wall, etc.)" R refresh-client
  29. # reload tmux config with ctrl + b + r
  30. unbind r
  31. bind -N "Reload tmux configuration" r source-file ~/.tmux.conf \; display-message 'Reloaded tmux config.'
  32. # quick-pane configuration: htop
  33. bind-key -N "Quick-pane: htop" h split-window -h "htop"
  34. #open tmux configuration in a side pane
  35. bind -N "Open tmux configuration in a side pane" M split-window -h "vim ~/.tmux.conf"
  36. #???
  37. #bind-key ! break-pane -d -n _hidden_pane
  38. #bind-key @ join-pane -s $.0
  39. ## Join windows: <prefix> s, <prefix> j
  40. bind-key -N "Join a pane from another session/window" j command-prompt -p "join pane from:" "join-pane -s '%%'"
  41. bind-key -N "Send a pane to another session/window" e command-prompt -p "send pane to:" "join-pane -t '%%'"
  42. #format: mysession:mywindow.mypane
  43. # Visual Activity Monitoring between windows
  44. setw -g monitor-activity off
  45. set -g visual-activity on
  46. #set -g visual-bell on
  47. # Automatically set window title
  48. #setw -g automatic-rename
  49. # Show tmux positions in titles
  50. set -g set-titles on
  51. set -g set-titles-string "[#S>#I:#W]"
  52. # Copy from tmux to system clipboard
  53. # Needs xclip -> emerge xclip
  54. #bind -t vi-copy y copy-pipe "xclip -sel clip -i"
  55. # initialize sessions
  56. #bind S source-file ~/.tmux/IMTA
  57. # ===============
  58. # Apparence and status bar
  59. # window segments in status line
  60. set -g window-status-separator ""
  61. #separator_powerline_left=""
  62. #separator_powerline_right=""
  63. separator_powerline_left="←"
  64. separator_powerline_right="→"
  65. setw -g window-status-format " #I:#W "
  66. setw -g window-status-current-format "$separator_powerline_right#I:#W$separator_powerline_left"
  67. # general status bar settings
  68. set -g status on
  69. set -g status-interval 5
  70. set -g status-position bottom
  71. set -g status-justify left
  72. set -g status-right-length 100
  73. # define widgets we're going to use in status bar
  74. wg_session="#S"
  75. wg_date="%Y-%m-%d %H:%M"
  76. wg_user_host="#(whoami)@#H"
  77. wg_battery="#(~/install/Battery/battery -t -g black)"
  78. set -g status-left "$wg_session"
  79. #set -g status-right "$wg_user_host | $wg_date $wg_battery"
  80. set -g status-right "$wg_user_host $wg_battery$wg_date"
  81. # Drag windows on the status bar
  82. bind-key -n MouseDrag1Status swap-window -d -t=
  83. # List of plugins
  84. set -g @plugin 'tmux-plugins/tpm'
  85. set -g @plugin 'tmux-plugins/tmux-sensible'
  86. set -g @plugin 'tmux-plugins/tmux-resurrect'
  87. set -g @plugin 'tmux-plugins/tmux-continuum'
  88. set -g @plugin 'tmux-plugins/tmux-open'
  89. #####
  90. # pre-defined themes
  91. # Tokyo theme:
  92. #set -g @plugin 'fabioluciano/tmux-tokyo-night'
  93. ## Tokyo Night Theme configuration
  94. #set -g @theme_variation 'moon'
  95. #set -g @theme_left_separator ''
  96. #set -g @theme_right_separator ''
  97. # Themepack:
  98. #set -g @plugin 'jimeh/tmux-themepack'
  99. # themepack configuration
  100. #set -g @themepack 'basic'
  101. #set -g @themepack 'powerline/block/cyan'
  102. # Nord theme: https://github.com/nordtheme/tmux
  103. #set -g @plugin "nordtheme/tmux"
  104. # Gruvbox theme: https://github.com/egel/tmux-gruvbox
  105. #set -g @plugin 'egel/tmux-gruvbox'
  106. #set -g @tmux-gruvbox 'dark' # or 'light'
  107. # Nova theme: https://github.com/o0th/tmux-nova
  108. #set -g @plugin 'o0th/tmux-nova'
  109. # colors-solarized theme: https://github.com/seebi/tmux-colors-solarized
  110. #set -g @plugin 'seebi/tmux-colors-solarized'
  111. #####
  112. # Other examples:
  113. # set -g @plugin 'github_username/plugin_name'
  114. # set -g @plugin 'github_username/plugin_name#branch'
  115. # set -g @plugin 'git@github.com:user/plugin'
  116. # set -g @plugin 'git@bitbucket.com:user/plugin'
  117. #tmux-continuum
  118. set -g @continuum-restore 'on'
  119. #tmux-resurrect
  120. #for vim
  121. set -g @resurrect-strategy-vim 'session'
  122. set -g @resurrect-processes 'vim emacs man less more tail top htop mutt'
  123. #tmux-open
  124. set -g @open-S 'https://www.duckduckgo.com/?q='
  125. # Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
  126. run '~/.tmux/plugins/tpm/tpm'