1
0
Fork 0
mirror of https://github.com/pnx/dotfiles synced 2026-06-16 03:14:55 +02:00
dotfiles/nvim/lua/config/indent.lua

31 lines
646 B
Lua

local autocmd = vim.api.nvim_create_autocmd
local augroup = vim.api.nvim_create_augroup
local set = vim.opt
set.tabstop = 4
set.softtabstop = 4
set.shiftwidth = 4
set.autoindent = true
augroup('indent', { clear = true })
-- Hardtabs for make
autocmd('Filetype', {
group = 'indent',
pattern = { 'make' },
command = 'setlocal ts=4 sts=0 sw=4 noexpandtab'
})
-- Softtab (2) for yaml
autocmd('Filetype', {
group = 'indent',
pattern = { 'yaml' },
command = 'setlocal ts=2 sts=2 sw=2 expandtab'
})
-- Hardtabs for c/cpp
autocmd('Filetype', {
group = 'indent',
pattern = { 'c', 'cpp' },
command = 'setlocal ts=8 sts=0 sw=8 noexpandtab'
})