diff --git a/init.lua b/init.lua index b529a8e..b316c64 100644 --- a/init.lua +++ b/init.lua @@ -1,3 +1,3 @@ -require "plugins" require "basics" +require "plugins" require "keys" diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 0000000..70010bd --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,59 @@ +{ + "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, + "FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" }, + "LuaSnip": { "branch": "master", "commit": "ea7d7ea510c641c4f15042becd27f35b3e5b3c2b" }, + "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, + "cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" }, + "cmp-npm": { "branch": "main", "commit": "2337f109f51a09297596dd6b538b70ccba92b4e4" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" }, + "cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" }, + "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, + "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, + "cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" }, + "copilot.vim": { "branch": "release", "commit": "719dd8d0beab993dbad47a9e86ecb0dbd4a99da5" }, + "crates.nvim": { "branch": "main", "commit": "d5caf28aba49e81ac4099426231f3cf3c151013a" }, + "editorconfig-vim": { "branch": "master", "commit": "aefcf3d735122f349b172302d164d5eb61cd7e5f" }, + "fidget.nvim": { "branch": "main", "commit": "89b633f3bd0b7187f070236b348697de176860e2" }, + "formatter.nvim": { "branch": "master", "commit": "44c89f09dcc220dc2a9b056e93c3a87c86e79804" }, + "gitsigns.nvim": { "branch": "main", "commit": "fef5d90953f0a730483b44745fae5938ba8227f8" }, + "heirline.nvim": { "branch": "master", "commit": "7f1e805dfc001d5dbb7d894105063f463f6c7dcc" }, + "lazy.nvim": { "branch": "main", "commit": "3ad55ae678876516156cca2f361c51f7952a924b" }, + "lightspeed.nvim": { "branch": "main", "commit": "299eefa6a9e2d881f1194587c573dad619fdb96f" }, + "lsp_signature.nvim": { "branch": "master", "commit": "ce1a3c4fece642ab85913b87ac3d8b7c79cd8eda" }, + "lspkind-nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" }, + "mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" }, + "monokai.nvim": { "branch": "master", "commit": "c295909d53c7577af7eece5ae83855384dd900a6" }, + "neo-tree.nvim": { "branch": "main", "commit": "2d89ca96e08eb6e9c8e50e1bb4738bc5125c9f12" }, + "neotest": { "branch": "master", "commit": "bec7be0f13ee19c85561943fc5f7b8daa4f4d465" }, + "neotest-jest": { "branch": "main", "commit": "ae559fbd405084ee38dd711eede6d74f3dc1d463" }, + "nui.nvim": { "branch": "main", "commit": "c8de23342caf8d50b15d6b28368d36a56a69d76f" }, + "null-ls.nvim": { "branch": "main", "commit": "0010ea927ab7c09ef0ce9bf28c2b573fc302f5a7" }, + "nvim-autopairs": { "branch": "master", "commit": "defad64afbf19381fe31488a7582bbac421d6e38" }, + "nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" }, + "nvim-code-action-menu": { "branch": "main", "commit": "e4399dbaf6eabff998d3d5f1cbcd8d9933710027" }, + "nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" }, + "nvim-dap": { "branch": "master", "commit": "0e6b7c47dd70e80793ed39271b2aa712d9366dbc" }, + "nvim-dap-ui": { "branch": "master", "commit": "85b16ac2309d85c88577cd8ee1733ce52be8227e" }, + "nvim-lspconfig": { "branch": "master", "commit": "0517d8522dcec286b1dba47aa3ee1ed8f523aed6" }, + "nvim-treesitter": { "branch": "master", "commit": "dfcfdb0e7bcb362c4de1ed7d0015c21957c91ba7" }, + "nvim-ts-autotag": { "branch": "main", "commit": "6be1192965df35f94b8ea6d323354f7dc7a557e4" }, + "nvim-ts-context-commentstring": { "branch": "main", "commit": "9bff161dfece6ecf3459e6e46ca42e49f9ed939f" }, + "nvim-web-devicons": { "branch": "master", "commit": "bc11ee2498de2310de5776477dd9dce65d03b464" }, + "nvim-window-picker": { "branch": "main", "commit": "1b1bb834b0acb9eebb11a61664efc665757f1ba2" }, + "omnisharp-vim": { "branch": "master", "commit": "9c12ecc93d9a65d698523b24fd32fad385015bbb" }, + "packer.nvim": { "branch": "master", "commit": "ea0cc3c59f67c440c5ff0bbe4fb9420f4350b9a3" }, + "plantuml-syntax": { "branch": "master", "commit": "845abb56dcd3f12afa6eb47684ef5ba3055802b8" }, + "playground": { "branch": "master", "commit": "429f3e76cbb1c59fe000b690f7a5bea617b890c0" }, + "plenary.nvim": { "branch": "master", "commit": "a56bf0071bf63d35274fdc4738bb1e8821cfd2ea" }, + "popfix": { "branch": "master", "commit": "bf3cc436df63cd535350d5ef1b951c91554d4b01" }, + "popui.nvim": { "branch": "master", "commit": "19c61223927d6f174848c0e5f866d72044c5a0e1" }, + "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, + "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, + "statuscol.nvim": { "branch": "main", "commit": "0944234914438695050eec6f83b4669864680c1a" }, + "telescope.nvim": { "branch": "master", "commit": "18f10f28007cb8b4d50324217349c3f568684be2" }, + "template-string.nvim": { "branch": "main", "commit": "89bffccadcbba5381274ed38d08c4c7ef7fe42aa" }, + "todo-comments.nvim": { "branch": "main", "commit": "3094ead8edfa9040de2421deddec55d3762f64d1" }, + "typescript.nvim": { "branch": "main", "commit": "4de85ef699d7e6010528dcfbddc2ed4c2c421467" }, + "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, + "vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" } +} \ No newline at end of file diff --git a/lua/plugins.lua b/lua/plugins.lua index ae71152..7fc7c1a 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -1,55 +1,54 @@ local execute = vim.api.nvim_command local fn = vim.fn --- ensure that packer is installed -local install_path = fn.stdpath("data") .. "/site/pack/packer/opt/packer.nvim" -if fn.empty(fn.glob(install_path)) > 0 then - execute("!git clone https://github.com/wbthomason/packer.nvim " .. install_path) - execute "packadd packer.nvim" + +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" +if not vim.loop.fs_stat(lazypath) then + vim.fn.system( + { + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath + } + ) end -vim.cmd("packadd packer.nvim") -local packer = require "packer" -local util = require "packer.util" +vim.opt.rtp:prepend(lazypath) -packer.init( +require("lazy").setup( { - package_root = util.join_paths(vim.fn.stdpath("data"), "site", "pack") - } -) - -return require("packer").startup( - function() - -- Packer can manage itself - use "wbthomason/packer.nvim" - use { + "wbthomason/packer.nvim", + { "MasterGordon/monokai.nvim", config = function() require("monokai").setup() end - } - use { + }, + { "kyazdani42/nvim-web-devicons", config = function() require("plugins/icons") end - } - use { + }, + { "nvim-treesitter/playground", - requires = {"nvim-treesitter/nvim-treesitter"} - } - use { + dependencies = {"nvim-treesitter/nvim-treesitter"} + }, + { "nvim-treesitter/nvim-treesitter", run = ":TSUpdate", -- after = "nvim-compe", config = function() require "plugins/treesitter" end, - requires = { + dependencies = { "JoosepAlviste/nvim-ts-context-commentstring", "windwp/nvim-ts-autotag", "windwp/nvim-autopairs" } - } - use { + }, + { "numToStr/Comment.nvim", config = function() require("Comment").setup { @@ -59,69 +58,71 @@ return require("packer").startup( } } end - } - use { + }, + { "mhartington/formatter.nvim", config = function() require "plugins/formatter" end - } - use { + }, + { "neovim/nvim-lspconfig", config = function() require "plugins/lsp" end, - requires = { + dependencies = { "jose-elias-alvarez/null-ls.nvim", "RishabhRD/popfix", "onsails/lspkind-nvim", "ray-x/lsp_signature.nvim", "jose-elias-alvarez/typescript.nvim", - "hood/popui.nvim" + "hood/popui.nvim", + "OmniSharp/omnisharp-vim" } - } - use { + }, + { "weilbith/nvim-code-action-menu", cmd = "CodeActionMenu" - } - use { + }, + { "nvim-telescope/telescope.nvim", config = function() require("telescope").setup { file_ignore_patterns = {"package-lock.json"} } end, - requires = {"nvim-lua/popup.nvim", "nvim-lua/plenary.nvim"} - } - use { + dependencies = {"nvim-lua/popup.nvim", "nvim-lua/plenary.nvim"} + }, + { "norcalli/nvim-colorizer.lua", config = function() require "colorizer".setup() end - } - use { + }, + { "folke/todo-comments.nvim", - requires = "nvim-lua/plenary.nvim", + dependencies = "nvim-lua/plenary.nvim", config = function() require("todo-comments").setup {} end - } - use { + }, + { "lewis6991/gitsigns.nvim", - requires = { + dependencies = { "nvim-lua/plenary.nvim" }, config = function() require("gitsigns").setup() end - } - use "editorconfig/editorconfig-vim" - use { + }, + "editorconfig/editorconfig-vim", + "L3MON4D3/LuaSnip", + { "hrsh7th/nvim-cmp", config = function() require("plugins/cmp") end, - requires = { + dependencies = { "L3MON4D3/LuaSnip", "saadparwaiz1/cmp_luasnip", "hrsh7th/cmp-buffer", @@ -132,93 +133,89 @@ return require("packer").startup( "David-Kunz/cmp-npm", "hrsh7th/cmp-nvim-lsp-signature-help" } - } - use { + }, + { "saecki/crates.nvim", event = {"BufRead Cargo.toml"}, - requires = {{"nvim-lua/plenary.nvim"}}, + dependencies = {{"nvim-lua/plenary.nvim"}}, config = function() require("crates").setup() end - } - use "aklt/plantuml-syntax" - use { + }, + "aklt/plantuml-syntax", + { "github/copilot.vim", config = function() require("plugins/copilot") end - } - use { + }, + { "ggandor/lightspeed.nvim", - requires = {"tpope/vim-repeat"} - } - use "jghauser/mkdir.nvim" - use { + dependencies = {"tpope/vim-repeat"} + }, + "jghauser/mkdir.nvim", + { "David-Kunz/cmp-npm", - requires = { + dependencies = { "nvim-lua/plenary.nvim" } - } - use { + }, + { "rebelot/heirline.nvim", config = function() require "plugins/heirline" end, - requires = { + dependencies = { "kyazdani42/nvim-web-devicons", - "nvim-treesitter/nvim-treesitter" - }, - after = { + "nvim-treesitter/nvim-treesitter", + "j-hui/fidget.nvim", "monokai.nvim", "nvim-lspconfig" } - } - use "isobit/vim-caddyfile" - use { + }, + "isobit/vim-caddyfile", + { "nvim-neotest/neotest", config = function() require("plugins/neotest") end, - requires = { + event = {"BufRead *.test.*,*.spec.*,*Test.*"}, + dependencies = { "nvim-lua/plenary.nvim", "nvim-treesitter/nvim-treesitter", "antoinemadec/FixCursorHold.nvim", - "haydenmeade/neotest-jest" - }, - after = { + "haydenmeade/neotest-jest", "monokai.nvim" } - } - use { + }, + { "andweeb/presence.nvim", config = function() require("presence"):setup() end - } - use { + }, + { "rcarriga/nvim-dap-ui", config = function() require("plugins/dap") end, - requires = {"mfussenegger/nvim-dap"} - } - use { + dependencies = {"mfussenegger/nvim-dap"} + }, + { "nvim-neo-tree/neo-tree.nvim", branch = "main", config = function() require("plugins/neo-tree") end, - requires = { + dependencies = { "nvim-lua/plenary.nvim", "kyazdani42/nvim-web-devicons", -- not strictly required, but recommended "MunifTanjim/nui.nvim", - "s1n7ax/nvim-window-picker" - }, - after = { + "s1n7ax/nvim-window-picker", "monokai.nvim" } - } - use { + }, + { "luukvbaal/statuscol.nvim", config = function() require("statuscol").setup( @@ -228,12 +225,12 @@ return require("packer").startup( } ) end - } - use { + }, + { "axelvc/template-string.nvim", config = function() require("template-string").setup() end } - end + } ) diff --git a/lua/plugins/cmp.lua b/lua/plugins/cmp.lua index 5005433..51dc726 100644 --- a/lua/plugins/cmp.lua +++ b/lua/plugins/cmp.lua @@ -2,56 +2,31 @@ local cmp = require "cmp" require("cmp-npm").setup({}) local cmp_kinds = { - --[[ Text = " ", - Method = " ", - Function = " ", - Constructor = " ", - Field = " ", - Variable = " ", - Class = " ", - Interface = " ", - Module = " ", - Property = " ", - Unit = " ", - Value = " ", - Enum = " ", - Keyword = " ", - Snippet = " ", - Color = " ", - File = " ", - Reference = " ", - Folder = " ", - EnumMember = " ", - Constant = " ", - Struct = " ", - Event = " ", - Operator = " ", - TypeParameter = " " ]] - Text = " ", - Method = " ", - Function = " ", + Text = " ", + Method = " ", + Function = " ", Constructor = " ", - Field = "炙", + Field = " ", Variable = " ", - Class = " ", + Class = " ", Interface = " ", Module = " ", - Property = "ﰠ ", - Unit = "塞 ", - Value = " ", + Property = " ", + Unit = " ", + Value = " ", Enum = " ", - Keyword = " ", + Keyword = " ", Snippet = " ", - Color = " ", - File = " ", - Reference = " ", - Folder = " ", - EnumMember = " ", - Constant = " ", - Struct = "פּ ", - Event = " ", - Operator = " ", - TypeParameter = " ", + Color = " ", + File = " ", + Reference = " ", + Folder = " ", + EnumMember = " ", + Constant = " ", + Struct = " ", + Event = " ", + Operator = " ", + TypeParameter = " ", Copilot = " " } @@ -64,6 +39,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/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 c4a1c64..96c0c2d 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, @@ -13,7 +14,27 @@ require "window-picker".setup( buftype = {"terminal", "quickfix"} } }, - selection_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + selection_chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ", + highlights = { + statusline = { + focused = { + bg = "#519aba" + }, + unfocused = { + bg = "#519aba" + } + }, + winbar = { + focused = { + bg = "#519aba" + }, + unfocused = { + bg = "#519aba" + } + } + } + -- other_win_hl_color = "#519aba" +>>>>>>> 0c8096cb6eee895e8f52091b51923d6e3d7ff9aa } ) @@ -152,7 +173,7 @@ require("neo-tree").setup( ["m"] = { "move", config = { - show_path = "absoulte" + show_path = "absolute" } }, ["q"] = "close_window", @@ -174,7 +195,7 @@ require("neo-tree").setup( never_show = {}, never_show_by_pattern = {} }, - follow_current_file = false, -- This will find and focus the file in the active buffer every + follow_current_file = {enabled = false}, -- This will find and focus the file in the active buffer every -- time the current file is changed while the tree is open. group_empty_dirs = false, -- when true, empty folders will be grouped together hijack_netrw_behavior = "open_default", -- netrw disabled, opening a directory opens neo-tree @@ -199,7 +220,7 @@ require("neo-tree").setup( } }, buffers = { - follow_current_file = true, -- This will find and focus the file in the active buffer every + follow_current_file = {enabled = true}, -- This will find and focus the file in the active buffer every -- time the current file is changed while the tree is open. group_empty_dirs = true, -- when true, empty folders will be grouped together show_unloaded = true, 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