mirror of
https://github.com/pnx/dotfiles
synced 2026-06-16 19:30:01 +02:00
32 lines
669 B
Lua
32 lines
669 B
Lua
local autocmd = vim.api.nvim_create_autocmd
|
|
local augroup = vim.api.nvim_create_augroup
|
|
local set = vim.opt
|
|
|
|
-- Default softtab (4)
|
|
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'
|
|
})
|