diff options
| author | Yigit Sever | 2025-10-24 14:07:56 +0300 |
|---|---|---|
| committer | Yigit Sever | 2025-10-24 14:07:56 +0300 |
| commit | d2b854fd46c726da769ef17a848f6498511ec0ec (patch) | |
| tree | 3f792c67290fbf8002a6c59d5b3ff0c251f8deca | |
| parent | 38f47911d2c2d0b448a11c799ba195d86a4a3097 (diff) | |
| download | dotfiles-d2b854fd46c726da769ef17a848f6498511ec0ec.tar.gz dotfiles-d2b854fd46c726da769ef17a848f6498511ec0ec.tar.bz2 dotfiles-d2b854fd46c726da769ef17a848f6498511ec0ec.zip | |
| -rw-r--r-- | .config/nvim/lua/plugins/lsp.lua | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua index 8bc496c..b10aa58 100644 --- a/.config/nvim/lua/plugins/lsp.lua +++ b/.config/nvim/lua/plugins/lsp.lua | |||
| @@ -43,7 +43,7 @@ return { | |||
| 43 | 43 | ||
| 44 | }) | 44 | }) |
| 45 | 45 | ||
| 46 | -- this function gets run when an lsp connects to a particular buffer. | 46 | -- This function gets run when an LSP connects to a particular buffer. |
| 47 | local on_attach = function(_, bufnr) | 47 | local on_attach = function(_, bufnr) |
| 48 | map = require("helpers.keys").lsp_map | 48 | map = require("helpers.keys").lsp_map |
| 49 | 49 | ||
| @@ -72,17 +72,16 @@ return { | |||
| 72 | capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities) | 72 | capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities) |
| 73 | 73 | ||
| 74 | -- misc. | 74 | -- misc. |
| 75 | local lspconfig = require('lspconfig') | ||
| 76 | local servers = { 'ts_ls', 'jsonls', 'eslint', 'cssls', 'html', 'vala_ls', 'gopls', 'clangd' } | 75 | local servers = { 'ts_ls', 'jsonls', 'eslint', 'cssls', 'html', 'vala_ls', 'gopls', 'clangd' } |
| 77 | for _, lsp in pairs(servers) do | 76 | for _, lsp in pairs(servers) do |
| 78 | lspconfig[lsp].setup { | 77 | vim.lsp.config(lsp, { |
| 79 | on_attach = on_attach, | 78 | on_attach = on_attach, |
| 80 | capabilites = capabilities, | 79 | capabilites = capabilities, |
| 81 | } | 80 | }) |
| 82 | end | 81 | end |
| 83 | 82 | ||
| 84 | -- typst/tinymist | 83 | -- typst/tinymist |
| 85 | require("lspconfig")["tinymist"].setup({ | 84 | vim.lsp.config("tinymist", { |
| 86 | on_attach = on_attach, | 85 | on_attach = on_attach, |
| 87 | capabilities = capabilities, | 86 | capabilities = capabilities, |
| 88 | single_file_support = true, | 87 | single_file_support = true, |
| @@ -95,7 +94,7 @@ return { | |||
| 95 | }) | 94 | }) |
| 96 | 95 | ||
| 97 | -- lua | 96 | -- lua |
| 98 | require("lspconfig")["lua_ls"].setup({ | 97 | vim.lsp.config("lua_ls", { |
| 99 | on_attach = on_attach, | 98 | on_attach = on_attach, |
| 100 | capabilities = capabilities, | 99 | capabilities = capabilities, |
| 101 | settings = { | 100 | settings = { |
| @@ -117,7 +116,7 @@ return { | |||
| 117 | }) | 116 | }) |
| 118 | 117 | ||
| 119 | -- python | 118 | -- python |
| 120 | require("lspconfig")["pylsp"].setup({ | 119 | vim.lsp.config("pylsp", { |
| 121 | on_attach = on_attach, | 120 | on_attach = on_attach, |
| 122 | capabilities = capabilities, | 121 | capabilities = capabilities, |
| 123 | settings = { | 122 | settings = { |
| @@ -140,7 +139,7 @@ return { | |||
| 140 | }) | 139 | }) |
| 141 | 140 | ||
| 142 | -- efm | 141 | -- efm |
| 143 | require("lspconfig")["efm"].setup({ | 142 | vim.lsp.config("efm", { |
| 144 | on_attach = on_attach, | 143 | on_attach = on_attach, |
| 145 | settings = { | 144 | settings = { |
| 146 | initializationOptions = { | 145 | initializationOptions = { |
| @@ -156,7 +155,7 @@ return { | |||
| 156 | filetypes = { 'sh', 'tex' }, | 155 | filetypes = { 'sh', 'tex' }, |
| 157 | }) | 156 | }) |
| 158 | 157 | ||
| 159 | require("lspconfig")["harper_ls"].setup { | 158 | vim.lsp.config("harper_ls", { |
| 160 | on_attach = on_attach, | 159 | on_attach = on_attach, |
| 161 | capabilities = capabilities, | 160 | capabilities = capabilities, |
| 162 | settings = { | 161 | settings = { |
| @@ -186,10 +185,10 @@ return { | |||
| 186 | root_dir = function(fname) | 185 | root_dir = function(fname) |
| 187 | return vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1]) | 186 | return vim.fs.dirname(vim.fs.find('.git', { path = fname, upward = true })[1]) |
| 188 | end, | 187 | end, |
| 189 | } | 188 | }) |
| 190 | 189 | ||
| 191 | -- ltex | 190 | -- ltex |
| 192 | require("lspconfig")["ltex"].setup({ | 191 | vim.lsp.config("ltex", { |
| 193 | capabilities = capabilities, | 192 | capabilities = capabilities, |
| 194 | on_attach = function(client, bufnr) | 193 | on_attach = function(client, bufnr) |
| 195 | on_attach(client, bufnr) | 194 | on_attach(client, bufnr) |
