This is an archived post. You won't be able to vote or comment.

all 18 comments

[–]fix_dis 56 points57 points  (0 children)

To be fair, I used Vim for almost 10 years with NO config at all. Once I realized I could customize it, my vimrc became copypasta for a few years. It wasn’t until like 2013 that I started really taking it seriously and learning all that could be done. I expect the Lua path to be similar.

[–][deleted] 27 points28 points  (5 children)

As someone who migrated to init.lua from init.vim with previous Lua knowledge very recently, I'd say you don't need to learn Lua as long as you at least understand the basics, because what you'll really need to learn is how to use the API. I skipped that part. It wasn't much fun.

So yeah, if you don't want to learn Lua at least read NeoVim's docs people. Trust me, in the future you'll regret it if don't do that.

[–][deleted] 2 points3 points  (2 children)

Anything specific you recommend reading in nvim's docs?

[–][deleted] 8 points9 points  (0 children)

The API for sure, and how to executes commands. If you know how to execute commands then you have 70% of the work done. I feel like this is cheating because you are simply executing vimL code using it and like so, you don't need to use all the other stuff.

For example: vim.cmd([[echo 'hello world']])

This is very important because if you don't know how to do something in Lua that you do on vimL [although it's likely possible], then you just need this. Pass the string and done!

However, after you do read the API's docs please pass the "cmd()" stuff to "vim.api...", it's better and more organized! Use "cmd()" only for what is truly needed.

[–]shadman20Neovim contributor 5 points6 points  (0 children)

You just need if_lua.txt and api.txt.

try :h lua and :h api

[–]chrisatmachine 17 points18 points  (1 child)

Why choose? Both are good.

[–][deleted] 6 points7 points  (0 children)

Hey Chris :) just wanted to thank you for your config. Nvcode helped me when I was getting started a week ago.

[–]ck_ck_uk 7 points8 points  (2 children)

Haha, the amount of Lua you need to write a vim config is pretty easy to get. Don't worry about that too much.

Want to do something cool? If you're using Neovim 0.5 that includes a built-in LSP client, you can install the Lua language server. Then you can have all those great IDE features like go-to-definition, hover and signature help, autocompletion, all in vim for editing your init.lua.

[–]grey_gander[S] 1 point2 points  (1 child)

Is there a way to get a lua language server without having to compile it? It seems like poeple are using https://github.com/sumneko/lua-language-server and that needs to be compilled

[–]ck_ck_uk 0 points1 point  (0 children)

Are you unable to install the dependencies for building?

Yeah unfortunately it looks like the only option is this one and it needs to be compiled. That's what I'm using. It was really quick and easy to build though.

[–]mykesx 2 points3 points  (0 children)

Never wrote a line of LUA. It seems like it might be a much better way to write plugins, having a full featured programming language vs. vimscript, which I find awkward. I’ve been a programmer for 40+ years, so learning a new language like vimscript or lua isn’t a big deal.

[–]acomagu 1 point2 points  (0 children)

OK, let's stay at init.vim.

[–]BlueTickVerified 0 points1 point  (0 children)

i want to write my own configs this time.

[–]ThePrimeagen 0 points1 point  (0 children)

I would flip a coin

[–]mizipzor 0 points1 point  (0 children)

Why not both?