dotfiles/nvim_remote
2024-05-11 22:30:44 +02:00

16 lines
291 B
Bash
Executable file

#!/bin/bash
path=$(cut -d " " -f 2 <<< $@)
dir=$(dirname $path)
cd $dir
args=$@
repo_path=$(git rev-parse --show-toplevel 2>/dev/null)
cd $repo_path
if [ -n "$repo_path" ]; then
servername=/tmp/nvr$(echo $repo_path | tr "/" "_")
nvr -s --servername $servername "$@"
else
nvim "$@"
fi