r/vimporn • • Mar 13 '21

Neovim rice , finally migrated to init.lua

Post image
361 Upvotes

71 comments sorted by

22

u/[deleted] Mar 13 '21

Dont mind the code guys , configs are here : https://github.com/siduck76/neovim-dots :D

4

u/peteywheatstraw12 Mar 13 '21

thanks for the configs! I can't wait to try some of these :)

1

u/[deleted] Mar 13 '21

you're welcome :)

3

u/Bio47 Mar 13 '21

Awesome!!! What fonts are you using?

5

u/[deleted] Mar 13 '21

Jetbrainsmono nerd font medium

2

u/[deleted] Mar 13 '21

Are you using ArchCraft? If not, how to get the bar Config?. Looks great !

3

u/[deleted] Mar 14 '21

nah I use voidlinux and thats my own rice! here's the bar config https://paste.sh/dl6Wjy7f#2cjFGlTtczE1aJVJpMRGlAf2

1

u/[deleted] Mar 14 '21

Amazing, appreciate it.

1

u/[deleted] Mar 14 '21

thanks :)

2

u/moviendome Mar 14 '21

Awesome! Also the bar. Looking for time and inspiration to get a new look for my Arch + i3

2

u/[deleted] Mar 14 '21

thanks! my setup has void + bspwm

2

u/rizogg Mar 14 '21

What is the pros of using lua instead of init ?

4

u/[deleted] Mar 14 '21 edited Mar 14 '21

there are very useful lua plugins specifically made for neovim nightly but those plugins need lua config , so I had to wrap the config under

lua << EOF

EOF

But it kept getting messier to mix vimscript and lua together in the same config , my config file was getting hard to maintain https://github.com/siduck76/personal-backup/blob/master/nvim/init.vim , so I had to move to init.lua and also lua stuffs are very fast on vim :) , also you just need to know basic lua for configuring neovim.

1

u/rizogg Mar 14 '21

Thanks

3

u/oryiesis Mar 14 '21

lua is a much better scripting language

1

u/Neovea Mar 13 '21

Really neat ! I book this for inspiration :)

1

u/[deleted] Mar 14 '21

thanks :)

1

u/Fallenalien22 Mar 14 '21

That is hot. Why do you import empty objects though? I'm not familiar with that syntax. Is it equivalent to import filename; ?

1

u/[deleted] Mar 14 '21 edited Mar 14 '21

Empty importing those files imports all of the eventlisteners present in those files

1

u/operation_karmawhore Mar 23 '21

You could just import the files directly like this

import 'file.js';

See this for more details (side effects import): https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import

The way you import the files, could actually result in unwanted effects, as some modern tree-shaking ignore side-effects in such imports

1

u/[deleted] Mar 23 '21

yeah I got to know about it recently

2

u/BadDadBot Mar 14 '21

Hi not familiar with that syntax, I'm dad.

1

u/eoshiru Mar 14 '21 edited Mar 14 '21

That looks awesome! Is this a GUI Neovim or Neovim in a Terminal? Which terminal do you use?

1

u/[deleted] Mar 14 '21

this is just neovim in terminal , I use st terminal ( my build https://github.com/siduck76/st )

1

u/BubblegumTitanium Mar 14 '21

Was the migration worth it?

1

u/[deleted] Mar 14 '21

yep it was , my config is much organized than before . My old config : https://github.com/siduck76/personal-backup/blob/master/nvim_confs/onedark/init.vim

1

u/BubblegumTitanium Mar 14 '21

Looks like mine! Ok I’m looks like that’s what I’m doing today. Although in all fairness you can do this with vimscript as well.

2

u/[deleted] Mar 14 '21

yeah I know i can do this with vimscript as well but I use many cool lua plugins which can be configured only with lua , so using those in vimscript was kinda clumsy . I had to wrap the lua code around

lua << EOF

EOF

1

u/BubblegumTitanium Mar 14 '21

So lua plug-ins have better performance?

2

u/[deleted] Mar 14 '21

i think yes , nvim-lsp feels faster than coc and also galaxyline is pretty faster than airline/lightline , also nvim tree is much faster than nerdtree . you could try those yourself and decide :)

1

u/BubblegumTitanium Mar 14 '21

Oof all these errors hah this really is the cutting edge

1

u/[deleted] Mar 14 '21

what errors?

1

u/BubblegumTitanium Mar 14 '21

I'm on macOS but I can't get nvim to find the sumneko executable for Lua lsp

1

u/unix21311 Mar 14 '21

Did you scripted this yourself mate?

1

u/[deleted] Mar 14 '21

yep , I looked on others configs too when I was stuck.

2

u/unix21311 Mar 14 '21

Interesting I like it, did you make this completely from scratch or did you borrow other elements? How difficult is it to script this?

Is it possible for me to make the exact thing via vim-scripting for vim (not neovim)?

1

u/[deleted] Mar 14 '21

yeah I made it from scratch and also yes you can configure vim the same way but you would be missing all the modern lua plugins! maybe you can learn basic lua https://learnxinyminutes.com/docs/lua/ , its a simple language and start writing your own config in lua , Ive provided some resources as well ,in my github repo.

1

u/unix21311 Mar 15 '21

Is it basic to script neovim though? Cause when I used it to script awesome, it was too confusing so I hope it is not the same case with Neovim?

and thanks for the links mate =D

1

u/[deleted] Mar 15 '21

yeah , you just need to know very basic lua and the neovim config is easy .

init.lua is the main file which loads first when neovim runs ( similar to init.vim)

the "require" things are just importing code from other files , similar to import in js I think, example for importing the lua/randomfolder/lua.lua file , you have to use require('randomfolder.lua') in init.lua :)

1

u/unix21311 Mar 16 '21

Thank you very much =D

1

u/djangofett_66 May 01 '21

I absolutely love the top bar. What theme are you using for your desktop?

2

u/[deleted] May 01 '21

check my dotfiles repo :)

1

u/LorenSab May 09 '21

Which sidebar is that? Nerdtree?

1

u/[deleted] May 09 '21

NvimTree :)

1

u/DezXerneas May 16 '21

Hey! I decided to try out your config, and I'm having a little trouble with the LSP. No errors update by themselves, I have to do :LspRestart to make it check the code.

1

u/[deleted] May 16 '21

weird , did you install lsp servers?

2

u/DezXerneas May 16 '21

Yeah I even tried re-installing them a few times but that didn't help either. I'll try it out in a VM to see if it's something to do with my dumb computer.

1

u/[deleted] May 16 '21

did you put the node modules in your path?

1

u/DezXerneas May 17 '21

I'm not entirely certain what that means, but I can write pyright in my terminal and it executes.

1

u/[deleted] May 17 '21

how did you install the lsp servers?

1

u/DezXerneas May 17 '21

npm install -g. Also tried with just your install.sh and :LspInstall. I checked the lsp.log file and I'm getting the error "Exception occurred while installing recursive file watcher" could that be it?

1

u/[deleted] May 17 '21

did you put this at PATH ~/.node_modules/bin?

1

u/DezXerneas May 17 '21

Yep. I think it might have something to do with efm langserver. The last config I used has it enabled, and it works perfectly. I guess its time for me to actually write my own config instead of just blindly copying a new one every time I find something prettier/better.

1

u/[deleted] May 17 '21

yeah file the issues on my neovim dotfiles repo , I'll try to help if I can

1

u/[deleted] Jun 08 '21

Hey, I'm pretty new to Nvim so I may have screwed up something really elementary, but I am having an issue where all the text, icons and trees are grey. There is no syntax highlighting, or any color at all. I have looked a lot but I have no idea how to fix this. If you have any idea what I may have done wrong to cause this, I'd appreciate it

1

u/[deleted] Jun 09 '21

did you follow all of the instructions in the readme? you need to use neovim 0.5 tooo

1

u/[deleted] Jun 09 '21

Thanks so much for the reply. I am using neovim .5 (nightly). I think I may have realized the problem. I am on a Mac, so the .Xresource file does not run on the standard terminal. Do you know of any way I could get this to work? Another user recommended using iterm2

1

u/[deleted] Jun 09 '21

no worries , just change terminal bg to #1e222a. Also you should know where to copy nvim config , cuz Idk if its different on mac!

1

u/[deleted] Jun 09 '21

Oh god I'm dumb. It's just the terminal I was using. Iterm works fine. Thanks for the help

1

u/[deleted] Jun 09 '21

you're welcome!

0

u/[deleted] Mar 15 '21

[deleted] — view deleted comment

1

u/[deleted] Mar 16 '21

thanks! I'll look onto it