-
Notifications
You must be signed in to change notification settings - Fork 0
/
dot_tmux.conf
85 lines (63 loc) · 2.64 KB
/
dot_tmux.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# remap prefix from 'C-b' to 'C-a'
# remap prefix from 'C-b' to 'C-a'
# unbind C-b
# set-option -g prefix C-a
# bind-key C-a send-prefix
set-environment -g PATH "/usr/local/bin:/bin:/usr/bin"
set-option -g default-shell /usr/local/bin/fish
# toogle last window by hitting again C-f
# bind-key C-a last-window
# if multiple clients are attached to the same window, maximize it to the
# bigger one
set-window-option -g aggressive-resize
# Start windows and pane numbering with index 1 instead of 0
set -g base-index 1
setw -g pane-base-index 1
# re-number windows when one is closed
set -g renumber-windows on
# word separators for automatic word selection
setw -g word-separators ' @"=()[]_-:,.'
setw -ag word-separators "'"
# Show times longer than supposed
set -g display-panes-time 2000
# tmux messages are displayed for 4 seconds
set -g display-time 4000
# {n}vim compability
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
#set-option -sa terminal-overrides ',alacritty:RGB'
#set-option -ga terminal-overrides ",xterm-256color:Tc"
#set -g default-terminal "screen-256color"
# Split horiziontal and vertical splits, instead of % and ". We also open them
# in the same directory. Because we use widescreens nowadays, opening a
# vertical split that takes half of the screen is not worth. For vertical we
# only open 90 lines width, for horizontal it's 20 columns.
bind-key v split-window -h -l 90 -c '#{pane_current_path}'
bind-key s split-window -v -l 20 -c '#{pane_current_path}'
# Pressing Ctrl+Shift+Left (will move the current window to the left. Similarly
# right. No need to use the modifier (C-b).
bind-key -n C-S-Left swap-window -t -1
bind-key -n C-S-Right swap-window -t +1
# Source file
unbind r
bind r source-file ~/.tmux.conf \; display "Reloaded!"
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Update default binding of `Enter` and `Space to also use copy-pipe
unbind -T copy-mode-vi Enter
unbind -T copy-mode-vi Space
bind-key -T edit-mode-vi Up send-keys -X history-up
bind-key -T edit-mode-vi Down send-keys -X history-down
# setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi 'v' send-keys -X begin-selection
# copy text with `y` in copy mode
bind-key -T copy-mode-vi 'y' send -X copy-selection-and-cancel
# copy text with mouse selection without pressing any key
# bind-key -T copy-mode-vi MouseDragEnd1Pane send -X copy-selection-and-cancel
# emacs key bindings in tmux command prompt (prefix + :) are better than
# vi keys, even for vim users
# set -g status-keys emacs
# focus events enabled for terminals that support them
set -g focus-events on
# enable scrolling with mouse
set -g mouse on