This plugin optimizes how fish
interacts with nvim
in a way that
is backwards-compatible with vim
and vi
. It provides extra integration
when the Neovim Remote is available, in a way that plays well both
with the built-in nvim
terminal and with tmux
.
Note: this plugin is no longer actively maintained. For my use, I found
that the integration of tmux
and nvr
— while neat — often just gets in
the way. For simply choosing the best alternative among several Vim binaries
(vi
, vim
, nvim
), fish-abbrfile
is more general and can do the job just fine. If you still prefer virtuoso
,
and would be interested in maintaining it, feel free to contact me.
If you want the following functionality, then this plugin is for you:
- Automatically select the best available
$EDITOR
whenfish
starts. I realize that "best" is subjective, but in my opinion the order should benvr
,nvim
,vim
,vi
. The options to the left are used if available, but more hosts have the ones to the right. Due to the how the integration is done,nvr
is only chosen as$EDITOR
if you startfish
insidenvim
ortmux
. - Provide the same editing commands in the shell as in
vim
command mode. In other words, the commandsedit
,split
,vsplit
, andtabedit
(and their abbreviationse
,sp
,vs
,tabe
) should do the same thing infish
andvim
. If your$EDITOR
isnvr
, these actions are performed in an existingnvim
instance. - Integrate the excellent Neovim Remote in a smart way. If you use
nvr
within the built-in terminal ofnvim
, this means that the surroundingnvim
is used. If you runnvr
insidetmux
, the assumption is that you only want onenvim
instance pertmux
window, so the currently visiblenvim
instance in yourtmux
window is reused. Since$EDITOR
is automatically set tonvr
when applicable, commands likegit
andnnn
also reuse these existing editor windows. - To help you start typing
e
oredit
instead ofnvr
/nvim
/vim
/vi
, since the latter are less portable, I added some abbreviations that help. If you dislike this, let me know, and I can add an option to disable them.
This is what you can expect when you use nvr
+ tmux
:
A similar experience can be expected with the built-in terminal :term
in nvim
.
When nvr
or nvim
is not available, the plugin falls back to vim
or vi
. The
screencast uses these dotfiles with tmux-tilish and vim-tmux-navigator.
The easiest way to install this is using fisher:
fisher add jabirali/fish-virtuoso
Restart fish
, and everything should work by itself.
If it doesn't, feel free to open an issue on Github!
The plugin works particularly well with the Neovim Remote, both for people
who use nvim
inside tmux
, and for people who use the built-in nvim
terminal.
The easiest way to install this software is to use the Python package manager pip
:
pip3 install neovim-remote
Remember to check that your pip
install path (e.g. ~/.local/bin
) is in $PATH
.
If you use nvr
inside tmux
, and nvim
is killed in an improper way, you
may run into issues once you try to restart nvr
in the same tmux
window.
This is because the files ~/.cache/nvim/nvr*
used by the nvim
session
will not have been cleaned up properly. If this happens, just remove the
relevant file, e.g. ~/.cache/nvim/nvr$1@2
for tmux
session 1 window 2.
If you're unsure what file to remove, just run echo $NVIM_LISTEN_ADDRESS
.
The nvr
integration is strongly inspired by this thread on Reddit.