60 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
			
		
		
	
	
			60 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
| ## pcht tmux configurarion
 | |
| # (c) 2018-2025
 | |
| 
 | |
| # change prefix to ctrl+a and 
 | |
| # use "C-a a"to send C-a to shell
 | |
| unbind C-b
 | |
| set -g prefix C-a
 | |
| bind a send-prefix
 | |
| 
 | |
| # disable login-shell on tmux
 | |
| # https://wiki.archlinux.org/index.php/Tmux#Start_a_non-login_shell
 | |
| set -g default-command "${SHELL}"
 | |
| 
 | |
| # 256 colors
 | |
| set -g default-terminal "tmux-256color"
 | |
| # true color
 | |
| set-option -sa terminal-features ',tmux*:RGB'
 | |
| 
 | |
| # open pane/window in same directory
 | |
| # https://unix.stackexchange.com/questions/12032/create-new-window-with-current-directory-in-tmux
 | |
| bind '"' split-window -c "#{pane_current_path}"
 | |
| bind s split-window -c "#{pane_current_path}"
 | |
| bind % split-window -h -c "#{pane_current_path}"
 | |
| bind '|' split-window -h -c "#{pane_current_path}"
 | |
| bind c new-window -c "#{pane_current_path}"
 | |
| 
 | |
| # last window like in screen
 | |
| bind C-a last-window
 | |
| 
 | |
| # clean-history w/ C-a prefix
 | |
| # https://stackoverflow.com/questions/10543684/how-can-i-clear-scrollback-buffer-in-tmux
 | |
| # C-l C-k clear all bash terminal and tmux history
 | |
| bind -n C-k clear-history
 | |
| 
 | |
| # set history size
 | |
| set-option -g history-limit 10000
 | |
| 
 | |
| # status on 1 line
 | |
| set -g status on
 | |
| set -g status-keys vi
 | |
| 
 | |
| # check config file is readen
 | |
| # set -g status-left "CONFIG OK"
 | |
|  
 | |
| # Si connecté en SSH, changer la bg en red, sino en gree
 | |
| if-shell 'env | grep -q SSH_CONNECTION' \
 | |
| 	'set -g @bg red' \
 | |
| 	'set -g @bg green'
 | |
| set -g status-style "bg=#{@bg} fg=black italics"
 | |
| # change color
 | |
| set -g status-right "#[fg=blue bg=black noitalics bold] %R #[fg=yellow nobold italics]#{user}#[fg=white noitalics]@#[fg=#{@bg} bg=black noitalics bold]#h #[bg=#{@bg} fg=black ] "
 | |
| 
 | |
| # reload this file
 | |
| bind r source-file /home/patrick/.tmux.conf \; display-message ".tmux.conf reloaded" 
 | |
| 
 | |
| # urlview in pane
 | |
| # from https://wiki.archlinux.org/title/Tmux#Browsing_URLs
 | |
| bind-key u capture-pane \; save-buffer /tmp/tmux-buffer \; new-window -n "urlview" '$SHELL -c "urlview < /tmp/tmux-buffer"'
 | |
| 
 |