- Refactor dap.lua debugger configuration - Update neotest.lua test runner setup - Simplify linting.lua and formatting.lua configs - Restructure snippets.lua for better organization
40 lines
1.1 KiB
Lua
Executable file
40 lines
1.1 KiB
Lua
Executable file
return {
|
|
'stevearc/conform.nvim',
|
|
event = { 'BufReadPost', 'BufNewFile' },
|
|
opts = {
|
|
formatters = {
|
|
juliaformatter = {
|
|
command = 'julia',
|
|
args = {
|
|
'--project=' .. vim.fn.expand('~/.julia/environments/nvim-format'),
|
|
'--startup-file=no',
|
|
'--history-file=no',
|
|
'-e',
|
|
'using JuliaFormatter; print(format_text(read(stdin, String)))',
|
|
},
|
|
stdin = true,
|
|
},
|
|
},
|
|
formatters_by_ft = {
|
|
python = { 'ruff_fix', 'ruff_format', 'ruff_organize_imports' },
|
|
yaml = { 'yamlfmt' },
|
|
sh = { 'shfmt' },
|
|
sql = { 'sqlfluff' },
|
|
lua = { 'stylua' },
|
|
json = { 'jq' },
|
|
julia = { 'juliaformatter' },
|
|
markdown = { 'prettierd' },
|
|
},
|
|
format_on_save = function(bufnr)
|
|
-- julia formatter is slow, skip on save
|
|
if vim.bo[bufnr].filetype == 'julia' then
|
|
return
|
|
end
|
|
return { timeout_ms = 2000, lsp_fallback = true }
|
|
end,
|
|
notify_on_error = true,
|
|
},
|
|
config = function(_, opts)
|
|
require('conform').setup(opts)
|
|
end,
|
|
}
|