If you're having issues with Firenvim, here are the following steps you can take in order to check if everything is correctly set up on your side:
Run neovim without any arguments and then try to run the following line:
call firenvim#install(0)
If this results in Installed native matifest for ${browser}
being printed, the firenvim plugin is correctly installed in neovim and you can move on to the next troubleshooting step.
If this results in No config detected for ${browser}
and ${browser}
is the browser you want to use firenvim with, this might be because your browser configuration files are in a non-standard directory. If this is the case, force-install firenvim by running call firenvim#install(1)
and read the documentation about native manifest location for firefox or chrome in order to figure out where you should copy the native manifest generated by firenvim#install(1)
.
If this results in Unknown function: firenvim#install
being printed, then firenvim is not correctly installed in neovim and this is likely a configuration error from your side. Check your configuration again.
If this results in nvim version >= 0.4.0 required. Aborting
, you know what to do :).
Running call firenvim#install(0)
should have created a shell or batch script in $XDG_DATA_HOME/firenvim
(on linux/osx, this usually is $HOME/.local/share/firenvim
, on windows it's %APPDATA%\firenvim
). Make sure that the script exists and that it is executable. Try running it in a shell, like this:
echo 'abcde{}' | $XDG_DATA_HOME/firenvim/firenvim
This should print a json object the content of which is the current version of the firenvim neovim plugin. If it doesn't, please open a new github issue.
Running call firenvim#install(0)
should also have created a file named firenvim.json
in your browser's configuration directory. Make sure it exists:
$HOME/.mozilla/native-messaging-hosts
$HOME/.config/google-chrome/NativeMessagingHosts/
$HOME/.config/chromium/NativeMessagingHosts/
$HOME/Library/Application Support/Mozilla/NativeMessagingHosts
$HOME/Library/Application Support/Google/Chrome/NativeMessagingHosts
$HOME/Library/Application Support/Chromium/NativeMessagingHosts
%APPDATA%\firenvim
and check that the following registry keys exist and point to the native manifest:
HKEY_CURRENT_USER\SOFTWARE\Mozilla\NativeMessagingHosts\firenvim
HKEY_CURRENT_USER\SOFTWARE\Google\Chrome\NativeMessagingHosts\firenvim
Also check the content of this json file to make sure that the path
key points to the firenvim script you checked the existence of in the previous step. If the json file is missing or if the path
attribute is wrong, please open a new github issue.
In your browser, open the background console. This requires the following steps:
about:debugging
This Firefox
in the left column.inspect
button.chrome://extensions
backround page
link.<C-l>
.Then, navigate to a page with a textarea (I really like http://txti.es
for this). Open the content console (<CS-I>
on both firefox and chrome/ium). If you're using firefox, also open and clear the Browser Console (<CS-J>
). Then, click on the textarea. This should result in messages being printed in the console. If it doesn't, try clicking on the Firenvim icon next to the urlbar. If no messages are logged there either, try clicking on the Reload settings
button.
Clone the firenvim repository somewhere (e.g. git clone https://git.sr.ht/~glacambre/firenvim /tmp/firenvim
) and edit the firenvim script so that it doesn't load your init.vim but loads firenvim, like this:
-exec '/usr/bin/nvim' --headless -c 'call firenvim#run()'
+exec '/usr/bin/nvim' -u NORC --cmd 'set rtp+=/tmp/firenvim' --headless -c 'call firenvim#run()'
Then, try reloading your config twice/focusing a textarea twice. If firenvim suddenly starts working, this might be a $PATH
issue on your end. Revert the changes you just made and try the instructions in this section in order to fix it.
Some operating systems (such as OSX) empty your browser's $PATH
. This could be a problem if you want to use plugins that depend on other executables. In order to check if this is indeed happening, just run echo $PATH
in your shell and :!echo $PATH
in firenvim and compare the results. If they're different, this might be the culprit.
In order to fix this, call firenvim#install() and give it a prologue that sets the right path for you, like this:
nvim --headless -c "call firenvim#install(0, 'export PATH=\"$PATH\"')" -c quit
Note that this sets your $PATH
in stone and that in order to update it you'll need to run the above command again. If you want to avoid doing that, you could also try the method described here.