summaryrefslogtreecommitdiffstats
path: root/.config
diff options
context:
space:
mode:
authorYigit Sever2025-10-17 12:48:18 +0300
committerYigit Sever2025-10-17 12:48:18 +0300
commit544493be54bc3bf531cea1b20e9fe36aba5a5d90 (patch)
tree45dea8312ad9e1b3b40afee095844cab32a194b6 /.config
parent6edcdc57e0cdee04ced99e716ca64ece0c53b6f9 (diff)
downloaddotfiles-544493be54bc3bf531cea1b20e9fe36aba5a5d90.tar.gz
dotfiles-544493be54bc3bf531cea1b20e9fe36aba5a5d90.tar.bz2
dotfiles-544493be54bc3bf531cea1b20e9fe36aba5a5d90.zip
nvim: update lsp config
Diffstat (limited to '.config')
-rw-r--r--.config/nvim/lua/plugins/lsp.lua49
1 files changed, 25 insertions, 24 deletions
diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua
index cb3dcca..8bc496c 100644
--- a/.config/nvim/lua/plugins/lsp.lua
+++ b/.config/nvim/lua/plugins/lsp.lua
@@ -12,35 +12,36 @@ return {
12 local map = require("helpers.keys").map 12 local map = require("helpers.keys").map
13 13
14 map('n', '<leader>e', vim.diagnostic.open_float, "lsp: open diagnostics float") 14 map('n', '<leader>e', vim.diagnostic.open_float, "lsp: open diagnostics float")
15 map('n', '[d', vim.diagnostic.goto_prev, "lsp: goto previous diagnostic") 15 map('n', '[d', function() vim.diagnostic.jump({ count = -1, float = true }) end,
16 map('n', ']d', vim.diagnostic.goto_next, "lsp: goto next diagnostic") 16 "lsp: goto previous diagnostic")
17 map('n', ']d', function() vim.diagnostic.jump({ count = 1, float = true }) end, "lsp: goto next diagnostic")
17 18
18 -- set up cool signs for diagnostics 19 vim.diagnostic.config({
19 local signs = { Error = " ", Warn = "", Hint = "", Info = "" } 20 underline = true,
20 for type, icon in pairs(signs) do
21 local hl = "DiagnosticSign" .. type
22 vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
23 end
24
25 -- Diagnostic config
26 local config = {
27 virtual_text = false,
28 signs = { 21 signs = {
29 active = signs, 22 active = true,
23 text = {
24 [vim.diagnostic.severity.ERROR] = "",
25 [vim.diagnostic.severity.WARN] = "",
26 [vim.diagnostic.severity.HINT] = "󰟃",
27 [vim.diagnostic.severity.INFO] = "",
28 },
30 }, 29 },
31 update_in_insert = true, 30 virtual_text = false,
32 underline = true,
33 severity_sort = true,
34 float = { 31 float = {
35 focusable = true,
36 style = "minimal",
37 border = "rounded",
38 source = "always",
39 header = "", 32 header = "",
40 prefix = "", 33 border = "rounded",
34 format = function(diagnostic)
35 return string.format(
36 "%s (%s) [%s]",
37 diagnostic.message,
38 diagnostic.source,
39 diagnostic.code or diagnostic.user_data.lsp.code
40 )
41 end,
41 }, 42 },
42 } 43
43 vim.diagnostic.config(config) 44 })
44 45
45 -- 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.
46 local on_attach = function(_, bufnr) 47 local on_attach = function(_, bufnr)
@@ -195,7 +196,7 @@ return {
195 require("ltex_extra").setup { 196 require("ltex_extra").setup {
196 load_langs = { "en-GB" }, 197 load_langs = { "en-GB" },
197 init_check = true, 198 init_check = true,
198 log_level = "none", 199 log_level = "warn",
199 } 200 }
200 end, 201 end,
201 filetypes = { "bib", "gitcommit", "markdown", "org", "plaintex", "rst", "rnoweb", "tex", "pandoc", "quarto", "rmd", "context", "mail", "text" }, 202 filetypes = { "bib", "gitcommit", "markdown", "org", "plaintex", "rst", "rnoweb", "tex", "pandoc", "quarto", "rmd", "context", "mail", "text" },