diff options
| author | bh <qn+git@excalibur.computer> | 2026-04-27 16:52:50 +0800 |
|---|---|---|
| committer | bh <qn+git@excalibur.computer> | 2026-04-27 16:52:50 +0800 |
| commit | 1b2c0c6a530b9f67925b3267d5d2fa791b9b2047 (patch) | |
| tree | a52ca6271a6434ebec6a6f304f5b4c1cc1b80a75 /init.lua | |
| parent | 86ef0a045c44c756b33a93079fb00bbb81c6e217 (diff) | |
Only enforce tabs on specific languages
Diffstat (limited to 'init.lua')
| -rw-r--r-- | init.lua | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -63,11 +63,10 @@ vim.api.nvim_set_hl(0, 'LineNr', { fg = '#74c4c4', bg = 'NONE' }) vim.api.nvim_set_hl(0, 'CursorLineNr', { fg = '#74c4c4', bg = 'NONE' }) --- Tab Spaces +-- Tab/Space defaults (spaces for most languages) vim.cmd("set tabstop=4") vim.cmd("set shiftwidth=4") --- vim.cmd("set expandtab") -vim.cmd("set noexpandtab") +vim.cmd("set expandtab") vim.cmd("set smarttab") -- Indentation Options @@ -75,6 +74,16 @@ vim.opt.indentkeys:remove(":") vim.opt.cinkeys:remove(":") vim.opt.smartindent = true +-- Tabs for C/C++/Zig/Go/Lua/Shell +vim.api.nvim_create_autocmd("FileType", { + pattern = { "c", "cpp", "zig", "go", "lua", "sh", "zsh", "bash" }, + callback = function() + vim.bo.expandtab = false + vim.bo.tabstop = 4 + vim.bo.shiftwidth = 4 + end, +}) + -------------------------------------------------------- |
