nvim indent

This commit is contained in:
thek4n 2024-01-16 16:59:48 +03:00
parent 4d78079475
commit 57537c8370
3 changed files with 5 additions and 6 deletions

View File

@ -2,4 +2,4 @@ local opt = vim.opt_local
opt.tabstop = 2
opt.softtabstop = 2
opt.shiftwidth = 2
opt.shiftwidth = vim.bo.tabstop

View File

@ -29,9 +29,9 @@ opt.hidden = true
opt.expandtab = true -- spaces instead of tab
opt.smarttab = true
opt.tabstop = 4 -- 1 tab = .tabstop spaces
opt.tabstop = 4 -- 1 tab appears number spaces
opt.softtabstop = 4
opt.shiftwidth = 4 -- width of 1 tab in spaces
opt.shiftwidth = vim.bo.tabstop -- insert tab or shift inserting .shiftwidth*.tabstop spaces or .shiftwidth/.tabstop tabs
opt.autoindent = true
opt.smartindent = true
opt.showtabline = 2

View File

@ -15,11 +15,10 @@ function get_formatted_virtual_env()
end
function detect_indent_type()
local shiftwidth = vim.bo.shiftwidth
if vim.bo.expandtab then
return shiftwidth .. " spaces"
return "indent: " .. vim.bo.tabstop .. "s"
else
return shiftwidth .. " tab"
return "indent: " .. 1 .. "t = " .. vim.bo.tabstop .. "s"
end
end