1
0
Fork 0

nvim: remove trouble

This commit is contained in:
Vladimír Dudr 2024-08-09 07:19:14 +02:00
parent 4185d1869c
commit 03572ec37b
5 changed files with 54 additions and 96 deletions

View file

@ -101,12 +101,12 @@ function M.setup()
if bo.filetype == 'help' and bo.buftype ~= 'help' then
return
end
vim.bo[buf].buflisted = false
bo.buflisted = false
vim.opt_local.number = false
vim.opt_local.signcolumn = 'no'
vim.keymap.set('n', 'q', '<Cmd>:q<CR>', { buffer = buf })
if vim.bo[buf].filetype ~= 'qf' then
if bo.filetype ~= 'qf' then
vim.opt_local.statusline = '%Y | %f%=%l:%v %P'
end
@ -114,21 +114,6 @@ function M.setup()
end,
})
vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' }, {
pattern = { 'Trouble' },
callback = function(args)
local opts = require('trouble.config').options
local words = vim.split(opts.mode, '[%W]', {})
for i, word in ipairs(words) do
words[i] = word:sub(1, 1):upper() .. word:sub(2)
end
vim.b[args.buf].trouble_mode = table.concat(words, ' ')
vim.opt_local.statusline = '%Y [%{b:trouble_mode}]%=%P'
end,
})
vim.diagnostic.config({
virtual_text = false
-- virtual_text = {

View file

@ -79,42 +79,11 @@ function M.config()
link('@variable', 'Identifier')
end -- }}}
local function normalizeTroubleHighlight() -- {{{
copyFg('TroubleText', 'Normal')
copyFg('TroubleFoldIcon', 'CursorLineNr')
copyFg('TroubleLocation', 'LineNr')
copyFg('TroubleIndent', 'LineNr')
copyFg('TroubleSignInformation', 'DiagnosticSignInfo')
-- TroubleCount xxx links to TabLineSel
-- copyFg('TroubleError', 'DiagnosticError')
link('TroubleSignError', 'DiagnosticError')
link('TroubleSignWarning', 'DiagnosticWarn')
link('TroubleSignHint', 'DiagnosticHint')
vim.api.nvim_set_hl(0, 'TroubleNormal', {})
end -- }}}
local function customLinks()
copyFg('Function', 'Normal')
copyFg('Operator', 'Normal')
end
local troublegr = vim.api.nvim_create_augroup('TroubleCursorline', { clear = true })
vim.api.nvim_create_autocmd('WinEnter', {
group = troublegr,
pattern = '*Trouble',
callback = function()
vim.wo.cursorline = true
end,
})
vim.api.nvim_create_autocmd('WinLeave', {
group = troublegr,
pattern = '*Trouble',
callback = function()
vim.wo.cursorline = false
end,
})
local augr = vim.api.nvim_create_augroup('config_colorscheme', {});
vim.api.nvim_create_autocmd('Colorscheme', {
group = augr,
@ -124,7 +93,6 @@ function M.config()
customLinks()
normalizeTerminal()
normalizeCmpKindHighlight()
normalizeTroubleHighlight()
end,
})

View file

@ -11,6 +11,7 @@ local server_configs = function()
-- perlls = {},
cssls = {},
html = {},
htmx = {},
lemminx = {
--{{{
settings = {
@ -190,9 +191,10 @@ local function on_attach(args) -- {{{
floating_window_above_cur_line = false, -- Attempt to float the popup above the cursor position
-- (note, if the height of the float would be greater than the space left above the cursor, it will default
-- to placing the float below the cursor. The max_height option allows for finer tuning of this)
},
display_automatically = true,
silent = true,
},
silent = true,
display_automatically = true,
keymaps = {
next_signature = '<M-j>',
previous_signature = '<M-k>',
@ -223,7 +225,7 @@ local function on_attach(args) -- {{{
vim.keymap.set('n', '<leader>cci', vim.lsp.buf.incoming_calls, mkOpts('LSP incoming calls'))
vim.keymap.set('n', '<leader>cco', vim.lsp.buf.outgoing_calls, mkOpts('LSP outgoing calls'))
-- vim.keymap.set('n', 'gr', vim.lsp.buf.references, mkOpts('LSP references'))
vim.keymap.set('n', '<leader>cr', '<Cmd>Trouble lsp_references<CR>', mkOpts('LSP references'))
vim.keymap.set('n', '<leader>cr', vim.lsp.buf.references, mkOpts('LSP references'))
vim.keymap.set('n', '<leader>cs', '<Cmd>Telescope lsp_document_symbols<CR>', mkOpts('LSP document symbols'))
-- fix omnisharp {{{
@ -362,7 +364,7 @@ return {
config = config,
cmd = { 'LspInfo', 'LspLog', 'LspStart' },
dependencies = {
{ 'folke/neodev.nvim', config = true },
{ 'folke/neodev.nvim', config = true }, -- deprecated! use folke/lazydev.nvim
{ 'j-hui/fidget.nvim', config = true, tag = 'legacy' },
{
'ray-x/lsp_signature.nvim',

View file

@ -70,22 +70,22 @@ return {
keys = {
{
'ii',
function() require('various-textobjs').indentation(true, true) end,
function() require('various-textobjs').indentation('inner', 'inner', 'withBlanks') end,
mode = { 'o', 'x' },
desc =
'Inside indent',
},
{
'ai',
function() require('various-textobjs').indentation(false, false) end,
function() require('various-textobjs').indentation('outer', 'outer', 'withBlanks') end,
mode = { 'o', 'x' },
desc =
'Around indent',
},
-- { 'iI', function() require('various-textobjs').indentation(true, true) end, mode = { 'o', 'x' }, desc = '' },
-- { 'aI', function() require('various-textobjs').indentation(false, false) end, mode = { 'o', 'x' }, desc = '' },
{ 'iS', function() require('various-textobjs').subword(true) end, mode = { 'o', 'x' }, desc = '' },
{ 'aS', function() require('various-textobjs').subword(false) end, mode = { 'o', 'x' }, desc = '' },
{ 'iS', function() require('various-textobjs').subword('inner') end, mode = { 'o', 'x' }, desc = '' },
{ 'aS', function() require('various-textobjs').subword('outer') end, mode = { 'o', 'x' }, desc = '' },
{ '|', function() require('various-textobjs').column() end, mode = { 'o', 'x' }, desc = '' },
{ 'L', function() require('various-textobjs').url() end, mode = { 'o', 'x' }, desc = '' },
-- {"YOUR_MAPPING",function() require("various-textobjs").toNextClosingBracket() end, mode = { "o", "x" }, desc = "" },
@ -194,7 +194,7 @@ return {
local lines = require('lsp_lines')
lines.setup()
vim.diagnostic.config({
virtual_lines = function(ns, bufnr)
virtual_lines = function(_, bufnr)
local ft = vim.api.nvim_get_option_value('filetype', { buf = bufnr })
if ft == 'lazy' then
return false
@ -249,30 +249,33 @@ return {
{ 'williamboman/mason.nvim', cmd = 'Mason', config = true },
{
'mfussenegger/nvim-jdtls',
ft = 'java',
'yorickpeterse/nvim-pqf',
opts = {
signs = {
error = { text = 'E', hl = 'DiagnosticSignError' },
warning = { text = 'W', hl = 'DiagnosticSignWarn' },
info = { text = 'I', hl = 'DiagnosticSignInfo' },
hint = { text = 'H', hl = 'DiagnosticSignHint' },
},
-- By default, only the first line of a multi line message will be shown.
-- When this is true, multiple lines will be shown for an entry, separated by
-- a space
show_multiple_lines = false,
-- How long filenames in the quickfix are allowed to be. 0 means no limit.
-- Filenames above this limit will be truncated from the beginning with
-- `filename_truncate_prefix`.
max_filename_length = 40,
-- Prefix to use for truncated filenames.
filename_truncate_prefix = '[...]',
},
},
{
'folke/trouble.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' },
lazy = true,
cmd = { 'Trouble', 'TroubleToggle' },
keys = {
{ '<Leader>tt', '<Cmd>TroubleToggle<CR>', desc = 'Trouble toggle' },
{ '<Leader>td', '<Cmd>Trouble document_diagnostics<CR>', desc = 'Trouble toggle' },
},
opts = {
mode = 'document_diagnostics',
signs = {
-- icons / text used for a diagnostic
error = '󰅚',
warning = '󰀪',
hint = '󰌶',
information = '',
other = '',
},
},
'mfussenegger/nvim-jdtls',
ft = 'java',
},
{
@ -291,4 +294,5 @@ return {
-- Your DBUI configuration
vim.g.db_ui_use_nerd_fonts = 1
end,
}}
}
}

View file

@ -2,14 +2,13 @@ return {
'folke/which-key.nvim',
config = function()
local wk = require('which-key')
wk.register({
['<Space>f'] = { name = '+file' },
['<Space>g'] = { name = '+git' },
['<Space>l'] = { name = '+LSP' },
['<Space>t'] = { name = '+Trouble' },
['<Space>d'] = { name = '+Debug neovim' },
['<Space>c'] = { name = '+Code' },
['<Space>cc'] = { name = '+calls' },
wk.add({
{'<Space>f', group = 'file' },
{'<Space>g', group = 'git' },
{'<Space>l', group = 'LSP' },
{'<Space>d', group = 'Debug neovim' },
{'<Space>c', group = 'Code' },
{'<Space>cc', group = 'calls' },
})
end,
}