diff --git a/dot_config/nvim/lua/configs/options.lua b/dot_config/nvim/lua/configs/options.lua index 9273a29..dc4323d 100644 --- a/dot_config/nvim/lua/configs/options.lua +++ b/dot_config/nvim/lua/configs/options.lua @@ -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', ':q', { 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 = { diff --git a/dot_config/nvim/lua/configs/packages/colors.lua b/dot_config/nvim/lua/configs/packages/colors.lua index d5ce7f8..1d75444 100644 --- a/dot_config/nvim/lua/configs/packages/colors.lua +++ b/dot_config/nvim/lua/configs/packages/colors.lua @@ -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, }) diff --git a/dot_config/nvim/lua/configs/packages/lsp.lua b/dot_config/nvim/lua/configs/packages/lsp.lua index eb3ce71..6eddcbf 100644 --- a/dot_config/nvim/lua/configs/packages/lsp.lua +++ b/dot_config/nvim/lua/configs/packages/lsp.lua @@ -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) + silent = true, }, - display_automatically = true, silent = true, + display_automatically = true, keymaps = { next_signature = '', previous_signature = '', @@ -223,7 +225,7 @@ local function on_attach(args) -- {{{ vim.keymap.set('n', 'cci', vim.lsp.buf.incoming_calls, mkOpts('LSP incoming calls')) vim.keymap.set('n', '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', 'cr', 'Trouble lsp_references', mkOpts('LSP references')) + vim.keymap.set('n', 'cr', vim.lsp.buf.references, mkOpts('LSP references')) vim.keymap.set('n', 'cs', 'Telescope lsp_document_symbols', 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', diff --git a/dot_config/nvim/lua/configs/packages/misc.lua b/dot_config/nvim/lua/configs/packages/misc.lua index 3888153..c3a7cc6 100644 --- a/dot_config/nvim/lua/configs/packages/misc.lua +++ b/dot_config/nvim/lua/configs/packages/misc.lua @@ -9,13 +9,13 @@ return { { 'ThePrimeagen/harpoon', keys = { - { 'fm', function() require('harpoon.mark').add_file() end, desc = 'Harpoon mark file' }, - { 'fh', function() require('harpoon.ui').toggle_quick_menu() end, desc = 'Harpoon menu' }, - { '', function() require('harpoon.ui').nav_file(1) end, desc = 'Harpoon file 1' }, - { '', function() require('harpoon.ui').nav_file(2) end, desc = 'Harpoon file 2' }, - { '', function() require('harpoon.ui').nav_file(3) end, desc = 'Harpoon file 3' }, - { '', function() require('harpoon.ui').nav_file(4) end, desc = 'Harpoon file 4' }, - { '', function() require('harpoon.ui').nav_file(5) end, desc = 'Harpoon file 5' }, + { 'fm', function() require('harpoon.mark').add_file() end, desc = 'Harpoon mark file' }, + { 'fh', function() require('harpoon.ui').toggle_quick_menu() end, desc = 'Harpoon menu' }, + { '', function() require('harpoon.ui').nav_file(1) end, desc = 'Harpoon file 1' }, + { '', function() require('harpoon.ui').nav_file(2) end, desc = 'Harpoon file 2' }, + { '', function() require('harpoon.ui').nav_file(3) end, desc = 'Harpoon file 3' }, + { '', function() require('harpoon.ui').nav_file(4) end, desc = 'Harpoon file 4' }, + { '', function() require('harpoon.ui').nav_file(5) end, desc = 'Harpoon file 5' }, }, }, @@ -70,24 +70,24 @@ 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 = '' }, - { '|', function() require('various-textobjs').column() end, mode = { 'o', 'x' }, desc = '' }, - { 'L', function() require('various-textobjs').url() 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 = "" }, -- {"YOUR_MAPPING",function() require("various-textobjs").restOfParagraph() end, mode = { "o", "x" }, desc = "" }, -- {"YOUR_MAPPING",function() require("various-textobjs").entireBuffer() 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 = { - { 'tt', 'TroubleToggle', desc = 'Trouble toggle' }, - { 'td', 'Trouble document_diagnostics', 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, - }} + } +} diff --git a/dot_config/nvim/lua/configs/packages/which-key.lua b/dot_config/nvim/lua/configs/packages/which-key.lua index 46e795e..2d31f4d 100644 --- a/dot_config/nvim/lua/configs/packages/which-key.lua +++ b/dot_config/nvim/lua/configs/packages/which-key.lua @@ -2,14 +2,13 @@ return { 'folke/which-key.nvim', config = function() local wk = require('which-key') - wk.register({ - ['f'] = { name = '+file' }, - ['g'] = { name = '+git' }, - ['l'] = { name = '+LSP' }, - ['t'] = { name = '+Trouble' }, - ['d'] = { name = '+Debug neovim' }, - ['c'] = { name = '+Code' }, - ['cc'] = { name = '+calls' }, + wk.add({ + {'f', group = 'file' }, + {'g', group = 'git' }, + {'l', group = 'LSP' }, + {'d', group = 'Debug neovim' }, + {'c', group = 'Code' }, + {'cc', group = 'calls' }, }) end, }