mirror of
https://github.com/iofq/nvim.nix.git
synced 2026-01-23 08:55:16 -06:00
nixfmt, callHierarchy
This commit is contained in:
parent
ec4206b55a
commit
d7ae87e671
3 changed files with 55 additions and 42 deletions
|
|
@ -47,7 +47,7 @@ let
|
||||||
yamllint
|
yamllint
|
||||||
jq
|
jq
|
||||||
hadolint
|
hadolint
|
||||||
alejandra
|
nixfmt
|
||||||
shellcheck
|
shellcheck
|
||||||
|
|
||||||
# LSPs
|
# LSPs
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,13 @@ return {
|
||||||
require('plugins.lib.snacks').diagnostics { cwd = false }
|
require('plugins.lib.snacks').diagnostics { cwd = false }
|
||||||
end, { buffer = ev.buf, desc = 'LSP diagnostics' })
|
end, { buffer = ev.buf, desc = 'LSP diagnostics' })
|
||||||
|
|
||||||
|
vim.keymap.set('n', 'grc', function()
|
||||||
|
vim.lsp.buf.incoming_calls()
|
||||||
|
end, { buffer = ev.buf, desc = 'LSP incoming_calls' })
|
||||||
|
vim.keymap.set('n', 'gro', function()
|
||||||
|
vim.lsp.buf.outgoing_calls()
|
||||||
|
end, { buffer = ev.buf, desc = 'LSP outgoing_calls' })
|
||||||
|
|
||||||
-- Auto-refresh code lenses
|
-- Auto-refresh code lenses
|
||||||
if client.server_capabilities.codeLensProvider then
|
if client.server_capabilities.codeLensProvider then
|
||||||
vim.api.nvim_create_autocmd({ 'InsertLeave', 'TextChanged' }, {
|
vim.api.nvim_create_autocmd({ 'InsertLeave', 'TextChanged' }, {
|
||||||
|
|
@ -108,7 +115,7 @@ return {
|
||||||
puppet = { 'puppet-lint' },
|
puppet = { 'puppet-lint' },
|
||||||
lua = { 'stylua' },
|
lua = { 'stylua' },
|
||||||
python = { 'ruff' },
|
python = { 'ruff' },
|
||||||
nix = { 'alejandra' },
|
nix = { 'nixfmt' },
|
||||||
fish = { 'fish_indent' },
|
fish = { 'fish_indent' },
|
||||||
['*'] = { 'trim_whitespace' },
|
['*'] = { 'trim_whitespace' },
|
||||||
},
|
},
|
||||||
|
|
@ -117,7 +124,7 @@ return {
|
||||||
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
if vim.g.disable_autoformat or vim.b[bufnr].disable_autoformat then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
return { timeout_ms = 500, lsp_format = 'last' }
|
return { timeout_ms = 1500, lsp_format = 'fallback' }
|
||||||
end,
|
end,
|
||||||
default_format_opts = {
|
default_format_opts = {
|
||||||
timeout_ms = 1500,
|
timeout_ms = 1500,
|
||||||
|
|
@ -141,7 +148,14 @@ return {
|
||||||
nix = { 'nix' },
|
nix = { 'nix' },
|
||||||
php = { 'php' },
|
php = { 'php' },
|
||||||
}
|
}
|
||||||
vim.api.nvim_command('au BufWritePost * lua require("lint").try_lint()')
|
vim.api.nvim_create_autocmd({ 'BufEnter', 'BufWritePost', 'InsertLeave' }, {
|
||||||
|
group = vim.api.nvim_create_augroup('lint', { clear = true }),
|
||||||
|
callback = function()
|
||||||
|
if vim.bo.modifiable then
|
||||||
|
require('lint').try_lint()
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,54 +1,53 @@
|
||||||
return {
|
return {
|
||||||
{
|
{
|
||||||
'nvim-treesitter/nvim-treesitter',
|
"nvim-treesitter/nvim-treesitter",
|
||||||
event = 'VeryLazy',
|
event = "VeryLazy",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
{
|
{
|
||||||
'nvim-treesitter/nvim-treesitter-context',
|
"nvim-treesitter/nvim-treesitter-context",
|
||||||
opts = {
|
opts = {
|
||||||
max_lines = 2,
|
max_lines = 2,
|
||||||
min_window_height = 50,
|
min_window_height = 50,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||||
'RRethy/nvim-treesitter-textsubjects',
|
"RRethy/nvim-treesitter-textsubjects",
|
||||||
},
|
},
|
||||||
config = function()
|
main = "nvim-treesitter.configs",
|
||||||
require('nvim-treesitter.configs').setup {
|
opts = {
|
||||||
ensure_installed = {},
|
ensure_installed = {},
|
||||||
auto_install = false,
|
auto_install = false,
|
||||||
highlight = {
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
indent = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
matchup = {
|
||||||
|
enable = true,
|
||||||
|
},
|
||||||
|
textobjects = {
|
||||||
|
move = {
|
||||||
enable = true,
|
enable = true,
|
||||||
},
|
goto_next_start = {
|
||||||
indent = {
|
["]a"] = "@parameter.inner",
|
||||||
enable = true,
|
["]f"] = "@function.outer",
|
||||||
},
|
|
||||||
matchup = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
textobjects = {
|
|
||||||
move = {
|
|
||||||
enable = true,
|
|
||||||
goto_next_start = {
|
|
||||||
[']a'] = '@parameter.inner',
|
|
||||||
[']f'] = '@function.outer',
|
|
||||||
},
|
|
||||||
goto_previous_start = {
|
|
||||||
['[a'] = '@parameter.inner',
|
|
||||||
['[f'] = '@function.outer',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
swap = {
|
goto_previous_start = {
|
||||||
enable = true,
|
["[a"] = "@parameter.inner",
|
||||||
swap_next = {
|
["[f"] = "@function.outer",
|
||||||
['a]'] = '@parameter.inner',
|
|
||||||
},
|
|
||||||
swap_previous = {
|
|
||||||
['a['] = '@parameter.inner',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
swap = {
|
||||||
end,
|
enable = true,
|
||||||
|
swap_next = {
|
||||||
|
["a]"] = "@parameter.inner",
|
||||||
|
},
|
||||||
|
swap_previous = {
|
||||||
|
["a["] = "@parameter.inner",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue