feat: use 4 spaces only for some filetypes

This commit is contained in:
fiplox 2023-02-06 09:58:30 +01:00
parent e9664ee278
commit e15451cec1
2 changed files with 5 additions and 5 deletions

View File

@ -16,10 +16,10 @@ vim.api.nvim_create_autocmd({ 'FileType' }, {
-- use 2 spaces for cpp -- use 2 spaces for cpp
vim.api.nvim_create_autocmd({ 'FileType' }, { vim.api.nvim_create_autocmd({ 'FileType' }, {
pattern = { 'cpp', 'cc', 'hpp', 'hh', 'md', 'markdown' }, pattern = { 'cpp', 'cc', 'hpp', 'hh', 'md', 'markdown', 'java' },
callback = function() callback = function()
vim.opt.ts = 2 vim.opt.ts = 4
vim.opt.sw = 2 vim.opt.sw = 4
vim.opt.expandtab = true vim.opt.expandtab = true
end, end,
}) })

View File

@ -27,8 +27,8 @@ opt.pumheight = 10
opt.fileencoding = 'utf-8' opt.fileencoding = 'utf-8'
opt.splitbelow = true opt.splitbelow = true
opt.splitright = true opt.splitright = true
opt.ts = 4 -- opt.ts = 4
opt.sw = 4 -- opt.sw = 4
opt.smartindent = true opt.smartindent = true
--opt.expandtab " Converts tabs to spaces --opt.expandtab " Converts tabs to spaces
opt.showmode = false opt.showmode = false