I am new to NeoVim. I tried following TJDeVries's tutorial on YouTube and I got NeoVim working with Kickstart.nvim. I wanted to set the Tabspace from the default 2 space to 4 space. I tried doing what The Primeagen in his NeoVim from scratch video and tried doing what he had done. However, it didn't work.
I tried making a separate directory called lua which had indent.lua and linked it to the init.lua file. I had expected it work however it did not. This is what I had typed in the indent.lua file. I know that there is something wrong with this because I had also made a remap.lua file, which contained some remaps and renumbering but it worked when I linked it with init.lua. The following is the code I put in the indent.lua.
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
This did not work. Can anyone help me figure this out?
Try following the Help (:h tabstop
)
This works for me in ~/.config/nvim/lua/init.lua
(2 Chars Tabstop)
-- ~./config/nvim/lua/init.lua
-- called by ~/.config/nvim/init.vim with: lua require("init")
vim.opt.tabstop = 8 -- Always 8 (see :h tabstop)
vim.opt.softtabstop = 2 -- What you expecting
vim.opt.shiftwidth = 2 -- What you expecting
-- vim.opt.expandtab = true -- Works without this
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With