Update settings

This commit is contained in:
Saeed Afzal
2024-04-12 23:54:07 +01:00
parent 088c1e113d
commit 100ea186dd
20 changed files with 128 additions and 814 deletions

23
lua/core/commands.lua Normal file
View File

@@ -0,0 +1,23 @@
local api, opt = vim.api, vim.opt
local function indent(n, expand)
local size = 4
if n ~= "" then size = n end
local num = tonumber(size)
if num then
size = num
end
opt.expandtab = expand
opt.shiftwidth = size
opt.tabstop = size
end
api.nvim_create_user_command("Tabs", function(v)
indent(v.args, false)
end, { nargs = "?" })
api.nvim_create_user_command("Spaces", function(v)
indent(v.args, true)
end, { nargs = "?" })