Skip to content

Commit

Permalink
adding tmux
Browse files Browse the repository at this point in the history
  • Loading branch information
Cameron Motevasselani committed Jun 4, 2024
1 parent 8ff9a4f commit 44c44cf
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/tmux/plugins/tmux
Submodule tmux added at 9da7bb
1 change: 1 addition & 0 deletions config/tmux/plugins/tpm
Submodule tpm added at 99469c
1 change: 1 addition & 0 deletions config/tmux/plugins/vim-tmux-navigator
Submodule vim-tmux-navigator added at 5b3c70
82 changes: 82 additions & 0 deletions config/tmux/tmux.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@

unbind r
bind r source-file ~/.config/tmux/tmux.conf

set -g prefix M-s

bind-key -n M-h select-pane -L
bind-key -n M-j select-pane -D
bind-key -n M-k select-pane -U
bind-key -n M-l select-pane -R

set-option -g status-position top

# List of plugins
set -g @plugin 'tmux-plugins/tpm'


set -g @plugin 'christoomey/vim-tmux-navigator'
# Other examples:
# set -g @plugin 'github_username/plugin_name'
# set -g @plugin 'github_username/plugin_name#branch'
# set -g @plugin '[email protected]:user/plugin'
# set -g @plugin '[email protected]:user/plugin'

### Catppuccin tmux configs
set -g @plugin 'catppuccin/tmux'
set -g @catppuccin_window_left_separator ""
set -g @catppuccin_window_right_separator " "
set -g @catppuccin_window_middle_separator ""
set -g @catppuccin_window_number_position "right"

set -g @catppuccin_window_default_fill "number"
set -g @catppuccin_window_default_text "#W"

set -g @catppuccin_window_current_fill "number"
set -g @catppuccin_window_current_text "#W"

set -g @catppuccin_status_modules_right "directory session"
set -g @catppuccin_status_left_separator ""
set -g @catppuccin_status_right_separator ""
set -g @catppuccin_status_fill "icon"
set -g @catppuccin_status_connect_separator "no"

### END Catppuccin tmux configs

set -g @catppuccin_directory_text "#{pane_current_path}"


### Meta key binding for navigation with nvim
### from https://github.com/christoomey/vim-tmux-navigator/issues/308
unbind M-h
unbind M-j
unbind M-k
unbind M-l

is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
| grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|n?vim?x?)(diff)?$'"
bind-key -n 'M-h' if-shell "$is_vim" 'send-keys M-h' 'select-pane -L'
bind-key -n 'M-j' if-shell "$is_vim" 'send-keys M-j' 'select-pane -D'
bind-key -n 'M-k' if-shell "$is_vim" 'send-keys M-k' 'select-pane -U'
bind-key -n 'M-l' if-shell "$is_vim" 'send-keys M-l' 'select-pane -R'
tmux_version='$(tmux -V | sed -En "s/^tmux ([0-9]+(.[0-9]+)?).*/\1/p")'
if-shell -b '[ "$(echo "$tmux_version < 3.0" | bc)" = 1 ]' \
"bind-key -n 'M-\\' if-shell \"$is_vim\" 'send-keys M-\\' 'select-pane -l'"
if-shell -b '[ "$(echo "$tmux_version >= 3.0" | bc)" = 1 ]' \
"bind-key -n 'M-\\' if-shell \"$is_vim\" 'send-keys M-\\\\' 'select-pane -l'"

bind-key -T copy-mode-vi 'M-h' select-pane -L
bind-key -T copy-mode-vi 'M-j' select-pane -D
bind-key -T copy-mode-vi 'M-k' select-pane -U
bind-key -T copy-mode-vi 'M-l' select-pane -R
bind-key -T copy-mode-vi 'M-\' select-pane -l

### END Meta key binding






# Initialize TMUX plugin manager (keep this line at the very bottom of tmux.conf)
run '~/.config/tmux/plugins/tpm/tpm'

0 comments on commit 44c44cf

Please sign in to comment.