summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author2025-04-01 21:18:19 +0530
committer2025-04-01 21:18:19 +0530
commit88e8fc47c15982d57ab5b23071137c92bfd53d99 (patch)
treecdd6c69fac6b6cdc474692a473ff65153a656b73
parentPort to 0.11 Drop Plugins (diff)
downloaddotfiles-88e8fc47c15982d57ab5b23071137c92bfd53d99.tar
dotfiles-88e8fc47c15982d57ab5b23071137c92bfd53d99.tar.gz
dotfiles-88e8fc47c15982d57ab5b23071137c92bfd53d99.tar.bz2
dotfiles-88e8fc47c15982d57ab5b23071137c92bfd53d99.tar.lz
dotfiles-88e8fc47c15982d57ab5b23071137c92bfd53d99.tar.xz
dotfiles-88e8fc47c15982d57ab5b23071137c92bfd53d99.tar.zst
dotfiles-88e8fc47c15982d57ab5b23071137c92bfd53d99.zip
Add LSP config
-rw-r--r--.config/nvim/lsp/clangd.lua23
-rw-r--r--.config/nvim/lsp/cssls.lua11
-rw-r--r--.config/nvim/lsp/gopls.lua21
-rw-r--r--.config/nvim/lsp/html.lua11
-rw-r--r--.config/nvim/lsp/jsonls.lua10
-rw-r--r--.config/nvim/lsp/lua_ls.lua32
-rw-r--r--.config/nvim/lsp/mesonlsp.lua9
-rw-r--r--.config/nvim/lsp/ruff.lua10
-rw-r--r--.config/nvim/lsp/ts_ls.lua39
9 files changed, 166 insertions, 0 deletions
diff --git a/.config/nvim/lsp/clangd.lua b/.config/nvim/lsp/clangd.lua
new file mode 100644
index 0000000..4f0b351
--- /dev/null
+++ b/.config/nvim/lsp/clangd.lua
@@ -0,0 +1,23 @@
+return {
+ cmd = { 'clangd' },
+ filetypes = { 'c', 'cpp', 'objc', 'objcpp', 'cuda', 'proto' },
+ root_markers = {
+ '.clangd',
+ '.clang-tidy',
+ '.clang-format',
+ 'compile_commands.json',
+ 'compile_flags.txt',
+ 'meson.build',
+ },
+ settings = {
+ clangd = {
+ InlayHints = {
+ Designators = true,
+ Enabled = true,
+ ParameterNames = true,
+ DeducedTypes = true,
+ },
+ fallbackFlags = { "-std=c++20" },
+ },
+ }
+}
diff --git a/.config/nvim/lsp/cssls.lua b/.config/nvim/lsp/cssls.lua
new file mode 100644
index 0000000..10b60ec
--- /dev/null
+++ b/.config/nvim/lsp/cssls.lua
@@ -0,0 +1,11 @@
+return {
+ cmd = { 'vscode-css-language-server', '--stdio' },
+ filetypes = { 'css', 'scss', 'less' },
+ init_options = { provideFormatter = true },
+ root_markers = { 'package.json' },
+ settings = {
+ css = { validate = true },
+ scss = { validate = true },
+ less = { validate = true },
+ },
+}
diff --git a/.config/nvim/lsp/gopls.lua b/.config/nvim/lsp/gopls.lua
new file mode 100644
index 0000000..e3d00bc
--- /dev/null
+++ b/.config/nvim/lsp/gopls.lua
@@ -0,0 +1,21 @@
+return {
+ cmd = { 'gopls' },
+ filetypes = { 'go', 'gomod', 'gowork', 'gotmpl' },
+ root_markers = {
+ 'go.work',
+ 'go.mod',
+ },
+ settings = {
+ gopls = {
+ hints = {
+ rangeVariableTypes = true,
+ parameterNames = true,
+ constantValues = true,
+ assignVariableTypes = true,
+ compositeLiteralFields = true,
+ compositeLiteralTypes = true,
+ functionTypeParameters = true,
+ },
+ },
+ }
+}
diff --git a/.config/nvim/lsp/html.lua b/.config/nvim/lsp/html.lua
new file mode 100644
index 0000000..cc769d5
--- /dev/null
+++ b/.config/nvim/lsp/html.lua
@@ -0,0 +1,11 @@
+return {
+ cmd = { 'vscode-html-language-server', '--stdio' },
+ filetypes = { 'html', 'templ' },
+ root_markers = { 'package.json' },
+ settings = {},
+ init_options = {
+ provideFormatter = true,
+ embeddedLanguages = { css = true, javascript = true },
+ configurationSection = { 'html', 'css', 'javascript' },
+ },
+}
diff --git a/.config/nvim/lsp/jsonls.lua b/.config/nvim/lsp/jsonls.lua
new file mode 100644
index 0000000..234cc94
--- /dev/null
+++ b/.config/nvim/lsp/jsonls.lua
@@ -0,0 +1,10 @@
+return {
+ cmd = { 'vscode-json-language-server', '--stdio' },
+ filetypes = { 'json', 'jsonc' },
+ init_options = {
+ provideFormatter = true,
+ },
+ root_marker = {},
+ single_file_support = true,
+}
+
diff --git a/.config/nvim/lsp/lua_ls.lua b/.config/nvim/lsp/lua_ls.lua
new file mode 100644
index 0000000..92e92fc
--- /dev/null
+++ b/.config/nvim/lsp/lua_ls.lua
@@ -0,0 +1,32 @@
+return {
+ cmd = { 'lua-language-server' },
+ filetypes = { 'lua' },
+ root_markers = {
+ '.luarc.json',
+ '.luarc.jsonc',
+ '.luacheckrc',
+ '.stylua.toml',
+ 'stylua.toml',
+ 'selene.toml',
+ 'selene.yml',
+ },
+ settings = {
+ Lua = {
+ runtime = {
+ version = 'LuaJIT'
+ },
+ workspace = {
+ library = vim.api.nvim_get_runtime_file("", true)
+ },
+ completion = {
+ callSnippet = 'Replace',
+ },
+ diagnostics = {
+ disable = { 'missing-fields' }
+ },
+ hint = {
+ enable = true
+ }
+ },
+ }
+}
diff --git a/.config/nvim/lsp/mesonlsp.lua b/.config/nvim/lsp/mesonlsp.lua
new file mode 100644
index 0000000..6e7dd5d
--- /dev/null
+++ b/.config/nvim/lsp/mesonlsp.lua
@@ -0,0 +1,9 @@
+return {
+ cmd = { 'mesonlsp', '--lsp' },
+ filetypes = { 'meson' },
+ root_markers = {
+ 'meson.build',
+ 'meson_options.txt',
+ 'meson.options'
+ },
+}
diff --git a/.config/nvim/lsp/ruff.lua b/.config/nvim/lsp/ruff.lua
new file mode 100644
index 0000000..0d174b3
--- /dev/null
+++ b/.config/nvim/lsp/ruff.lua
@@ -0,0 +1,10 @@
+return {
+ cmd = { 'ruff', 'server' },
+ filetypes = { 'python' },
+ root_marker = {
+ 'pyproject.toml',
+ 'ruff.toml',
+ '.ruff.toml'
+ },
+ single_file_support = true,
+}
diff --git a/.config/nvim/lsp/ts_ls.lua b/.config/nvim/lsp/ts_ls.lua
new file mode 100644
index 0000000..860951b
--- /dev/null
+++ b/.config/nvim/lsp/ts_ls.lua
@@ -0,0 +1,39 @@
+return {
+ init_options = { hostInfo = 'neovim' },
+ cmd = { 'typescript-language-server', '--stdio' },
+ filetypes = {
+ 'javascript',
+ 'javascriptreact',
+ 'javascript.jsx',
+ 'typescript',
+ 'typescriptreact',
+ 'typescript.tsx',
+ },
+ root_markers = { 'tsconfig.json', 'jsconfig.json', 'package.json'},
+ settings = {
+ typescript = {
+ inlayHints = {
+ includeInlayParameterNameHints = "all",
+ includeInlayParameterNameHintsWhenArgumentMatchesName = false,
+ includeInlayFunctionParameterTypeHints = true,
+ includeInlayVariableTypeHints = true,
+ includeInlayVariableTypeHintsWhenTypeMatchesName = false,
+ includeInlayPropertyDeclarationTypeHints = true,
+ includeInlayFunctionLikeReturnTypeHints = true,
+ includeInlayEnumMemberValueHints = true,
+ },
+ },
+ javascript = {
+ inlayHints = {
+ includeInlayParameterNameHints = "all",
+ includeInlayParameterNameHintsWhenArgumentMatchesName = false,
+ includeInlayFunctionParameterTypeHints = true,
+ includeInlayVariableTypeHints = true,
+ includeInlayVariableTypeHintsWhenTypeMatchesName = false,
+ includeInlayPropertyDeclarationTypeHints = true,
+ includeInlayFunctionLikeReturnTypeHints = true,
+ includeInlayEnumMemberValueHints = true,
+ },
+ },
+ }
+}