From 5e6c7840fc7d1e07791b74e56001c9153c0af18a Mon Sep 17 00:00:00 2001 From: MasterGordon Date: Thu, 3 Aug 2023 01:18:21 +0200 Subject: [PATCH] updated config --- lua/plugins.lua | 7 +++- lua/plugins/cmp.lua | 5 +++ lua/plugins/formatter.lua | 3 +- lua/plugins/heirline.lua | 13 +++++++ lua/plugins/lsp.lua | 78 ++++++++++++++++++++++++++++++++++++++- lua/plugins/neo-tree.lua | 23 +++++++++++- setup.sh | 31 ++++++++-------- 7 files changed, 139 insertions(+), 21 deletions(-) diff --git a/lua/plugins.lua b/lua/plugins.lua index ae71152..a61c3a7 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -77,7 +77,8 @@ return require("packer").startup( "onsails/lspkind-nvim", "ray-x/lsp_signature.nvim", "jose-elias-alvarez/typescript.nvim", - "hood/popui.nvim" + "hood/popui.nvim", + "OmniSharp/omnisharp-vim" } } use { @@ -116,6 +117,7 @@ return require("packer").startup( end } use "editorconfig/editorconfig-vim" + use {"L3MON4D3/LuaSnip"} use { "hrsh7th/nvim-cmp", config = function() @@ -166,7 +168,8 @@ return require("packer").startup( end, requires = { "kyazdani42/nvim-web-devicons", - "nvim-treesitter/nvim-treesitter" + "nvim-treesitter/nvim-treesitter", + "j-hui/fidget.nvim" }, after = { "monokai.nvim", diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 5005433..84c481d 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -64,6 +64,11 @@ options = { ghost_text = true, native_menu = false }, + snippet = { + expand = function(args) + require "luasnip".lsp_expand(args.body) + end + }, formatting = { kind_icons = cmp_kinds, source_names = { diff --git a/lua/plugins/formatter.lua b/lua/plugins/formatter.lua index 3651d2f..6d28624 100644 --- a/lua/plugins/formatter.lua +++ b/lua/plugins/formatter.lua @@ -12,6 +12,7 @@ require("formatter").setup( filetype = { typescriptreact = {prettierd}, json = {prettierd}, + jsonc = {prettierd}, css = {prettierd}, scss = {prettierd}, markdown = {prettierd}, @@ -72,7 +73,7 @@ vim.api.nvim_exec( [[ augroup FormatAutogroup autocmd! - autocmd BufWritePost *.h,*.cpp,*.rs,*.lua,*.tsx,*.ts,*.js,*.jsx,*.json FormatWrite + autocmd BufWritePost *.h,*.cpp,*.rs,*.lua,*.tsx,*.ts,*.js,*.jsx,*.json,*.jsonc FormatWrite augroup END ]], true diff --git a/lua/plugins/heirline.lua b/lua/plugins/heirline.lua index 02182a1..f942588 100644 --- a/lua/plugins/heirline.lua +++ b/lua/plugins/heirline.lua @@ -278,6 +278,19 @@ local WorkDir = { hl = {fg = colors.blue, bold = true, bg = colors.bg} } +require("fidget").setup( + { + window = { + blend = 0 + }, + sources = { + ["null-ls"] = { + ignore = true + } + } + } +) + local TerminalName = { -- we could add a condition to check that buftype == 'terminal' -- or we could do that later (see #conditional-statuslines below) diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 6d7c7f0..ab02f4a 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -167,7 +167,83 @@ nvim_lsp.omnisharp.setup { enable_editorconfig_support = true, enable_roslyn_analyzers = true, enable_import_completion = true, - on_attach = on_attach, + on_attach = function(client, bufnr) + client.server_capabilities.semanticTokensProvider = { + full = vim.empty_dict(), + legend = { + tokenModifiers = {"static_symbol"}, + tokenTypes = { + "comment", + "excluded_code", + "identifier", + "keyword", + "keyword_control", + "number", + "operator", + "operator_overloaded", + "preprocessor_keyword", + "string", + "whitespace", + "text", + "static_symbol", + "preprocessor_text", + "punctuation", + "string_verbatim", + "string_escape_character", + "class_name", + "delegate_name", + "enum_name", + "interface_name", + "module_name", + "struct_name", + "type_parameter_name", + "field_name", + "enum_member_name", + "constant_name", + "local_name", + "parameter_name", + "method_name", + "extension_method_name", + "property_name", + "event_name", + "namespace_name", + "label_name", + "xml_doc_comment_attribute_name", + "xml_doc_comment_attribute_quotes", + "xml_doc_comment_attribute_value", + "xml_doc_comment_cdata_section", + "xml_doc_comment_comment", + "xml_doc_comment_delimiter", + "xml_doc_comment_entity_reference", + "xml_doc_comment_name", + "xml_doc_comment_processing_instruction", + "xml_doc_comment_text", + "xml_literal_attribute_name", + "xml_literal_attribute_quotes", + "xml_literal_attribute_value", + "xml_literal_cdata_section", + "xml_literal_comment", + "xml_literal_delimiter", + "xml_literal_embedded_expression", + "xml_literal_entity_reference", + "xml_literal_name", + "xml_literal_processing_instruction", + "xml_literal_text", + "regex_comment", + "regex_character_class", + "regex_anchor", + "regex_quantifier", + "regex_grouping", + "regex_alternation", + "regex_text", + "regex_self_escaped_character", + "regex_other_escape" + } + }, + range = true + } + on_attach(client, bufnr) + end, flags = { debounce_text_changes = 150 }, diff --git a/lua/plugins/neo-tree.lua b/lua/plugins/neo-tree.lua index 50b6c54..502b5f1 100644 --- a/lua/plugins/neo-tree.lua +++ b/lua/plugins/neo-tree.lua @@ -1,5 +1,6 @@ vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]]) vim.api.nvim_set_keymap("", "", ":Neotree reveal", {silent = true}) +-- require "window-picker".setup() require "window-picker".setup( { autoselect_one = true, @@ -14,7 +15,25 @@ require "window-picker".setup( } }, selection_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ", - other_win_hl_color = "#519aba" + highlights = { + statusline = { + focused = { + bg = "#519aba" + }, + unfocused = { + bg = "#519aba" + } + }, + winbar = { + focused = { + bg = "#519aba" + }, + unfocused = { + bg = "#519aba" + } + } + } + -- other_win_hl_color = "#519aba" } ) @@ -153,7 +172,7 @@ require("neo-tree").setup( ["m"] = { "move", config = { - show_path = "absoulte" + show_path = "absolute" } }, ["q"] = "close_window", diff --git a/setup.sh b/setup.sh index 356da4a..e34f7b9 100755 --- a/setup.sh +++ b/setup.sh @@ -1,19 +1,20 @@ [ -e ~/.local/share/nvim/site/pack/packer/start/packer.nvim ] || git clone https://github.com/wbthomason/packer.nvim ~/.local/share/nvim/site/pack/packer/start/packer.nvim -npm i -g @fsouza/prettierd \ -diagnostic-languageserver \ -eslint_d \ -lua-fmt \ -typescript-language-server \ -typescript \ -vim-language-server \ -vscode-css-languageserver-bin \ -vscode-html-languageserver-bin \ -vscode-json-languageserver \ -vscode-langservers-extracted \ -bash-language-server \ -@prisma/language-server \ -cspell \ -@cspell/dict-de-de +npm i -g @fsouza/prettierd@latest \ +diagnostic-languageserver@latest \ +eslint_d@latest \ +lua-fmt@latest \ +typescript-language-server@latest \ +typescript@latest \ +vim-language-server@latest \ +vscode-css-languageserver-bin@latest \ +vscode-html-languageserver-bin@latest \ +vscode-json-languageserver@latest \ +vscode-langservers-extracted@latest \ +bash-language-server@latest \ +@prisma/language-server@latest \ +cspell@latest \ +@cspell/dict-de-de@latest \ +tsx@latest cspell link add @cspell/dict-de-de dotnet tool install --global csharp-ls