diff --git a/dot_config/nvim/dot_editorconfig b/dot_config/nvim/dot_editorconfig index 4e27c49..9ecaaff 100644 --- a/dot_config/nvim/dot_editorconfig +++ b/dot_config/nvim/dot_editorconfig @@ -9,5 +9,4 @@ insert_final_newline = true continuation_indent = 2 quote_style = single call_arg_parentheses = keep -table_separator_style = comma trailing_table_separator = smart diff --git a/dot_config/nvim/init.lua b/dot_config/nvim/init.lua index 1d42865..341e81b 100644 --- a/dot_config/nvim/init.lua +++ b/dot_config/nvim/init.lua @@ -19,7 +19,7 @@ require('lazy').setup( -- rtp = { disabled_plugins = { 'netrwPlugin' } }, change_detection = { -- automatically check for config file changes and reload the ui - enabled = true, + enabled = false, notify = false, -- get a notification when changes are found }, } diff --git a/dot_config/nvim/lua/configs/options.lua b/dot_config/nvim/lua/configs/options.lua index 93711b8..adb1c5e 100644 --- a/dot_config/nvim/lua/configs/options.lua +++ b/dot_config/nvim/lua/configs/options.lua @@ -123,10 +123,22 @@ function M.setup() vim.b[args.buf].trouble_mode = table.concat(words, ' ') - vim.wo.statusline = '%Y [%{b:trouble_mode}]%=%P' + vim.opt_local.statusline = '%Y [%{b:trouble_mode}]%=%P' end, }) + vim.diagnostic.config({ + virtual_text = { + format = function(diag) + local s = vim.diagnostic.severity + if diag.severity == s.E or diag.severity == s.W then + return diag.message + end + return nil + end, + }, + }) + if vim.g.neoray then -- {{{ vim.cmd.NeoraySet('CursorAnimTime', 0) vim.cmd.NeoraySet('Transparency', '0.95') diff --git a/dot_config/nvim/lua/configs/packages/lsp.lua b/dot_config/nvim/lua/configs/packages/lsp.lua index 0d33879..fc6386b 100644 --- a/dot_config/nvim/lua/configs/packages/lsp.lua +++ b/dot_config/nvim/lua/configs/packages/lsp.lua @@ -186,10 +186,9 @@ local function config() -- {{{ local nvim_lsp = require('lspconfig') - -- Use a loop to conveniently both setup defined servers - -- and map buffer local keybindings when the language server attaches local servers = { - -- powershell_es = {}, + -- {{{ + powershell_es = {}, gopls = {}, clangd = {}, zls = {}, @@ -205,15 +204,8 @@ local function config() -- {{{ -- {{{ handlers = { ['textDocument/definition'] = require('omnisharp_extended').handler, - -- ['textDocument/publishDiagnostics'] = vim.lsp.with( - -- vim.lsp.diagnostic.on_publish_diagnostics, { - -- virtual_text = { - -- severity = { vim.diagnostic.severity.WARN, vim.diagnostic.severity.ERROR }, - -- }, - -- } - -- ), }, - cmd = { 'omnisharp' }, + cmd = { 'omnisharp', 'RoslynExtensionsOptions:EnableDecompilationSupport=true' }, enable_editorconfig_support = true, enable_ms_build_load_projects_on_demand = false, enable_roslyn_analyzers = true, @@ -293,6 +285,7 @@ local function config() -- {{{ }, }, -- }}} } + -- }}} local mlsp = require('mason-lspconfig') local available = mlsp.get_available_servers() @@ -301,7 +294,7 @@ local function config() -- {{{ for name, conf in pairs(servers) do conf.capabilities = capabilities nvim_lsp[name].setup(conf) - if vim.tbl_contains(available, name) then + if vim.tbl_contains(available, name) and name ~= 'phpactor' then ensure[#ensure + 1] = name end end diff --git a/dot_config/nvim/lua/configs/packages/misc.lua b/dot_config/nvim/lua/configs/packages/misc.lua index 61cec6e..472a2a3 100644 --- a/dot_config/nvim/lua/configs/packages/misc.lua +++ b/dot_config/nvim/lua/configs/packages/misc.lua @@ -1,13 +1,15 @@ return { - { 'norcalli/nvim-colorizer.lua', + { + 'norcalli/nvim-colorizer.lua', config = true, - keys = { { 'oc', 'ColorizerToggle' } }, + keys = { { 'oc', 'ColorizerToggle', desc = 'Toggle colorizer' } }, cmd = 'ColorizerToggle', }, - { 'AndrewRadev/linediff.vim', cmd = 'Linediff' }, + { 'AndrewRadev/linediff.vim', cmd = 'Linediff' }, - { 'lukas-reineke/indent-blankline.nvim', + { + 'lukas-reineke/indent-blankline.nvim', event = 'VeryLazy', config = true, opts = { @@ -23,8 +25,72 @@ return { 'man', '', }, - }, }, - { 'echasnovski/mini.trailspace', version = '*', config = function() require('mini.trailspace').setup({}) end }, + }, + }, + + { + 'chrisgrieser/nvim-various-textobjs', + keys = { + { 'ii', function() require('various-textobjs').indentation(true, true) end, mode = { 'o', 'x' }, + desc = + 'Inside indent' }, + { 'ai', function() require('various-textobjs').indentation(false, false) 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 = '' }, + -- {"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 = "" }, + -- {"YOUR_MAPPING",function() require("various-textobjs").nearEoL() end, mode = { "o", "x" }, desc = "" }, + -- {"YOUR_MAPPING",function() require("various-textobjs").lineCharacterwise() end, mode = { "o", "x" }, desc = "" }, + -- {"YOUR_MAPPING",function() require("various-textobjs").value(true) end, mode = { "o", "x" }, desc = "" }, + -- {"YOUR_MAPPING",function() require("various-textobjs").value(false) end, mode = { "o", "x" }, desc = "" }, + -- {"YOUR_MAPPING",function() require("various-textobjs").key(true) end, mode = { "o", "x" }, desc = "" }, + -- {"YOUR_MAPPING",function() require("various-textobjs").key(false) end, mode = { "o", "x" }, desc = "" }, + -- {"YOUR_MAPPING",function() require("various-textobjs").diagnostic() end, mode = { "o", "x" }, desc = "" }, + -------------------------------------------------------------------------------------- + -- put these into the ftplugins or autocms for the filetypes you want to use them with + -- {"YOUR_MAPPING",function() require("various-textobjs").mdlink(true) end, { buffer = true }, mode = { "o", "x" }, desc = "" }, + -- {"YOUR_MAPPING",function() require("various-textobjs").mdlink(false) end, { buffer = true }, mode = { "o", "x" }, desc = "" }, + -- + -- {"YOUR_MAPPING",function() require("various-textobjs").mdFencedCodeBlock(true) end, { buffer = true }, mode = { "o", "x" }, desc = "" }, + -- {"YOUR_MAPPING",function() require("various-textobjs").mdFencedCodeBlock(false) end, { buffer = true }, mode = { "o", "x" }, desc = "" }, + -- + -- {"YOUR_MAPPING",function() require("various-textobjs").cssSelector(true) end, { buffer = true }, mode = { "o", "x" }, desc = "" }, + -- {"YOUR_MAPPING",function() require("various-textobjs").cssSelector(false) end, { buffer = true }, mode = { "o", "x" }, desc = "" }, + -- + -- {"YOUR_MAPPING",function() require("various-textobjs").htmlAttribute(true) end, { buffer = true }, mode = { "o", "x" }, desc = "" }, + -- {"YOUR_MAPPING",function() require("various-textobjs").htmlAttribute(false) end, { buffer = true }, mode = { "o", "x" }, desc = "" }, + -- + -- {"YOUR_MAPPING",function() require("various-textobjs").doubleSquareBrackets(true) end, { buffer = true }, mode = { "o", "x" }, desc = "" }, + -- {"YOUR_MAPPING",function() require("various-textobjs").doubleSquareBrackets(false) end, { buffer = true }, mode = { "o", "x" }, desc = "" }, + -- + -- {"YOUR_MAPPING",function() require("various-textobjs").shellPipe(true) end, { buffer = true }, mode = { "o", "x" }, desc = "" }, + -- {"YOUR_MAPPING",function() require("various-textobjs").shellPipe(false) end, { buffer = true }, mode = { "o", "x" }, desc = "" }, + }, + }, + { + 'chrisgrieser/nvim-spider', + keys = { + { '', function() require('spider').motion('w') end, mode = { 'n', 'o', 'x' }, desc = 'Spider-w' }, + { '', function() require('spider').motion('e') end, mode = { 'n', 'o', 'x' }, desc = 'Spider-e' }, + { '', function() require('spider').motion('b') end, mode = { 'n', 'o', 'x' }, desc = 'Spider-b' }, + }, + }, + + { + 'echasnovski/mini.trailspace', + version = '*', + keys = { + { 'eT', function() MiniTrailspace.trim() end, desc = 'Trim whiltespace' }, + }, + config = true, + }, -- stolen from LazyVim { @@ -44,7 +110,8 @@ return { end, }, - { 'stevearc/overseer.nvim', + { + 'stevearc/overseer.nvim', config = true, cmd = { 'OverseerBuild', @@ -77,40 +144,22 @@ return { 'editorconfig/editorconfig-vim', + { 'dyng/ctrlsf.vim', cmd = 'CtrlSF' }, + { - 'vlada-dudr/vdebug', - lazy = true, - enabled = false, - keys = { - { '', desc = 'Start Vdebug' }, - { '', desc = 'Vdebug breakpoint' }, - }, - }, - - { 'dyng/ctrlsf.vim', cmd = 'CtrlSF' }, - - { 'andymass/vim-matchup', + 'andymass/vim-matchup', event = 'BufRead', config = function() vim.g.matchup_matchparen_offscreen = {} - end, }, + end, + }, { 'echasnovski/mini.surround', version = '*', event = 'BufEnter', - config = function() - require('mini.surround').setup({}) - end, - }, - - { 'echasnovski/mini.statusline', - enabled = false, - event = 'VeryLazy', - version = '*', - config = function() - require('mini.statusline').setup({}) - end, + config = true, + main = 'mini.surround', }, { 'fpob/nette.vim', ft = 'nette' }, @@ -141,7 +190,6 @@ return { information = '', other = '', }, - }, }, diff --git a/dot_config/nvim/lua/configs/packages/treesitter.lua b/dot_config/nvim/lua/configs/packages/treesitter.lua index 6678d46..b286d85 100644 --- a/dot_config/nvim/lua/configs/packages/treesitter.lua +++ b/dot_config/nvim/lua/configs/packages/treesitter.lua @@ -36,18 +36,16 @@ function M.config() swap = { enable = true, swap_next = { - [' pl'] = '@parameter.inner', + ['ep'] = '@parameter.inner', }, swap_previous = { - [' ph'] = '@parameter.inner', + ['eP'] = '@parameter.inner', }, }, select = { enable = true, - -- Automatically jump forward to textobj, similar to targets.vim lookahead = true, - keymaps = { -- You can use the capture groups defined in textobjects.scm ['af'] = '@function.outer', @@ -66,7 +64,7 @@ function M.config() -- mapping query_strings to modes. selection_modes = { ['@parameter.outer'] = 'v', -- charwise - ['@function.outer'] = 'V', -- linewise + ['@function.outer'] = 'V', -- linewise ['@class.outer'] = '', -- blockwise }, -- If you set this to `true` (default is `false`) then any textobject is @@ -89,11 +87,11 @@ function M.config() url = 'https://github.com/dorgnarg/tree-sitter-xml', -- local path or git repo files = { 'src/parser.c' }, -- optional entries: - branch = 'main', -- default branch in case of git repo if different from master - generate_requires_npm = false, -- if stand-alone parser without npm dependencies + branch = 'main', -- default branch in case of git repo if different from master + generate_requires_npm = false, -- if stand-alone parser without npm dependencies requires_generate_from_grammar = true, -- if folder contains pre-generated src/parser.c }, - filetype = 'xml', -- if filetype does not match the parser name + filetype = 'xml', -- if filetype does not match the parser name } end