1
0
Fork 0

fix per-filetype indentation

This commit is contained in:
Pratham Patel 2023-09-09 10:17:59 +05:30
parent e8283df5bb
commit 865e5b729b
Signed by: thefossguy
SSH Key Fingerprint: SHA256:/B3wAg7jnMEBQ2JwkebbS/eXVZANDmqRfnd9QkIhxMI
15 changed files with 15 additions and 26 deletions

View File

@ -0,0 +1 @@
sh.lua

View File

@ -0,0 +1 @@
vim.cmd('setlocal autoindent noexpandtab tabstop=8 shiftwidth=8 softtabstop=8')

View File

@ -0,0 +1 @@
c.lua

View File

@ -0,0 +1 @@
sh.lua

View File

@ -0,0 +1 @@
c.lua

View File

@ -0,0 +1 @@
vim.cmd('setlocal autoindent expandtab tabstop=2 shiftwidth=2 softtabstop=2')

View File

@ -0,0 +1 @@
vim.cmd('setlocal autoindent expandtab tabstop=2 shiftwidth=2 softtabstop=2')

View File

@ -0,0 +1 @@
rust.lua

View File

@ -0,0 +1 @@
vim.cmd('setlocal autoindent expandtab tabstop=4 shiftwidth=4 softtabstop=4')

View File

@ -0,0 +1 @@
vim.cmd('setlocal autoindent expandtab tabstop=4 shiftwidth=4 softtabstop=4')

View File

@ -0,0 +1 @@
vim.cmd('setlocal autoindent expandtab tabstop=4 shiftwidth=4 softtabstop=4')

View File

@ -0,0 +1 @@
vim.cmd('setlocal autoindent expandtab tabstop=2 shiftwidth=2 softtabstop=2')

View File

@ -0,0 +1 @@
yaml.lua

View File

@ -16,29 +16,3 @@ vim.api.nvim_create_autocmd('BufWritePre', {
pattern = {'*.rs'},
command = 'lua vim.lsp.buf.format(nil, 200)',
})
-- set indentation to 2 spaces for special file types
vim.api.nvim_create_autocmd('FileType', {
pattern = {
'*.lua',
'*.nix',
'*.yaml',
'*.yml',
},
command = 'setlocal autoindent expandtab tabstop=2 shiftwidth=2 softtabstop=2',
})
-- set indentation to 4 spaces for special file types
vim.api.nvim_create_autocmd('FileType', {
pattern = {
'*.bash',
'*.c',
'*.cpp',
'*.dash',
'*.h',
'*.rs',
'*.sh',
'*.toml',
},
command = 'setlocal autoindent expandtab tabstop=4 shiftwidth=4 softtabstop=4',
})

View File

@ -135,6 +135,8 @@ require('lazy').setup({
-- 'gc' to comment visual regions/lines
'numToStr/Comment.nvim',
-- Nix[OS] things
}, {
defaults = {
lazy = true, -- enable lazy-loading of plugins