Enable PHP autoindent and smartindent settings
Re-enable autoindent and smartindent for PHP files to ensure proper indentation according to WordPress coding standards.
This commit is contained in:
parent
e450617eb6
commit
486dbef96a
|
|
@ -25,12 +25,6 @@ vim.api.nvim_create_autocmd("FileType", {
|
||||||
vim.opt_local.tabstop = 2 -- Display tabs as 2 spaces wide
|
vim.opt_local.tabstop = 2 -- Display tabs as 2 spaces wide
|
||||||
vim.opt_local.shiftwidth = 2 -- Indent/outdent by 2 columns (one tab)
|
vim.opt_local.shiftwidth = 2 -- Indent/outdent by 2 columns (one tab)
|
||||||
vim.opt_local.softtabstop = 2 -- Tab key inserts 2 columns (one tab)
|
vim.opt_local.softtabstop = 2 -- Tab key inserts 2 columns (one tab)
|
||||||
|
|
||||||
-- Fix: Neovim's built-in PHP indent sets indentexpr but breaks autoindent
|
|
||||||
-- Re-enable autoindent/smartindent and clear the broken indentexpr
|
|
||||||
vim.opt_local.autoindent = true
|
|
||||||
vim.opt_local.smartindent = true
|
|
||||||
vim.opt_local.indentexpr = "" -- Clear GetPhpIndent(), use smartindent instead
|
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,9 +58,12 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Indentation (experimental, disable if issues)
|
-- Indentation: Enable for languages with good indent queries
|
||||||
|
-- PHP requires this because GetPhpIndent() depends on Vim syntax (disabled by Treesitter)
|
||||||
indent = {
|
indent = {
|
||||||
enable = false, -- Start disabled; can enable per-filetype if stable
|
enable = true,
|
||||||
|
-- Disable for languages with poor/incomplete indent queries if needed
|
||||||
|
disable = {},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Textobjects
|
-- Textobjects
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue