nvim-lua / kickstart.nvim

A launch point for your personal nvim configuration
MIT License
20.06k stars 24.43k forks source link

init.lua not working #148

Closed DavidSSL closed 1 year ago

DavidSSL commented 1 year ago

This is very similar to #90 but the solution provided there didn't work. I am using WSL2 for Windows.

Following the instructions in https://www.youtube.com/watch?v=stqUbv-5u2s, the configuration did not work as expected.

To Reproduce Steps to reproduce the behavior:

copy init.lua from this repo to ~/config/nvim/
Start nvim

Expected results: Plugins get loaded, new features such as file search, colors etc are available. Actual resuts:

no change in nvim before installing init.lua

Error detected while processing /home/david/.config/nvim/init.lua: E5113: Error while calling lua chunk: /home/david/.config/nvim/init.lua:7: Vim(packadd):E919: Directory not found in 'packpath': "pack/*/opt/packer.nvim" stack traceback: [C]: in function 'cmd' /home/david/.config/nvim/init.lua:7: in main chunk

Desktop (please complete the following information):

OS: Linux ubuntu 22.04 (WSL)
Terminal: zsh

Neovim Version

Output of running :version from inside of neovim:
:version

NVIM v0.8.2 Build type: Release LuaJIT 2.1.0-beta3 Compiled by runner@fv-az190-151

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

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

cjgratacos commented 1 year ago

That is interesting, do you have latest git inside your WSL instance?

DanielBrittainJr commented 1 year ago

I'm running the same setup on wsl2 as you but with Neovim 9.0 and its working fine, not a fix for this but wanted to let you know in case you just wanted to get it working.

DavidSSL commented 1 year ago

Thanks @DanielBrittainJr, I might try that at some point.

@cjgratacos, I unfortunately have to use quite an old version of git "git version 2.31.1". What's the minimum version recommended?

EriComic commented 1 year ago

I'm on the same setup, WSL2 Ubuntu. I've tried running the stable 0.82 and dev 0.9 without success. I have git 2.34.1.

For me, 6 plugins are not installing, being:

For some reason, the plugins are still in the list when running PackerSync, as if they are working. But I'm still met with a nasty wall of red with error messages when starting neovim. Some messages mention the plugins in the list above and the rest are supposedly related.

cjgratacos commented 1 year ago

@DavidSSL interesting, tbh, I don't know what is the minimal version of git that you might need, but I am assuming is something that has to do with the git version and/or neovim version and/or lua version inside neovim that it is not playing well with each other. Maybe a neovim or lua git internal wrapper of some sort. Looking closely at your error, it is actually triggering an error on git, way before all the packer and configuration. Tbh, I would try and update neovim or git (if possible) to see if it solves the issue. If not, I would try and do a manual git clone of packer on the proper neovim plugin folder and see if all works after that. ( Note it might not work if it is truly a git issue because packer internally all it does are git commands internally, but still worth the try, and let us know of the result).

DavidSSL commented 1 year ago

Ok, I've fixed it but I'm not 100% sure what the solution was and so I'll explain the steps I undertook.

As @cjgratacos pointed out, the init.lua file is calling some git commands and in my case I was failing on the 1st one

git clone -v --depth 1 https://github.com/wbthomason/packer.nvim
git: 'remote-https' is not a git command. See 'git --help'.

Then by googling, I found this and I installed:

sudo apt-get install libcurl4-openssl-dev 

I tried git clone again but got the same error. By further googling, I believe that I was advised to uninstall git and reinstall it after installing libcurl4.

I then unfortunately installed the latest version of git which is not 2.31.1 which I have to have. Anyway, with the latest version of git, git clone worked and kickstart.nvim worked for me.

Then I uninstalled the latest version of git and installed my version according to the following instructions. I removed init.lua and the plugins folder at ~/.config/nvim. This time the git clone worked and kickstart.nvim worked.