added latex support and reorg ftplugins
This commit is contained in:
parent
7f1b34fd6f
commit
f2eaf7c67a
38 changed files with 600 additions and 234 deletions
|
|
@ -6,14 +6,21 @@ return {
|
|||
'BufNewFile',
|
||||
},
|
||||
config = function()
|
||||
-- Linter configurations based on file type
|
||||
require('lint').linters_by_ft = {
|
||||
python = { 'ruff' },
|
||||
go = { 'golangcilint' },
|
||||
yaml = { 'yamllint' },
|
||||
bash = { 'shellcheck' },
|
||||
lua = { 'luacheck' }, -- Added Lua linter
|
||||
rust = { 'clippy' }, -- Use `clippy` for Rust linting
|
||||
dockerfile = { 'hadolint' }, -- Added Dockerfile linter
|
||||
}
|
||||
|
||||
-- Autocommand group for triggering linting
|
||||
local lint_augroup = vim.api.nvim_create_augroup('lint', { clear = true })
|
||||
|
||||
-- Trigger linting on buffer enter, write, and insert leave
|
||||
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
|
||||
group = lint_augroup,
|
||||
callback = function()
|
||||
|
|
@ -21,17 +28,23 @@ return {
|
|||
end,
|
||||
})
|
||||
|
||||
-- Keybinding to manually lint the current buffer
|
||||
vim.keymap.set('n', '<leader>l', function()
|
||||
require('lint').try_lint()
|
||||
end, { desc = 'Lint the current buffer' })
|
||||
|
||||
-- Mason tool installer setup
|
||||
require('mason-tool-installer').setup({
|
||||
ensure_installed = {
|
||||
'ruff',
|
||||
-- 'mypy',
|
||||
'golangci-lint',
|
||||
'yamllint',
|
||||
'ruff', -- Python
|
||||
-- 'mypy', -- Uncomment if needed for additional Python linting
|
||||
'golangci-lint', -- Go
|
||||
'yamllint', -- YAML
|
||||
'shellcheck', -- Bash
|
||||
'luacheck', -- Lua
|
||||
'hadolint', -- Dockerfile
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue