dotfiles/.tmux.conf

54 lines
1.6 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
# change color
set -g status-style 'bg=green fg=black italics'
# time et hostname
set -g status-right "#[fg=blue bg=black noitalics bold] %R #[fg=yellow nobold]#{user}#[fg=white bg=black noitalics bold]@#h #[bg=green 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"'