mirror of
https://github.com/ViViDboarder/shoestrap.git
synced 2024-11-05 16:26:31 +00:00
66 lines
2.3 KiB
Plaintext
66 lines
2.3 KiB
Plaintext
# set default shell
|
|
set-option -g default-shell $SHELL
|
|
|
|
# Sets xterm window title
|
|
set-option -g set-titles on
|
|
set-option -g set-titles-string '[#S:#I] #W'
|
|
|
|
# copy and paster
|
|
# if-shell 'test "$(uname -s)" = "Darwin"' 'set-option -g default-command "reattach-to-user-namespace-tmux $SHELL"'
|
|
|
|
# look good
|
|
set -g default-terminal "screen-256color"
|
|
|
|
# update prefix
|
|
unbind C-b
|
|
set -g prefix C-q
|
|
|
|
# Enable mouse mode 2.1+
|
|
set-option -g mouse on
|
|
|
|
# easy splitting
|
|
bind | split-window -h -c "#{pane_current_path}"
|
|
bind - split-window -c "#{pane_current_path}"
|
|
bind _ split-window -c "#{pane_current_path}"
|
|
|
|
# act like vim
|
|
setw -g mode-keys vi
|
|
# move between panes
|
|
bind C-q select-pane -t :.+
|
|
bind h select-pane -L
|
|
bind j select-pane -D
|
|
bind k select-pane -U
|
|
bind l select-pane -R
|
|
# swap panes
|
|
bind -r J swap-pane -D
|
|
bind -r K swap-pane -U
|
|
# move panes
|
|
bind C-j command-prompt -p "Join pane from:" "join-pane -s '%%'"
|
|
bind C-s command-prompt -p "Send pane to:" "join-pane -t '%%'"
|
|
bind C-b break-pane
|
|
# move between windows
|
|
# bind -r C-h select-window -t :-
|
|
# bind -r C-l select-window -t :+
|
|
# use vim style copy mode
|
|
unbind [
|
|
bind ` copy-mode
|
|
unbind p
|
|
bind p paste-buffer
|
|
bind -t vi-copy v begin-selection
|
|
bind -t vi-copy V rectangle-toggle
|
|
bind -t vi-copy y copy-selection
|
|
|
|
# after copying to a tmux buffer, hit y again to copy to clipboard
|
|
if-shell 'test "$(uname -s)" = "Darwin"' 'bind y run "tmux show-buffer | pbcopy"'
|
|
if-shell 'test "$(uname -s)" = "Linux"' 'bind y run "tmux show-buffer | xclip -sel clip -i"'
|
|
|
|
# Auto load tmuxline config for themes
|
|
if-shell "test -f ~/.tmuxline.conf" "source ~/.tmuxline.conf"
|
|
|
|
# smart pane switching with awareness of vim splits
|
|
# bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
|
|
# bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
|
|
# bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
|
|
# bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
|
|
# bind -n C-\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l"
|