Created
May 17, 2021 06:56
-
-
Save Loupax/be88da8d1193c3d9c6db23cc6e6f17f2 to your computer and use it in GitHub Desktop.
My tmux-vim setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
call remote_startserver('workspace') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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