Parcourir la source

tmux configuration

Jean-Christophe Bach il y a 1 an
Parent
commit
c0404a0b06
3 fichiers modifiés avec 144 ajouts et 0 suppressions
  1. 132 0
      .tmux.conf
  2. 11 0
      .tmux/plugins/README
  3. 1 0
      .tmux/resurrect/.keep

+ 132 - 0
.tmux.conf

@@ -0,0 +1,132 @@
+#redefine existing well-known key bidings by changing the starting path
+bind -N "Create a new window (starting with the current pane path)" c new-window -c "#{pane_current_path}"
+#bind -N "Split window vertically (starting with the current pane path)" " split-window -v -c '#{pane_current_path}'
+#bind -N "Split window horizontally (starting with the current pane path)" % split-window -h -c '#{pane_current_path}'
+
+
+# switch panes using Alt-arrow without prefix
+#bind -n M-Left select-pane -L
+#bind -n M-Right select-pane -R
+#bind -n M-Up select-pane -U
+#bind -n M-Down select-pane -D
+
+# Enable mouse mode (tmux 2.1 and above)
+set -g mouse on
+
+bind -N "Change to copy mode" Escape copy-mode
+bind -N "Paste the buffer" P paste-buffer
+bind-key -T copy-mode-vi v send-keys -X begin-selection
+bind-key -T copy-mode-vi y send-keys -X copy-selection
+bind-key -T copy-mode-vi r send-keys -X rectangle-toggle
+
+bind -N "Save the content of the buffer into the clipboard" C-c run "tmux save-buffer - | xsel -bpi"
+
+set-option -g history-limit 100000
+set-option -g renumber-windows on
+
+set -g default-terminal "tmux-256color"
+# hack pour profiter du scroll du terminal (xterm ...)
+set -g terminal-overrides 'xterm*:smcup@:rmcup@'
+
+##fix dirty bug of end/home note working vm/tmux
+#bind-key -n Home send Escape "OH"
+#bind-key -n End send Escape "OF"
+
+# Redraw the client (if interrupted by wall, etc.)
+bind -N "Redraw the client (if interrupted by wall, etc.)" R refresh-client
+
+# reload tmux config with ctrl + b + r
+unbind r
+bind -N "Reload tmux configuration" r source-file ~/.tmux.conf \; display-message 'Reloaded tmux config.'
+
+# quick-pane configuration: htop
+bind-key -N "Quick-pane: htop" h split-window -h "htop"
+#open tmux configuration in a side pane
+bind -N "Open tmux configuration in a side pane" M split-window -h "vim ~/.tmux.conf"
+
+#???
+#bind-key ! break-pane -d -n _hidden_pane
+#bind-key @ join-pane -s $.0
+
+## Join windows: <prefix> s, <prefix> j
+bind-key -N "Join a pane from another session/window" j command-prompt -p "join pane from:"  "join-pane -s '%%'"
+bind-key -N "Send a pane to another session/window" e command-prompt -p "send pane to:"  "join-pane -t '%%'"
+#format: mysession:mywindow.mypane
+
+# Visual Activity Monitoring between windows
+setw -g monitor-activity off
+set -g visual-activity on
+#set -g visual-bell on
+
+# Automatically set window title
+#setw -g automatic-rename
+
+# Show tmux positions in titles
+set -g set-titles on
+set -g set-titles-string "[#S>#I:#W]"
+
+# Copy from tmux to system clipboard
+# Needs xclip -> emerge xclip
+#bind -t vi-copy y copy-pipe "xclip -sel clip -i"
+
+# initialize sessions
+#bind S source-file ~/.tmux/IMTA 
+
+
+# ===============
+# Apparence and status bar
+
+# window segments in status line
+set -g window-status-separator ""
+#separator_powerline_left=""
+#separator_powerline_right=""
+separator_powerline_left="←"
+separator_powerline_right="→"
+
+setw -g window-status-format " #I:#W "
+setw -g window-status-current-format "$separator_powerline_right#I:#W$separator_powerline_left"
+
+# general status bar settings
+set -g status on
+set -g status-interval 5
+set -g status-position bottom
+set -g status-justify left
+set -g status-right-length 100
+
+# define widgets we're going to use in status bar
+wg_session="#S"
+wg_date="%Y-%m-%d %H:%M"
+wg_user_host="#(whoami)@#H"
+wg_battery="#(~/install/Battery/battery -t -g black)"
+
+set -g status-left "$wg_session"
+#set -g status-right "$wg_user_host | $wg_date $wg_battery"
+set -g status-right "$wg_user_host $wg_battery$wg_date"
+
+# Drag windows on the status bar
+bind-key -n MouseDrag1Status swap-window -d -t=
+
+# List of plugins
+set -g @plugin 'tmux-plugins/tpm'
+set -g @plugin 'tmux-plugins/tmux-sensible'
+set -g @plugin 'tmux-plugins/tmux-resurrect'
+set -g @plugin 'tmux-plugins/tmux-continuum'
+set -g @plugin 'tmux-plugins/tmux-open'
+
+# Other examples:
+# set -g @plugin 'github_username/plugin_name'
+# set -g @plugin 'github_username/plugin_name#branch'
+# set -g @plugin 'git@github.com:user/plugin'
+# set -g @plugin 'git@bitbucket.com:user/plugin'
+
+#tmux-continuum
+set -g @continuum-restore 'on'
+#tmux-resurrect
+#for vim
+set -g @resurrect-strategy-vim 'session'
+set -g @resurrect-processes 'vim emacs man less more tail top htop mutt'
+#tmux-open
+set -g @open-S 'https://www.duckduckgo.com/?q='
+
+# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
+run '~/.tmux/plugins/tpm/tpm'

+ 11 - 0
.tmux/plugins/README

@@ -0,0 +1,11 @@
+Install all these plugins by cloning them here:
+
+* tmux-continuum: https://git::@github.com/tmux-plugins/tmux-continuum
+
+* tmux-open: https://git::@github.com/tmux-plugins/tmux-open
+
+* tmux-resurrect: https://git::@github.com/tmux-plugins/tmux-resurrect
+
+* tmux-sensible: https://git::@github.com/tmux-plugins/tmux-sensible
+
+* tpm: https://github.com/tmux-plugins/tpm

+ 1 - 0
.tmux/resurrect/.keep

@@ -0,0 +1 @@
+this directory will contain all the saved sessions