diff --git a/lazy-lock.json b/lazy-lock.json index 00ef8a6..bce4ee1 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -10,58 +10,59 @@ "cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "crates.nvim": { "branch": "main", "commit": "d65ad2e7450a71e600216ad736a4732f38ac14e5" }, - "cspell.nvim": { "branch": "main", "commit": "c423159fd98d215782fa72fd7e99821cca4142f4" }, + "crates.nvim": { "branch": "main", "commit": "5a24e3ba60e28e0cfde540696630b3c5a4db6dfd" }, + "cspell.nvim": { "branch": "main", "commit": "33cb8570ab0dda1ad915347fae62567d9c1390ed" }, "editorconfig-vim": { "branch": "master", "commit": "8b7da79e9daee7a3f3a8d4fe29886b9756305aff" }, "fidget.nvim": { "branch": "main", "commit": "d855eed8a06531a7e8fd0684889b2943f373c469" }, "formatter.nvim": { "branch": "master", "commit": "ad246d34ce7a32f752071ed81b09b94e6b127fad" }, - "gitsigns.nvim": { "branch": "main", "commit": "562dc47189ad3c8696dbf460d38603a74d544849" }, + "gitsigns.nvim": { "branch": "main", "commit": "1ef74b546732f185d0f806860fa5404df7614f28" }, "heirline.nvim": { "branch": "master", "commit": "0d797435e54645a5f98bad7ad6046aac1ef95c1e" }, - "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, + "lazy.nvim": { "branch": "main", "commit": "460e1cd8f24e364d54543a4b0e83f6f4ec1f65fb" }, "lightspeed.nvim": { "branch": "main", "commit": "fcc72d8a4d5f4ebba62d8a3a0660f88f1b5c3b05" }, - "lsp_signature.nvim": { "branch": "master", "commit": "a38da0a61c172bb59e34befc12efe48359884793" }, + "lsp_signature.nvim": { "branch": "master", "commit": "fc38521ea4d9ec8dbd4c2819ba8126cea743943b" }, "lspkind-nvim": { "branch": "master", "commit": "cff4ae321a91ee3473a92ea1a8c637e3a9510aec" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "3ed90180e70a6a50cd37ce7ecc3693bcdaa7b290" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "25c11854aa25558ee6c03432edfa0df0217324be" }, "mason-null-ls.nvim": { "branch": "main", "commit": "de19726de7260c68d94691afb057fa73d3cc53e7" }, "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "mkdir.nvim": { "branch": "main", "commit": "c55d1dee4f099528a1853b28bb28caa802eba217" }, "monokai.nvim": { "branch": "master", "commit": "c295909d53c7577af7eece5ae83855384dd900a6" }, - "neo-tree.nvim": { "branch": "main", "commit": "206241e451c12f78969ff5ae53af45616ffc9b72" }, - "neotest": { "branch": "master", "commit": "32ff2ac21135a372a42b38ae131e531e64833bd3" }, + "neo-tree.nvim": { "branch": "main", "commit": "a77af2e764c5ed4038d27d1c463fa49cd4794e07" }, + "neotest": { "branch": "master", "commit": "48f8b5fce704594eb0ff94338e080defca14f0dc" }, "neotest-jest": { "branch": "main", "commit": "514fd4eae7da15fd409133086bb8e029b65ac43f" }, - "neotest-zig": { "branch": "main", "commit": "b3e6246c07d3d4f06075f33aea896affd25f0de9" }, - "none-ls.nvim": { "branch": "main", "commit": "cfa65d86e21eeb60544d5e823f6db43941322a53" }, - "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, - "nvim-autopairs": { "branch": "master", "commit": "48ca9aaee733911424646cb1605f27bc01dedbe3" }, + "neotest-zig": { "branch": "main", "commit": "fc160b277126cb21a1486d48fc298d06803c3f88" }, + "none-ls.nvim": { "branch": "main", "commit": "9b98991e15dce8fc502993e23caac2528b8b667f" }, + "nui.nvim": { "branch": "main", "commit": "b58e2bfda5cea347c9d58b7f11cf3012c7b3953f" }, + "nvim-autopairs": { "branch": "master", "commit": "f158dcb865c36f72c92358f87787dab2c272eaf3" }, "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, - "nvim-dap": { "branch": "master", "commit": "2b428ff2632e73295e9decbcf1c40d8e26213305" }, - "nvim-dap-ui": { "branch": "master", "commit": "a5606bc5958db86f8d92803bea7400ee26a8d7e4" }, - "nvim-lspconfig": { "branch": "master", "commit": "a89de2e049b5f89a0ee55029d5a31213bd4de6f8" }, + "nvim-dap": { "branch": "master", "commit": "90616ae6ae40053103dc66872886fc26b94c70c8" }, + "nvim-dap-ui": { "branch": "master", "commit": "1c351e4e417d4691da12948b6ecf966936a56d28" }, + "nvim-lspconfig": { "branch": "master", "commit": "f4fef355efa3c5d0813512480ee7b2c050b09fe4" }, "nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" }, - "nvim-treesitter": { "branch": "master", "commit": "59cc5f35656f97bc964229e3ec5066a7b5a8ee5b" }, - "nvim-ts-autotag": { "branch": "main", "commit": "0cb76eea80e9c73b88880f0ca78fbd04c5bdcac7" }, + "nvim-treesitter": { "branch": "master", "commit": "2b2635551c83f26f87bf122ad25fcaf90b9a6be0" }, + "nvim-ts-autotag": { "branch": "main", "commit": "e239a560f338be31337e7abc3ee42515daf23f5e" }, "nvim-ts-context-commentstring": { "branch": "main", "commit": "375c2d86cee6674afd75b4f727ce3a80065552f7" }, "nvim-vtsls": { "branch": "main", "commit": "45c6dfea9f83a126e9bfc5dd63430562b3f8af16" }, - "nvim-web-devicons": { "branch": "master", "commit": "3722e3d1fb5fe1896a104eb489e8f8651260b520" }, + "nvim-web-devicons": { "branch": "master", "commit": "26220156aafb198b2de6a4cf80c1b120a3768da0" }, "nvim-window-picker": { "branch": "main", "commit": "41cfaa428577c53552200a404ae9b3a0b5719706" }, "omnisharp-vim": { "branch": "master", "commit": "f9c5d3e3375e8b5688a4506e813cb21bdc7329b1" }, - "outline.nvim": { "branch": "main", "commit": "b47514b8f4ae3207c499a69eec05c29cf2182af8" }, + "outline.nvim": { "branch": "main", "commit": "6c44527837ff7ac1cd054dc365a721e881020a2e" }, "packer.nvim": { "branch": "master", "commit": "ea0cc3c59f67c440c5ff0bbe4fb9420f4350b9a3" }, - "plantuml-syntax": { "branch": "master", "commit": "8fb95a3ae4354ca2322ef24803d8960fce519eb0" }, + "plantuml-syntax": { "branch": "master", "commit": "9d4900aa16674bf5bb8296a72b975317d573b547" }, "playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" }, - "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, + "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, "popfix": { "branch": "master", "commit": "bf3cc436df63cd535350d5ef1b951c91554d4b01" }, "popui.nvim": { "branch": "master", "commit": "4d903e46fdb5eef25fa79ef1b598f5340a2674b0" }, "popup.nvim": { "branch": "master", "commit": "b7404d35d5d3548a82149238289fa71f7f6de4ac" }, "presence.nvim": { "branch": "main", "commit": "87c857a56b7703f976d3a5ef15967d80508df6e6" }, - "statuscol.nvim": { "branch": "main", "commit": "93d8bcda516fc86e11c03f9ef577bae9a72fba0e" }, - "supermaven-nvim": { "branch": "main", "commit": "d71257f431e190d9236d7f30da4c2d659389e91f" }, - "tailwind-tools.nvim": { "branch": "master", "commit": "0cd8a54915fc7f597f4b79441291349002b82ce4" }, + "roslyn.nvim": { "branch": "main", "commit": "d36bc977177c919c191f9f0190d71417ba0b055c" }, + "statuscol.nvim": { "branch": "main", "commit": "1022f922b77b44c36f8057ac29adbfd89ce86958" }, + "supermaven-nvim": { "branch": "main", "commit": "3da044bbc23a354e9cb17602ed2d5ca8528173bb" }, + "tailwind-tools.nvim": { "branch": "master", "commit": "0f2f03d535578d16042cd601e85c9236bd469456" }, "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, - "telescope.nvim": { "branch": "master", "commit": "5972437de807c3bc101565175da66a1aa4f8707a" }, + "telescope.nvim": { "branch": "master", "commit": "175178e3889c13a840f036d464aee2d145157b9e" }, "template-string.nvim": { "branch": "main", "commit": "419bfb2e4d5f0e6ddd0d4435f85b69da0d88d524" }, - "todo-comments.nvim": { "branch": "main", "commit": "8f45f353dc3649cb9b44cecda96827ea88128584" }, + "todo-comments.nvim": { "branch": "main", "commit": "ae0a2afb47cf7395dc400e5dc4e05274bf4fb9e0" }, "typescript.nvim": { "branch": "main", "commit": "4de85ef699d7e6010528dcfbddc2ed4c2c421467" }, "vim-caddyfile": { "branch": "master", "commit": "24fe0720551883e407cb70ae1d7c03f162d1d5a0" }, "vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" } diff --git a/lua/basics.lua b/lua/basics.lua index 41a5917..18f8cc9 100644 --- a/lua/basics.lua +++ b/lua/basics.lua @@ -28,3 +28,16 @@ set.signcolumn = "auto:2" -- set leader vim.g.mapleader = " " + +vim.filetype.add( + { + extension = { + zsh = "sh", + sh = "sh" + }, + filename = { + [".zshrc"] = "sh", + [".zshenv"] = "sh" + } + } +) diff --git a/lua/keys.lua b/lua/keys.lua index b17f26f..a7c4424 100644 --- a/lua/keys.lua +++ b/lua/keys.lua @@ -44,6 +44,7 @@ vim.api.nvim_set_keymap("", "", "", {silent = true}) vim.api.nvim_set_keymap("", "", "", {silent = true}) vim.api.nvim_set_keymap("", "", "", {silent = true}) vim.api.nvim_set_keymap("", "", "", {silent = true, noremap = true}) +vim.api.nvim_set_keymap("n", "i", "!ocamlc -i -c %>%i", {silent = true}) local insert_random_uuid = function() local id, _ = vim.fn.system("uuidgen"):gsub("\n", ""):gsub("-", ""):upper() diff --git a/lua/plugins.lua b/lua/plugins.lua index cb32b1b..5c5a201 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -80,13 +80,17 @@ require("lazy").setup( "williamboman/mason.nvim", "williamboman/mason-lspconfig.nvim", "neovim/nvim-lspconfig", - "jay-babu/mason-null-ls.nvim" + "jay-babu/mason-null-ls.nvim", + "seblj/roslyn.nvim" } }, { "luckasRanarison/tailwind-tools.nvim", dependencies = {"nvim-treesitter/nvim-treesitter"}, opts = { + server = { + override = false + }, document_color = { enabled = true, -- can be toggled by commands kind = "inline", -- "inline" | "foreground" | "background" diff --git a/lua/plugins/formatter.lua b/lua/plugins/formatter.lua index ec12171..5b0cd1f 100644 --- a/lua/plugins/formatter.lua +++ b/lua/plugins/formatter.lua @@ -63,16 +63,35 @@ require("formatter").setup( stdin = true } end + }, + xml = { + function() + return { + exe = "xmllint", + args = {"--format", "-"}, + stdin = true + } + end + }, + cs = { + function() + return { + exe = "dotnet-csharpier", + args = {"--write-stdout"}, + stdin = true + } + end + }, + -- ocaml + ocaml = { + function() + return { + exe = "ocamlformat", + args = {"--name", vim.api.nvim_buf_get_name(0), "-"}, + stdin = true + } + end } - -- cs = { - -- function() - -- return { - -- exe = "dotnet", - -- args = {"csharpier", "--write-stdout"}, - -- stdin = true - -- } - -- end - -- } } } ) @@ -81,7 +100,7 @@ vim.api.nvim_exec( [[ augroup FormatAutogroup autocmd! - autocmd BufWritePost *.h,*.cpp,*.rs,*.lua,*.tsx,*.ts,*.js,*.jsx,*.json,*.jsonc,*.swift FormatWrite + autocmd BufWritePost *.cs,*.h,*.cpp,*.rs,*.lua,*.tsx,*.ts,*.js,*.jsx,*.json,*.jsonc,*.swift,*.xml,*.sln,*.csproj,*.ml FormatWrite augroup END ]], true @@ -90,7 +109,7 @@ local formatGrp = vim.api.nvim_create_augroup("Format", {clear = true}) vim.api.nvim_create_autocmd( "BufWritePre", { - pattern = "*.cs,*.php", + pattern = "*.php", command = "lua vim.lsp.buf.format { async = false }", group = formatGrp } diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index bda2d25..416ae96 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -25,13 +25,13 @@ local common_servers = { "lua_ls", "html", "vimls", - "yamlls" + "yamlls", + "ocamllsp" } local extra_servers = { "vtsls", "eslint", "jsonls", - "omnisharp", "rust_analyzer", "tailwindcss" } @@ -157,7 +157,13 @@ require "lspconfig".eslint.setup { ".eslintrc.cjs", ".eslintrc.yaml", ".eslintrc.yml", - ".eslintrc.json" + ".eslintrc.json", + "eslint.config.js", + "eslint.config.cjs", + "eslint.config.yaml", + "eslint.config.yml", + "eslint.config.json", + "eslint.config.ts" ), handlers = { ["eslint/openDoc"] = function(_, result) @@ -187,139 +193,153 @@ end local path = vim.uv.cwd() local config_path = path .. "/.vscode/settings.json" -local tailwindcss_settings = {} -function patch_tailwindcss_settings() - if vim.uv.fs_stat(config_path) then - local file = vim.fn.readfile(config_path) - local vscode_settings = vim.fn.json_decode(file) - tailwindcss_settings = - vim.tbl_deep_extend( - "force", - tailwindcss_settings, - { - tailwindCSS = { - rootFontSize = vscode_settings["tailwindCSS.rootFontSize"] - } +local tailwindcss_settings = { + tailwindCSS = { + experimental = { + classRegex = { + {"cva\\(([^)]*)\\)", '["\'`]([^"\'`]*).*?["\'`]'}, + {"cx\\(([^)]*)\\)", '(?:\'|"|`)([^\']*)(?:\'|"|`)'}, + {"cn\\(([^)]*)\\)", '["\'`]([^"\'`]*).*?["\'`]'}, + {"([a-zA-Z0-9\\-:]+)"} } - ) - end -end -pcall(patch_tailwindcss_settings) + } + } +} +-- local function patch_tailwindcss_settings() +-- if vim.uv.fs_stat(config_path) then +-- local file = vim.fn.readfile(config_path) +-- local vscode_settings = vim.fn.json_decode(file) +-- tailwindcss_settings = +-- vim.tbl_deep_extend( +-- "force", +-- tailwindcss_settings, +-- { +-- tailwindCSS = { +-- rootFontSize = vscode_settings["tailwindCSS.rootFontSize"] +-- } +-- } +-- ) +-- end +-- end +-- pcall(patch_tailwindcss_settings) nvim_lsp.tailwindcss.setup { on_attach = on_attach, flags = { debounce_text_changes = 150 }, capabilities = capabilities, - -- on_init = function(client) - -- local path = client.workspace_folders and client.workspace_folders[1] and client.workspace_folders[1].name - -- local config_path = path .. "/.vscode/settings.json" - -- if vim.uv.fs_stat(config_path) then - -- local file = vim.fn.readfile(config_path) - -- local vscode_settings = vim.fn.json_decode(file) - -- client.config.settings = - -- vim.tbl_deep_extend( - -- "force", - -- client.config.settings, - -- { - -- tailwindCSS = { - -- rootFontSize = vscode_settings["tailwindCSS.rootFontSize"] - -- } - -- } - -- ) - -- client.notify(vim.lsp.protocol.Methods.workspace_didChangeConfiguration, {settings = client.config.settings}) - -- end - -- end, - settings = tailwindcss_settings + -- settings = tailwindcss_settings + settings = { + tailwindCSS = { + experimental = { + classRegex = { + {"cva\\(([^)]*)\\)", '["\'`]([^"\'`]*).*?["\'`]'}, + {"cx\\(([^)]*)\\)", '(?:\'|"|`)([^\']*)(?:\'|"|`)'}, + {"cn\\(([^)]*)\\)", '(?:\'|"|`)([^\']*)(?:\'|"|`)'} + } + } + } + } } -nvim_lsp.omnisharp.setup { - cmd = {"OmniSharp"}, - enable_editorconfig_support = true, - enable_roslyn_analyzers = true, - enable_import_completion = true, - 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 - }, - capabilities = capabilities -} +require("roslyn").setup( + { + config = {}, + exe = { + "dotnet", + vim.fs.joinpath(vim.fn.stdpath("data"), "roslyn", "Microsoft.CodeAnalysis.LanguageServer.dll") + }, + filewatching = true + } +) + +-- nvim_lsp.omnisharp.setup { +-- cmd = {"OmniSharp"}, +-- enable_editorconfig_support = true, +-- enable_roslyn_analyzers = true, +-- enable_import_completion = true, +-- 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 +-- }, +-- capabilities = capabilities +-- } nvim_lsp.rust_analyzer.setup { on_attach = on_attach,