aboutsummaryrefslogtreecommitdiff
path: root/vim/.config/nvim/lsp/textlsp.lua
blob: a1dbfc8bddb68606f586993d0c83912ad90d7866 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
return {
  cmd = {"textlsp"}, -- You may need to provide the full path to textlsp if not in $PATH
  filetypes = { "markdown", "org", "latex", "txt", "md", "markdown" }, -- and any other you want as plain text
  root_markers = {
    ".git",
  },
  single_file_support = true,
  capabilities = {
    textDocument = {
      completion = {
        editsNearCursor = true,
      },
    },
    -- textLSP does not require offsetEncoding, but you may include it for consistency:
    offsetEncoding = { "utf-8", "utf-16" },
  },
  settings = {
    textLSP = {
      analysers = {
        languagetool = {
          enabled = false,
          -- check_text = {
          --   on_open = true,
          --   on_save = true,
          --   on_change = false,
          -- },
        },
        ollama = {
          enabled = true,
          check_text = {
            on_open = false,
            on_save = true,
            on_change = false,
          },
          model = "phi3:3.8b-instruct",
          max_token = 50,
        },
        -- enable and configure other analyzers as desired
      },
      documents = {
        language = "auto:en",
        min_length_language_detect = 20,
        org = { org_todo_keywords = { "TODO", "IN_PROGRESS", "DONE" } },
        txt = { parse = true },
      },
    },
  },
}