Nvim lua stuff
Load a file
- Suppose file is ~/.config/nvim/lua/core/chad.lua
- Note that lua dir in your nvim config is already in the runtime!
require 'core.chad'
- If you rename that chad.lua to init.lua
require 'core'
options
vimscript:
set mouse = a
lua:
vim.opt.mouse = "a"
autocmds / augroups
vim.cmd "augroup stuff"
-- multiline :
vim.cmd([[
stuff
stuff
]])
globals
vimscript:
let g:autosave = true
lua:
vim.g.autosave = true
- multiline global stuff
vimscript:
let g:nvim_tree_show_icons = {
\ 'git': 1,
\ 'folders': 0,
\ }
lua:
vim.g.nvim_tree_show_icons = {
git = 1,
folders = 0,
}
check nvim-lua guide for better explanation and more info!