summaryrefslogtreecommitdiffstats
path: root/modules/plugins/lsp/presets/texlab.nix
blob: 00c97bb456275c57fc35a2f9f15ac9f1fdaabfaa (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
{
  config,
  lib,
  pkgs,
  ...
}: let
  inherit (lib.modules) mkIf;
  inherit (lib.nvim.types) mkLspPresetEnableOption;
  inherit (lib.meta) getExe;

  cfg = config.vim.lsp.presets.texlab;
in {
  options.vim.lsp.presets.texlab = {
    enable = mkLspPresetEnableOption {
      option = "texlab";
      display = "TeXLab";
    };
  };

  config = mkIf cfg.enable {
    vim.lsp.servers.texlab = {
      enable = true;
      cmd = [(getExe pkgs.texlab) "run"];
      root_markers = [".git" ".latexmkrc" "latexmkrc" ".texlabroot" "texlabroot" ".texstudio" "Tectonic.toml"];
    };
  };
}