From b3b273ad451e4eea09de920308a8b6564d09a670 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Dudr?= Date: Sat, 4 Feb 2023 14:07:05 +0100 Subject: [PATCH] nvim --- dot_config/nvim/lua/configs/options.lua | 4 +- dot_config/nvim/lua/configs/packages/lsp.lua | 41 ++++++------------- dot_config/nvim/lua/configs/packages/misc.lua | 5 ++- .../nvim/lua/configs/packages/null-ls.lua | 2 +- 4 files changed, 20 insertions(+), 32 deletions(-) diff --git a/dot_config/nvim/lua/configs/options.lua b/dot_config/nvim/lua/configs/options.lua index 3236ad1..a565621 100644 --- a/dot_config/nvim/lua/configs/options.lua +++ b/dot_config/nvim/lua/configs/options.lua @@ -46,8 +46,8 @@ function M.setup() vim.o.statusline = '%{fnamemodify(getcwd(),":t")} ' -- basename of cwd - .. '%{get(b:,"gitsigns_head","")}' -- branch - .. '%<%f [%M%R%W]' -- filename and modification flags + .. '%(%{get(b:,"gitsigns_head","")} %)' -- branch + .. '%<%f%( [%M%R%W]%)' -- filename and modification flags .. '%=' -- rest is right .. '%y ' -- filetype .. '%-7.(%3.l:%-3.(%c%V%)%) %P' -- ruler diff --git a/dot_config/nvim/lua/configs/packages/lsp.lua b/dot_config/nvim/lua/configs/packages/lsp.lua index 2926161..e03b19b 100644 --- a/dot_config/nvim/lua/configs/packages/lsp.lua +++ b/dot_config/nvim/lua/configs/packages/lsp.lua @@ -7,6 +7,7 @@ local M = { { 'j-hui/fidget.nvim', config = true }, { 'ray-x/lsp_signature.nvim', opts = { hint_prefix = '⥊ ', floating_window = false, hint_scheme = 'Identifier' } }, 'hrsh7th/nvim-cmp', + 'Hoffs/omnisharp-extended-lsp.nvim', }, keys = { { 'li', 'LspInfo', desc = 'Lsp info' }, @@ -113,42 +114,17 @@ function M.config() cssls = {}, html = {}, omnisharp = { -- {{{ + handlers = { + ['textDocument/definition'] = require('omnisharp_extended').handler, + }, cmd = { '/usr/bin/omnisharp' }, - -- Enables support for reading code style, naming convention and analyzer - -- settings from .editorconfig. enable_editorconfig_support = true, - - -- If true, MSBuild project system will only load projects for files that - -- were opened in the editor. This setting is useful for big C# codebases - -- and allows for faster initialization of code navigation features only - -- for projects that are relevant to code that is being edited. With this - -- setting enabled OmniSharp may load fewer projects and may thus display - -- incomplete reference lists for symbols. enable_ms_build_load_projects_on_demand = false, - - -- Enables support for roslyn analyzers, code fixes and rulesets. enable_roslyn_analyzers = true, - - -- Specifies whether 'using' directives should be grouped and sorted during - -- document formatting. organize_imports_on_format = true, - - -- Enables support for showing unimported types and unimported extension - -- methods in completion lists. When committed, the appropriate using - -- directive will be added at the top of the current file. This option can - -- have a negative impact on initial completion responsiveness, - -- particularly for the first few completion sessions after opening a - -- solution. enable_import_completion = true, - - -- Specifies whether to include preview versions of the .NET SDK when - -- determining which version to use for project loading. sdk_include_prereleases = true, - - -- Only run analyzers against open files when 'enableRoslynAnalyzers' is - -- true analyze_open_documents_only = true, - }, -- }}} sumneko_lua = { -- {{{ settings = { @@ -163,6 +139,15 @@ function M.config() }, }, -- }}} phpactor = { -- {{{ + handlers = { + ['textDocument/publishDiagnostics'] = vim.lsp.with( + vim.lsp.diagnostic.on_publish_diagnostics, { + virtual_text = { + severity = vim.diagnostic.severity.ERROR, + } + } + ), + }, root_dir = function(startpath) local u = require('lspconfig.util') return u.search_ancestors(startpath, function(path) diff --git a/dot_config/nvim/lua/configs/packages/misc.lua b/dot_config/nvim/lua/configs/packages/misc.lua index ce90e03..3d11318 100644 --- a/dot_config/nvim/lua/configs/packages/misc.lua +++ b/dot_config/nvim/lua/configs/packages/misc.lua @@ -38,7 +38,10 @@ return { dependencies = { 'nvim-tree/nvim-web-devicons' }, lazy = true, cmd = { 'Trouble', 'TroubleToggle' }, - keys = { { 't', ':TroubleToggle', desc = 'Trouble' } }, + keys = { + { 'tt', 'TroubleToggle', desc = 'Trouble toggle' }, + { 'td', 'Trouble document_diagnostics', desc = 'Trouble toggle' } + }, config = { mode = 'document_diagnostics' } diff --git a/dot_config/nvim/lua/configs/packages/null-ls.lua b/dot_config/nvim/lua/configs/packages/null-ls.lua index 84d7bb6..44ef359 100644 --- a/dot_config/nvim/lua/configs/packages/null-ls.lua +++ b/dot_config/nvim/lua/configs/packages/null-ls.lua @@ -12,7 +12,7 @@ function M.config() sources = { nls.builtins.formatting.xmllint, nls.builtins.formatting.jq, - nls.builtins.formatting.clang_format, + -- nls.builtins.formatting.clang_format, nls.builtins.diagnostics.sqlfluff, nls.builtins.diagnostics.phpstan.with({ cwd = function(params)