carlocab / tmux-nvr

A tmux plugin for using session-specific Neovim instances with neovim-remote
MIT License
43 stars 2 forks source link

Add fish shell support #8

Open joshmedeski opened 1 year ago

joshmedeski commented 1 year ago

I'm using the fish shell. So the eval code won't work as it.

fish: Unsupported use of '='. In fish, please use 'set NVIM_LISTEN_ADDRESS "/var/folders/_c/kc73b95n13jfp699sll4qfhr0000gn/T/tmux-nvr/YaeRSR"'.

I don't mind forking the plugin and adding fish support, is there a good approach for supporting multiple shell environments?

joshmedeski commented 1 year ago

This works for me:

if test -n "$TMUX"
    eval (string replace "NVIM_LISTEN_ADDRESS=" "set -x NVIM_LISTEN_ADDRESS " (tmux show-environment -s NVIM_LISTEN_ADDRESS))
else
    set -x NVIM_LISTEN_ADDRESS /tmp/nvimsocket
end

I converted everything to fish compatible shell and had to do a string substitution to change to the fish way of setting variables.

Hope this helps someone else.

carlocab commented 1 year ago

I don't use fish, but I'm happy to look at a PR that adds support for fish!