Skip to content

Instantly share code, notes, and snippets.

@Loupax
Created May 17, 2021 06:56
Show Gist options
  • Save Loupax/be88da8d1193c3d9c6db23cc6e6f17f2 to your computer and use it in GitHub Desktop.
Save Loupax/be88da8d1193c3d9c6db23cc6e6f17f2 to your computer and use it in GitHub Desktop.
My tmux-vim setup
export EDITOR=vim
# This will allow me to send files to my already open vim
# from the command line.
# Automatically focuses on the first pane which should be
# where my vim instanse lives
tab(){
vim --servername workspace --remote-tab "$@"
tmux select-pane -t 0
}
call remote_startserver('workspace')
#!/bin/bash
SESSION="workstation"
SESSIONEXISTS=$(tmux list-sessions | grep $SESSION)
if [ "$SESSIONEXISTS" = "" ]
then
tmux new-session -d -s $SESSION "vim"
tmux splitw -v
tmux resize-pane -D 10
tmux select-pane -t 0
fi
tmux attach -t $SESSION:0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment