🪴 my neovim config:)
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(config/lsp): add lsp configs

robin 0d1552f9 afb78a4b

+116
+16
config/lsp/denols.lua
··· 1 + return { 2 + root_markers = { "deno.json", "deno.jsonc" }, 3 + single_file_support = false, 4 + settings = { 5 + deno = { 6 + inlayHints = { 7 + parameterNames = { enabled = "all", suppressWhenArgumentMatchesName = true }, 8 + parameterTypes = { enabled = true }, 9 + variableTypes = { enabled = true, suppressWhenTypeMatchesName = true }, 10 + propertyDeclarationTypes = { enabled = true }, 11 + functionLikeReturnTypes = { enable = true }, 12 + enumMemberValues = { enabled = true }, 13 + }, 14 + }, 15 + }, 16 + }
+29
config/lsp/gopls.lua
··· 1 + return { 2 + single_file_support = true, 3 + filetypes = { "go", "gomod", "gosum", "gotmpl", "gohtmltmpl", "gotexttmpl" }, 4 + cmd = { 5 + "gopls", -- share the gopls instance if there is one already 6 + "-remote.debug=:0", 7 + }, 8 + settings = { 9 + gopls = { 10 + hints = { 11 + assignVariableTypes = true, 12 + compositeLiteralFields = true, 13 + compositeLiteralTypes = true, 14 + constantValues = true, 15 + functionTypeParameters = true, 16 + parameterNames = true, 17 + rangeVariableTypes = true, 18 + }, 19 + usePlaceholders = true, 20 + completeUnimported = true, 21 + staticcheck = true, 22 + matcher = "Fuzzy", 23 + diagnosticsDelay = "500ms", 24 + symbolMatcher = "fuzzy", 25 + semanticTokens = true, 26 + gofumpt = true, 27 + }, 28 + }, 29 + }
+13
config/lsp/lua_ls.lua
··· 1 + return { 2 + settings = { 3 + Lua = { 4 + diagnostics = { 5 + globals = { "vim", "package", "table" }, 6 + }, 7 + hint = { 8 + enable = true, 9 + arrayIndex = "Disable", 10 + }, 11 + }, 12 + }, 13 + }
+11
config/lsp/nil_ls.lua
··· 1 + return { 2 + cmd = { "nil" }, 3 + settings = { 4 + ["nil"] = { 5 + formatting = { 6 + command = { "nixfmt" }, 7 + }, 8 + nix = { maxMemoryMB = nil }, 9 + }, 10 + }, 11 + }
+47
config/lsp/ts_ls.lua
··· 1 + return { 2 + single_file_support = false, 3 + root_dir = function(buf) 4 + local root_dir = vim.fs.root(buf, { "package.json", "tsconfig.json" }) 5 + 6 + -- this is needed to make sure we don't pick up root_dir inside node_modules 7 + local node_modules_index = root_dir and root_dir:find("node_modules", 1, true) 8 + if node_modules_index and node_modules_index > 0 then 9 + ---@diagnostic disable-next-line: need-check-nil 10 + root_dir = root_dir:sub(1, node_modules_index - 2) 11 + end 12 + 13 + return root_dir 14 + end, 15 + settings = { 16 + expose_as_code_action = { 17 + "add_missing_imports", 18 + "fix_all", 19 + "remove_unused", 20 + }, 21 + tsserver_path = vim.fn.resolve(vim.fn.exepath("tsserver") .. "/../../lib/node_modules/typescript/bin/tsserver"), 22 + typescript = { 23 + inlayHints = { 24 + includeInlayParameterNameHints = "all", 25 + includeInlayParameterNameHintsWhenArgumentMatchesName = true, 26 + includeInlayFunctionParameterTypeHints = true, 27 + includeInlayVariableTypeHints = true, 28 + includeInlayVariableTypeHintsWhenTypeMatchesName = true, 29 + includeInlayPropertyDeclarationTypeHints = true, 30 + includeInlayFunctionLikeReturnTypeHints = true, 31 + includeInlayEnumMemberValueHints = true, 32 + }, 33 + }, 34 + javascript = { 35 + inlayHints = { 36 + includeInlayParameterNameHints = "all", 37 + includeInlayParameterNameHintsWhenArgumentMatchesName = true, 38 + includeInlayFunctionParameterTypeHints = true, 39 + includeInlayVariableTypeHints = true, 40 + includeInlayVariableTypeHintsWhenTypeMatchesName = true, 41 + includeInlayPropertyDeclarationTypeHints = true, 42 + includeInlayFunctionLikeReturnTypeHints = true, 43 + includeInlayEnumMemberValueHints = true, 44 + }, 45 + }, 46 + }, 47 + }