small medium large xlarge

Back to: All Forums  Modern Vim
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.

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.
26 Nov 2017, 14:32
Drew Neil (48 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.

02 Jan 2018, 20:25
Brendan Maginnis (1 post)

Also edit-command-line only jumps to the correct column if the command matches *vim*

I’ve hacked around it with

let $VISUAL="env DUMMY=vim nvr -cc split --remote-wait +SetWipeBuffer"
09 Jan 2018, 15:29
Drew Neil (48 posts)

Brendan, thanks for that nugget!

Does nvim match *vim*? I’m curious to know if the * character behaves as a wildcard in this context.

You must be logged in to comment