Search code examples
vimcommand-lineneovimappimage

nvim and vim not recognized after upgrade to nightly


in the attempt of upgrading nvim

NVIM v0.4.4
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -g -O2 -fdebug-prefix-map=/build/neovim-u4YhjF/neovim-0.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=1 -DDISABLE_LOG -Wdate-time -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/build/neovim-u4YhjF/neovim-0.4.4/build/config -I/build/neovim-u4YhjF/neovim-0.4.4/src -I/usr/include -I/usr/include/lua5.1 -I/build/neovim-u4YhjF/neovim-0.4.4/build/src/nvim/auto -I/build/neovim-u4YhjF/neovim-0.4.4/build/include
Compiled by [email protected]

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

from latest to nightly (beccause lsp)
I ran the command below

sudo apt remove neovim
rm -rf ~/.config/nvim/
curl -LO https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage
chmod u+x nvim.appimage
./nvim.appimage

which seems to succeed as nvim opens up

but then I have this result when I try to use it

$ nvim .
Command 'nvim' not found, but can be installed with:
sudo snap install nvim    # version v0.4.4-stable, or
sudo apt  install neovim  # version 0.4.4-1
See 'snap info nvim' for additional versions.
$ nvim --version
Command 'nvim' not found, but can be installed with:
sudo snap install nvim    # version v0.4.4-stable, or
sudo apt  install neovim  # version 0.4.4-1
See 'snap info nvim' for additional versions.

why so?
Should I add appimage on my path? (How?)

curiously it killed regular vim as well

$ vim .
Command 'vim' not found, but can be installed with:
sudo apt install vim         # version 2:8.2.2434-1ubuntu1, or
sudo apt install vim-tiny    # version 2:8.2.2434-1ubuntu1
sudo apt install neovim      # version 0.4.4-1
sudo apt install vim-athena  # version 2:8.2.2434-1ubuntu1
sudo apt install vim-gtk3    # version 2:8.2.2434-1ubuntu1
sudo apt install vim-nox     # version 2:8.2.2434-1ubuntu1

update

after patching the problem
adding to my bashrc alias nvim="./nvim.appimage"

I still don't know why my (regular) vim disappered and I also noticed "+P "+Y don't paste from clipboard anymore

(opened a specific question here)


Solution

  • The package neovim of your package manager provided the commands nvim (and possibly vim as well).

    After removing the package via sudo apt remove neovim, those commands will be gone. Just by downloading a new version (outside the comfort of your package manager), you won't get a "command" installed. If you want to keep using this downloaded version, the easiest way to do so IMO would be to:

     1. Move or symlink the new executable to some new folder like ~/bin:

    mkdir -p ~/bin
    mv nvim.appimage ~/bin/nvim
    # or
    ln -s ~/Downloads/nvim.appimage ~/bin/nvim
    

     2. Add this folder to your path, for example by changing your path in your .bashrc:

    echo 'export PATH="$PATH:$HOME/bin"' >>~/.bashrc
    

     3. Open a new terminal to make the changes take effect.