Skip to content

Instantly share code, notes, and snippets.

@nischalbasuti
Last active September 2, 2023 16:27
Show Gist options
  • Select an option

  • Save nischalbasuti/d7c4d6b2565b394cd7d3f453054b0b11 to your computer and use it in GitHub Desktop.

Select an option

Save nischalbasuti/d7c4d6b2565b394cd7d3f453054b0b11 to your computer and use it in GitHub Desktop.
set-window-option -g mode-keys vi
# set -g default-terminal "screen"
# enable mouse
set -g mouse on
# vi like navigation
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# split window
bind \\ split-window -h -c '#{pane_current_path}'
bind - split-window -v -c '#{pane_current_path}'
# resize pane
bind C-h resize-pane -L 10
bind C-j resize-pane -D 5
bind C-k resize-pane -U 5
bind C-l resize-pane -R 10
# changing prefix to ` (backtick)
unbind C-b
set -g prefix `
bind ` send-prefix
# ctrl+up to scroll up
bind -n C-Up copy-mode -u
# toggle broadcasting to all panes
bind b set-window-option synchronize-panes
# no delay on escape
set -g escape-time 0
# create window in the same directory
bind c new-window -c "#{pane_current_path}"
# copy to system clipboard (Linux)
bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "xclip -i -f -selection primary | xclip -i -selection clipboard"
bind -T copy-mode-vi y send-keys -X copy-pipe "xclip -i -f -selection primary | xclip -i -selection clipboard" \; send-keys -X clear-selection
# copy to system clipboard (OSX)
# bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"
# bind-key -T copy-mode-vi y send-keys -X copy-pipe "pbcopy" \; send-keys -X clear-selection
# move windows
bind-key H swap-window -t -1
bind-key L swap-window -t +1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment