function nvim --wraps nvim --description 'open a new nvim instance or connect to an existing one using nvr(1)' # if `nvr` is not installed, nevermind. just run `nvim` if ! command --query nvr command nvim $argv return end if test ! -S /tmp/nvimsocket command nvim --listen /tmp/nvimsocket $argv else command nvr -s $argv end end