Closed z33ky closed 6 years ago
Aliases are generally not respected in shell scripts, unless the system-wide configuration is changed accordingly. I could add a symlink and add its directory to the PATH environment variable.
Just setting PAGER could work, though I would also need to ensure I keep up-to-date with the flags passed to vim
.
I have no vim installed (nvim only), but cppman just works.
Well it has a fallback to less
. Do you mean by works that it shows something or does it actually start nvim
for you?
It actually starts neovim. I run $ cppman vector
, then type :version<CR>
and it shows a message
NVIM 0.1.7
Build type: None
Compilation: /usr/bin/cc -g -O2 \<a lot of options>...
Weird. I just compiled cppman from git, but I still get less
, even after cppman -p vim
.
What's the output of which vim && readlink -e "$(which vim)"
on your system?
$ link="$(which vim)"
$ while echo -n "$link" && link="$(readlink "$link")" && echo -n ' -> '; do true; done; echo
/usr/bin/vim -> /etc/alternatives/vim -> /usr/bin/nvim
The package (debian) vim is not installed, neovim is
My distro doesn't have an alternatives system that sets up such symlinks. In the hypothetical scenario where you have both neovim and vim installed, there would be no way of selecting either editor without changing the (global) symlink as well.
As mentioned before, one can still create a symlink in a private directory and add it to PATH
, though then launching (non-neo)vim from a shell would be awkward, though not a common use-case I guess.
I do not see the issue with my proposed changes though.
you can just set your PAGER
environment variable to nvim
and it should just work.
Couldn't you just alias vim as
nvim
? or simply set the PAGER variable.