From b49f437428847ce244661a4fbbd85a3edc68efa5 Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Mon, 11 Mar 2024 14:38:16 +0100 Subject: [PATCH 1/5] add yamlls --- lua/custom/configs/lspconfig.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/custom/configs/lspconfig.lua b/lua/custom/configs/lspconfig.lua index 8175149..efaf2ab 100644 --- a/lua/custom/configs/lspconfig.lua +++ b/lua/custom/configs/lspconfig.lua @@ -13,6 +13,7 @@ local servers = { -- "rust_analyzer", -- rustaceanvim wants to do that, but the builtin thing has better integration! "bashls", "cmake", + "yamlls", } for _, lsp in ipairs(servers) do From 04bef0b100bf5733cf17c88436fc9bcff7583fa4 Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Tue, 12 Mar 2024 11:33:07 +0100 Subject: [PATCH 2/5] moar lsp --- lua/custom/configs/lspconfig.lua | 65 +++++++++++++++++++++++++++++++ lua/custom/utils.lua | 12 +++--- spell/en.utf-8.add | 2 + spell/en.utf-8.add.spl | Bin 3792 -> 3831 bytes 4 files changed, 73 insertions(+), 6 deletions(-) diff --git a/lua/custom/configs/lspconfig.lua b/lua/custom/configs/lspconfig.lua index efaf2ab..4a98009 100644 --- a/lua/custom/configs/lspconfig.lua +++ b/lua/custom/configs/lspconfig.lua @@ -14,6 +14,8 @@ local servers = { "bashls", "cmake", "yamlls", + "textlsp", + "texlab", } for _, lsp in ipairs(servers) do @@ -47,3 +49,66 @@ lspconfig.rust_analyzer.setup { }, }, } + +lspconfig.ltex.setup { + on_attach = on_attach, + capabilities = capabilities, + settings = { + ltex = { + -- specific language (such as en-GB or de-DE is recommended, but I + -- want multilingual) + language = "en-GB", + enabled = { + -- I'm writing in german but the commands are in english, + -- does not really work + -- "bibtex", + -- "tex", + -- "latex", + "gitcommit", + "markdown", + "org", + "restructuredtext", + "rsweave", + "quarto", + "rmd", + "context", + "html", + "xhtml", + }, + }, + }, +} + +lspconfig.textlsp.setup { + on_attach = on_attach, + capabilities = capabilities, + filetypes = { + "bibtex", + "tex", + "latex", + "gitcommit", + "markdown", + "org", + "restructuredtext", + "rsweave", + "quarto", + "rmd", + "context", + "html", + "xhtml", + }, + settings = { + textLSP = { + analysers = { + languagetool = { + check_text = { + on_change = false, + on_open = true, + on_save = true, + }, + enabled = false, + }, + }, + }, + }, +} diff --git a/lua/custom/utils.lua b/lua/custom/utils.lua index 524c2d4..11158b9 100644 --- a/lua/custom/utils.lua +++ b/lua/custom/utils.lua @@ -1,9 +1,9 @@ local M = {} --- this function will split a string into a table of tokens, like it would --- be passed into the `argv` of a program that was executed from the commandline --- --- @param string raw string of cli args that should be split --- @return table tokens args as a table +--- this function will split a string into a table of tokens, like it would +--- be passed into the `argv` of a program that was executed from the commandline +--- +--- @param raw string string of cli args that should be split +--- @return table tokens args as a table M.tokenize_args = function(raw) -- NOTE: string.gmatch is does not use regex, but a smaller pattern matcher! -- A complete regex parser would be larger than lua itself. See @@ -47,7 +47,7 @@ end --- dumps a variable into a string, so it can be printed. This is meant for --- debug prints ---- @param any t any variable +--- @param t any variable --- @return string t_dumped t dumped to string M.dump = function(t) if type(t) == 'table' then diff --git a/spell/en.utf-8.add b/spell/en.utf-8.add index e3a8d52..189375b 100644 --- a/spell/en.utf-8.add +++ b/spell/en.utf-8.add @@ -295,3 +295,5 @@ sequenceDiagram style BT style +T2000 +TINF22CS diff --git a/spell/en.utf-8.add.spl b/spell/en.utf-8.add.spl index 754a803d31e352e635f9512a9ab18981cf5cdfb5..caeff38b716c19839225114b9774294f359c5766 100644 GIT binary patch delta 139 zcmca0`(2hV%+t5HAT=k)=syDkr@%(OOI$LXMvM$h`bnu7nT!mKf;ss`6^sTz$jHE; zVleq5m#I8cZXRPQV=-e1Vux&gH3K?B4v0r<;+9v1oD&UoilP C{2U1Y From fbde01e2dd5706842341f1d4b255450c372d391f Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Tue, 12 Mar 2024 11:55:34 +0100 Subject: [PATCH 3/5] format latex --- lua/custom/configs/conform.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/custom/configs/conform.lua b/lua/custom/configs/conform.lua index a020d83..766f55e 100644 --- a/lua/custom/configs/conform.lua +++ b/lua/custom/configs/conform.lua @@ -11,6 +11,9 @@ local options = { sh = { "shfmt" }, toml = { "taplo" }, rust = { "rustfmt" }, + + tex = { "latexindent" }, + latex = { "latexindent" }, }, -- adding same formatter for multiple filetypes can look too much work for some From 65155cf697385d0516f3f5f118e2ecd41052cf2b Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Tue, 12 Mar 2024 17:23:58 +0100 Subject: [PATCH 4/5] join and formatoptions --- lua/custom/init.lua | 2 +- lua/custom/mappings.lua | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lua/custom/init.lua b/lua/custom/init.lua index 115e432..609b5b6 100644 --- a/lua/custom/init.lua +++ b/lua/custom/init.lua @@ -52,7 +52,7 @@ opt.startofline = false -- Cursor in same column for few commands opt.splitbelow = true -- Splits open bottom right opt.splitright = true opt.breakindentopt = { shift = 2, min = 20 } -opt.formatoptions = "qnlmBjp" -- see :h fo-table & :h formatoptions +opt.formatoptions = "qnlmBjpt" -- see :h fo-table & :h formatoptions -- Diff -- === diff --git a/lua/custom/mappings.lua b/lua/custom/mappings.lua index b8e91a2..937c3a6 100644 --- a/lua/custom/mappings.lua +++ b/lua/custom/mappings.lua @@ -41,7 +41,6 @@ M.disabled = { ["td"] = "", ["wk"] = "", ["#"] = "", - ["J"] = "", }, t = { [""] = "", @@ -50,7 +49,6 @@ M.disabled = { ["#"] = "", ["?"] = "", ["/"] = "", - ["J"] = "", }, } From e357684dea188d14b321be49c5a3bcabd95de345 Mon Sep 17 00:00:00 2001 From: "Christoph J. Scherr" Date: Tue, 12 Mar 2024 17:30:16 +0100 Subject: [PATCH 5/5] disable ltex --- lua/custom/configs/lspconfig.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lua/custom/configs/lspconfig.lua b/lua/custom/configs/lspconfig.lua index 4a98009..3e30794 100644 --- a/lua/custom/configs/lspconfig.lua +++ b/lua/custom/configs/lspconfig.lua @@ -50,7 +50,7 @@ lspconfig.rust_analyzer.setup { }, } -lspconfig.ltex.setup { +local ltex_table = { on_attach = on_attach, capabilities = capabilities, settings = { @@ -61,9 +61,9 @@ lspconfig.ltex.setup { enabled = { -- I'm writing in german but the commands are in english, -- does not really work - -- "bibtex", - -- "tex", - -- "latex", + "bibtex", + "tex", + "latex", "gitcommit", "markdown", "org", @@ -78,6 +78,7 @@ lspconfig.ltex.setup { }, }, } +-- lspconfig.ltex.setup(ltex_table) lspconfig.textlsp.setup { on_attach = on_attach,