mirror of
https://github.com/pnx/dotfiles
synced 2026-06-18 20:10:03 +02:00
nvim/lua/user/utils/indent.lua: document parameters and minor updates
This commit is contained in:
parent
f8d96a05da
commit
fad0842b76
1 changed files with 5 additions and 2 deletions
|
|
@ -1,15 +1,18 @@
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
|
---@param width number?
|
||||||
function M.setHardtabs(width)
|
function M.setHardtabs(width)
|
||||||
width = width or 8
|
width = width or 8
|
||||||
vim.cmd(string.format("setlocal noet ts=%s sts=0 sw=0", width))
|
vim.cmd(string.format("setlocal noet ts=%s sts=0 sw=0", width))
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param width number
|
---@param width number
|
||||||
|
---@param isLocal boolean?
|
||||||
function M.setSofttabs(width, isLocal)
|
function M.setSofttabs(width, isLocal)
|
||||||
isLocal = (isLocal or false) and "local" or ""
|
isLocal = isLocal or false
|
||||||
vim.cmd(string.format("set%s et ts=%s sts=0 sw=%s", isLocal, width, width))
|
vim.cmd(string.format("set%s et ts=%s sts=0 sw=%s",
|
||||||
|
isLocal and "local" or "", width, width))
|
||||||
end
|
end
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue