small medium large xlarge

Back to: All Forums  Modern Vim
Generic-user-small
26 Nov 2017, 20:48
Thiago Araújo Silva (5 posts)

I’ve been having problems with this topic, probably due to zsh. In any case, It might be useful to mention it here in case someone else runs into the same problem.

zsh’s edit-command-line command escapes single quotes of the nvr command (roughly to +\'set bufhidden=wipe\'), and nvr gets confused when parsing these arguments (it thinks there are two arguments, 'set and bufhidden=wipe', and neovim ends up trying to execute a mark command 's). Git, in turn, does not escape the command, so everything works fine there and the flag enters in the nvr executable as a single argument.

My temporary workaround is ugly but effective. First, configure a command:

command! SetWipeBuffer set bufhidden=wipe

Then we can configure the $VISUAL variable like so:

let $VISUAL="nvr -cc split --remote-wait +SetWipeBuffer"

And there is another unfortunate problem. When I change the nvr command to open on a vertical split, neovim dies with a segmentation fault, which is very weird :( I’m using the latest versions.

Generic-user-small
26 Nov 2017, 12:55
Thiago Araújo Silva (5 posts)

And just a minor issue that I forgot to mention. Environment variables defined by vim are inherited before zsh reads .zshenv, where I already have a setting for $VISUAL. That means the $VISUAL value defined by vim is overriden by zsh. IMO the book should either:

  • If the user is defining a $VISUAL variable for his shell already, suggest the following shell config before configuring an override in vim:

export VISUAL=${VISUAL:-nvim}

  • Use the shell config to set $VISUAL to “nvr” depending on the presence of $NVIM_LISTEN_ADDRESS. That said, IMO having this config in vim itself makes more sense, but is still error prone.
Drewneil_pragsmall
26 Nov 2017, 14:32
Drew Neil (45 posts)

This is great feedback, thanks. It may take me a while to digest this, but I just wanted to reply now to let you know that I’ve seen your comments.

You must be logged in to comment