0

Whenever i install any plugin in neovim/vim, the commands don't work, neovim/vim gives me the same error saying that the command that the plugin has isn't a command. Am i doing something wrong?

For more info, i use windows 10 (want to switch to linux but i don't have a computer of my own to do so). I checked everything i installed, they have a windows version, they have instructions on how to download it on windows, i followed them, but the plugins still refuse to work.

The first thing i installed is vim-plug. But no command i enter works.

I tried re-installing, but that doesn't work either.

romainl
  • 186,200
  • 21
  • 280
  • 313
George
  • 101
  • 8
  • To assess your situation I have a few questions. What is the result of the `:PlugInstall` command? What is the content of your `~\_vimrc` file? Which plugin are trying to install? – Vivian De Smedt Feb 16 '23 at 16:15
  • 2
    1. E492: Not an editor command: [command plugin has here] 2. I'm on neovim, and there appears to be nothing in the init.vim file, i'm pretty sure that's the config file used on neovim 3. Im trying to install neovim tree. – George Feb 16 '23 at 16:35
  • For anybody whose problem wasn't solved by the accepted answer, there is a known bug in Neovim right now which is tangentially related to this and has prevented me from fixing it on my machine. Check out [this](https://github.com/neovim/neovim/issues/21445). – DCoxshall Feb 18 '23 at 11:52

1 Answers1

2
  1. You have first to install vim-plug.

On Windows 10 you have to start a powershell (WinpowershellEnter) run the following command:

iwr -useb https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim |`
    ni "$(@($env:XDG_DATA_HOME, $env:LOCALAPPDATA)[$null -eq $env:XDG_DATA_HOME])/nvim-data/site/autoload/plug.vim" -Force
  1. You need to have the following lines in your ~\AppData\Local\nvim\init.vim
call plug#begin()
Plug 'nvim-tree/nvim-web-devicons' " optional, for file icons
Plug 'nvim-tree/nvim-tree.lua'
call plug#end()
  1. You need to start Neovim and run:
:PlugInstall
  1. You need to restart Neovim
Vivian De Smedt
  • 1,019
  • 2
  • 16
  • 26