I haven’t even used Nvim that much and spent lots of time configuring it first, and now I’ve ended up with an init.lua of >700 lines and a plugins file >600 lines. They’re both very disorganized, how do you guys handle your files? In CSS I split up files into regions using comments and search for the region name, but it looks like there aren’t standards for making regions like that in code.
You can still use comments and regions, 700 lines is nothing
My init.lua is few lines long, but whole nvim directory has A LOT of files. Just do what you are comfortable with.
1 Like
You can:
- create a ‘lua’ directory next to your init.lua.
- Split your init.lua code into separate files (modules).
- require(‘file_name’) in your init. (file_name without lua extension).
To understand more, a quick read about lua (and lua modules) is not hard to reason about. I’m on mobile, so I can’t add references, sorry. But they are not hard to find.