Helper to use vim/neovim as a terminal multiplexer
Demo video:
install
You will need rust and cargo installed.
Then install the following vim plugin, with a hook to install vmux crate:
Plug 'yazgoo/vmux', {'do': 'cargo install vmux' }
Then add the following to your .zshrc or .bashrc
Or if you want to use vim instead of nvim (you need vim compiled with +clientserver
flag) :
usage
Run vmux
for vmux command usage help
Run :help vmux
from within vim for more in depth help.
detaching
You can detach from the session with ^g
After detaching / or quitting vim, you will be prompted, via sk to:
- switch session
- create a new session
- exit
customizing
session name
You can define a custom way to setup a new session via ~/.config/vmux/hooks/session_name.sh
The script just needs to print environment variables of the form (env
command will do that):
key=value
it takes the session name as argument.
For example, this script will print the content of envrc
and set working directory to ~/dev/$1
mydir=$HOME/dev/"$1"
[ -e "$mydir"/.envrc ] && cat "$mydir"/.envrc
env
echo PWD="$mydir"
list sessions names
You can define a list of new session names via ~/.config/vmux/hooks/list_sessions_names.sh
The script just needs to output session names one by line.
For example, this script will list all directories names in ~/dev
find -L ~/dev -maxdepth 1 -type d | while read d; do basename $d; done
wallpaper
You can put images which will be used as wallpapers inside ~/.config/vmux/wallpapers/
.
tabbar
Having a nice tabbar (based on Caagr98/c98tabbar.vim):
Plug 'git@github.com:yazgoo/c98tabbar.vim'
Plug 'yazgoo/vmux-c98tabbar'
Leave terminal insert mode by typing escap twice:
tnoremap <Esc><Esc> <C-\><C-n>
detailed setup notes
start docker container