Skip to content

Instantly share code, notes, and snippets.

@psmolak
Last active May 7, 2019 04:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save psmolak/c0007635f576878710837e58d0e41dab to your computer and use it in GitHub Desktop.
Save psmolak/c0007635f576878710837e58d0e41dab to your computer and use it in GitHub Desktop.
# enable vi-like keybindings
setw -g mode-keys vi
# enable mouse support
set -g mouse on
# default terminal for 256 colors
set -g default-terminal "screen-256color"
# truecolor support
set-option -ga terminal-overrides ",xterm-256color:Tc"
# hide statusbar
set-option -g status
# Exit server when no client attached
set-option -g exit-unattached on
# Destroy session if no clients attatched to it
set-option -g destroy-unattached on
# prefix key
unbind C-b
set -g prefix C-q
# prefix keymap
bind h select-pane -L
bind l select-pane -R
bind j select-pane -D
bind k select-pane -U
# root keymap
bind -T root M-o last-pane \; resize-pane -Z
bind -T root M-s swap-pane -U
bind -T root M-a resize-pane -Z
bind -T root M-r select-layout even-vertical
bind -T root M-R select-layout even-horizontal
#!/bin/sh
USERSCRIPT="$HOME/prj/vifm-zsh/vifm-zsh-minimal" exec tmux -f "$HOME/prj/dotfiles/tmux/.tmux-compose.conf"
#!/bin/zsh
signal-handler() {
if [ ! "$PWD" = "$(readlink /proc/$vifm/cwd)" ]
then
cd -qP /proc/$vifm/cwd
zle && { zle reset-prompt }
fi
}
[ ! -z "$TMUX" ] && {
vifm=$(tmux split-window -P -F '#{pane_pid}' vifm --server-name $$)
vifm --server-name $$ --remote -c "autocmd DirEnter **,.** !/bin/kill -s USR2 $$ &"
add-zsh-hook chpwd () {
if [ ! "$PWD" = "$(readlink /proc/$vifm/cwd)" ]
then
vifm --server-name $$ --remote "$PWD"
fi
}
trap 'signal-handler' USR2
}
# vim: ft=sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment