trouble + conform changes

This commit is contained in:
iofq 2025-04-04 19:06:25 -05:00
parent 1013b23483
commit 3dcc3a10e8
2 changed files with 25 additions and 4 deletions

View file

@ -59,7 +59,7 @@ with final.pkgs.lib; let
lua-language-server lua-language-server
nil nil
phpactor phpactor
python312Packages.jedi-language-server basedpyright
#other #other
jujutsu jujutsu

View file

@ -4,6 +4,8 @@ return {
event = 'VeryLazy', event = 'VeryLazy',
opts = { opts = {
pinned = true, pinned = true,
focus = true,
auto_jump = true,
win = { win = {
size = 0.25, size = 0.25,
position = 'right', position = 'right',
@ -16,6 +18,12 @@ return {
'<cmd>Trouble diagnostics toggle<CR>', '<cmd>Trouble diagnostics toggle<CR>',
noremap = true, noremap = true,
desc = 'Trouble diagnostics' desc = 'Trouble diagnostics'
},
{
'<leader>nt',
'<cmd>Trouble qflist<CR>',
noremap = true,
desc = 'Trouble qflist'
} }
} }
}, },
@ -62,10 +70,9 @@ return {
}, },
}, },
} }
lspconfig.jedi_language_server.setup { capabilities = capabilities } lspconfig.basedpyright.setup { capabilities = capabilities }
lspconfig.nil_ls.setup { capabilities = capabilities } lspconfig.nil_ls.setup { capabilities = capabilities }
lspconfig.phpactor.setup { capabilities = capabilities } lspconfig.phpactor.setup { capabilities = capabilities }
lspconfig.ruby_lsp.setup { capabilities = capabilities }
lspconfig.lua_ls.setup { lspconfig.lua_ls.setup {
capabilities = capabilities, capabilities = capabilities,
on_init = function(client) on_init = function(client)
@ -117,6 +124,12 @@ return {
'<cmd>Trouble lsp_definitions toggle win.position=left <CR>', '<cmd>Trouble lsp_definitions toggle win.position=left <CR>',
{ buffer = ev.buf, noremap = true, silent = true, desc = 'Trouble LSP definition' } { buffer = ev.buf, noremap = true, silent = true, desc = 'Trouble LSP definition' }
) )
vim.keymap.set(
'n',
'grr',
'<cmd>Trouble lsp_references toggle win.position=left <CR>',
{ buffer = ev.buf, noremap = true, silent = true, desc = 'Trouble LSP definition' }
)
vim.keymap.set( vim.keymap.set(
'n', 'n',
'grl', 'grl',
@ -144,7 +157,8 @@ return {
'stevearc/conform.nvim', 'stevearc/conform.nvim',
event = 'VeryLazy', event = 'VeryLazy',
keys = { keys = {
{ "\\f", function() require("conform").format({}) end, mode = { "n", "x" } }, { "\\f", function() vim.b.disable_autoformat = not vim.b.disable_autoformat end, mode = { "n", "x" } },
{ "\\F", function() vim.g.disable_autoformat = not vim.g.disable_autoformat end, mode = { "n", "x" } },
}, },
opts = { opts = {
notify_no_formatters = false, notify_no_formatters = false,
@ -153,6 +167,13 @@ return {
puppet = { "puppet-lint" }, puppet = { "puppet-lint" },
['*'] = { 'trim_whitespace' } ['*'] = { 'trim_whitespace' }
}, },
format_on_save = function(bufnr)
-- Disable with a global or buffer-local variable
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
return
end
return { timeout_ms = 500, lsp_format = "last" }
end,
default_format_opts = { default_format_opts = {
timeout_ms = 500, timeout_ms = 500,
lsp_format = "last", lsp_format = "last",