Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

file init.lua script in neovim not working

so i decided to use neovim instead of vscode, im a beginner to that, i created the init.lua file on ~/.config/nvim/, with simple script :

print("hello world")

the script never executed, i also tried this way on this video https://youtu.be/w7i4amO_zaE and nothing works for me

i want the file init.lua to be executed, i need your help

like image 670
kxown Avatar asked Dec 07 '25 07:12

kxown


1 Answers

TLDR:

Install version 0.5 or greater, debian as of right now installs v0.4.4

Hey, I experienced this same thing just now and looked here for answers (they were not helpful).

Neovim v0.5.0+ has added supporting ~/.config/nvim/init.lua directly. I think there are some workarounds for v0.4 and below, but I don't know since today is the beginning of my neovim journey. Anyways do the following:

make sure that you are at least v0.5 by running:

nvim --version | head -n 1

if you are not v0.5+ then do the following:

** NOTE: as of writing this v0.9.1 is the latest, check the github for the latest and change where it says v0.9.1: https://github.com/neovim/neovim/releases

Download the appimage

wget https://github.com/neovim/neovim/releases/download/v0.9.1/nvim.appimage

Extract the appimage

chmod u+x nvim.appimage && ./nvim.appimage

** If this fails because of FUSE then do the following (mine failed)

./nvim.appimage --appimage-extract
./squashfs-root/usr/bin/nvim

Copy the binary

cp ./squashfs-root/usr/bin/nvim usr/bin/nvim

Set an alias if needed or use a symlink

Alias

# in your bashrc
alias vim='nvim'

symlink (it will fail if vim is already installed, I suggest an alias)

ln -s /usr/bin/nvim /usr/bin/vim
like image 71
Brighton Sikarskie Avatar answered Dec 08 '25 20:12

Brighton Sikarskie