nvim/lua/user/plugins/lsp/conform.lua
Hoang Nguyen 0c9e4d20e0
Use aerial.nvim for the breadcrumbs on winbar
Also:
- remove `nvim-navic` from the plugin tree (covered by aerial.nvim now)
- add more filetypes to filetype.lua
- rework heirline's configuration structure to be cleaner
- add some more LSP servers + remove glint
2024-02-13 00:00:00 +07:00

32 lines
975 B
Lua

local vars = require('user.config.vars')
local linters_path = vim.fn.stdpath('data') .. '/lint'
return {
log_level = vars.loglevel,
notify_on_error = true,
format_on_save = function()
if not vars.lsp_format_on_save then
return
end
return { timeout_ms = 500, lsp_fallback = true }
end,
formatters_by_ft = {
cue = { 'cue_fmt' },
proto = { 'buf' },
fish = { 'fish_indent' },
go = { 'goimports', 'gofumpt' },
sh = { 'shfmt' },
sql = { 'sql_formatter' },
lua = { 'stylua' },
c = { 'clang_format' },
cpp = { 'clang_format' },
rego = { 'opa_fmt' },
-- ['*'] = { 'codespell' },
},
formatters = {
codespell = { command = linters_path .. '/codespell/bin/codespell' },
gofumpt = { args = { '-extra' } },
sql_formatter = { command = linters_path .. '/sql_formatter/node_modules/.bin/sql-formatter' },
},
}