-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.tmux.conf
133 lines (105 loc) · 4.19 KB
/
.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# https://github.com/tmux/tmux/wiki/Getting-Started#list-of-useful-options
set -g default-terminal "tmux-256color"
set -ag terminal-overrides ",xterm-256color:RGB"
set -g default-command /bin/zsh
set -g default-shell /bin/zsh
# change the prefix to Ctrl+A
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# bind prefix+r to reload config
bind r source-file ~/.tmux.conf \; display "Config reloaded"
bind e new-window -n '~/.tmux.conf' "sh -c '\${EDITOR:-nvim} ~/.tmux.conf && tmux source ~/.tmux.conf && tmux display \"Config reloaded\"'"
# enable mouse scrolling
set -g mouse on
set -sg escape-time 0
# enable copy mode
setw -g mode-keys vi
bind -T copy-mode-vi v send -X begin-selection
bind -T copy-mode-vi C-v send -X rectangle-toggle
bind -T copy-mode-vi y send -X copy-selection-and-cancel
bind -T copy-mode-vi Escape send -X cancel
bind -T copy-mode-vi H send -X start-of-line
bind -T copy-mode-vi L send -X end-of-line
bind -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "pbcopy"
bind -r T neww -c "#{pane_current_path}" "nvim ~/Documents/Obsidian/Notes/Todo.md"
bind -r d neww -c "#{pane_current_path}" "source ~/.zshrc && oxker"
bind -r D neww -c "#{pane_current_path}" "source ~/.zshrc && dll"
bind -r G neww -c "#{pane_current_path}" "source ~/.zshrc && lazygit -ucd ~/.config/lazygit"
# enable ; to open command prompt
unbind ";"
bind ";" command-prompt
# unbinding default split keybindings
unbind '"'
unbind %
# create new bindings to split windows
bind l split-window -h -c '#{pane_current_path}'
bind j split-window -v -c '#{pane_current_path}'
bind c new-window -c '#{pane_current_path}'
# Swap pane keybindings
bind H select-pane -L \; swap-pane -s '!' \; select-pane -L
bind L select-pane -R \; swap-pane -s '!' \; select-pane -R
bind K select-pane -U \; swap-pane -s '!' \; select-pane -U
bind J select-pane -D \; swap-pane -s '!' \; select-pane -D
# Resize pane keybindings
bind -r C-h resize-pane -L 2
bind -r C-j resize-pane -D 2
bind -r C-k resize-pane -U 2
bind -r C-l resize-pane -R 2
# Status line config
# set-option -g status-fg blue
# set-option -g status-bg black
# set-option -g message-style bg=black,fg=green
# set-option -g status-position bottom
# set-option -g status-right " #S #{b:pane_current_path} %H:%M"
# set -g status-left '#{prefix_highlight}'
set-option -g focus-events on
# Fix numbering
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
# Keybinding to access todo notes
# Keybinding to open links
set -g @fzf-url-bind 'u'
# Theme/Colors
set -g pane-active-border-style 'fg=magenta,bg=default'
set -g pane-border-style 'fg=brightblack,bg=default'
set -g @dracula-plugins "git time"
set -g @dracula-show-powerline true
set -g @dracula-show-flags true
set -g @dracula-border-contrast true
set -g @dracula-show-left-icon session
set -g @dracula-show-empty-plugins false
set -g @dracula-left-icon-padding 0
set -g @dracula-git-show-current-symbol ✓
set -g @dracula-git-show-diff-symbol !
set -g @dracula-show-fahrenheit false
set -g @dracula-show-location false
set -g @dracula-show-timezone false
set -g @dracula-time-format " %H:%M %p"
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'sainnhe/tmux-fzf'
set -g @plugin 'tmux-plugins/tmux-sessionist'
set -g @plugin 'tmux-plugins/tmux-prefix-highlight'
set -g @plugin 'wfxr/tmux-fzf-url'
set -g @plugin 'dracula/tmux'
# initialize tmux plugin manager
run '~/.tmux/plugins/tpm/tpm'
# Binds that plugins override
unbind g
bind -r g split-window -h -c '#{pane_current_path}' "lazygit -ucd ~/.config/lazygit"
unbind S
bind -r S split-window -v "s"
# Navigator.nvim
is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?|fzf)(diff)?$'"
bind-key -n C-h if-shell "$is_vim" "send-keys C-h" "select-pane -L"
bind-key -n C-j if-shell "$is_vim" "send-keys C-j" "select-pane -D"
bind-key -n C-k if-shell "$is_vim" "send-keys C-k" "select-pane -U"
bind-key -n C-l if-shell "$is_vim" "send-keys C-l" "select-pane -R"
bind-key -T copy-mode-vi C-h select-pane -L
bind-key -T copy-mode-vi C-j select-pane -D
bind-key -T copy-mode-vi C-k select-pane -U
bind-key -T copy-mode-vi C-l select-pane -R