aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2019-12-28 21:02:27 +0900
committerYasuhiro Matsumoto <mattn.jp@gmail.com>2019-12-28 21:02:27 +0900
commitbab2a078d67caf9e62ea2232b2581cb9197a2579 (patch)
tree70180653a493ecb2d4fe38287eab4fafa7fe1791
parent3f2113c05c219460616a7cb2139d372693c08e09 (diff)
downloadvim-lsp-settings-bab2a078d67caf9e62ea2232b2581cb9197a2579.tar.gz
vim-lsp-settings-bab2a078d67caf9e62ea2232b2581cb9197a2579.tar.bz2
vim-lsp-settings-bab2a078d67caf9e62ea2232b2581cb9197a2579.zip
Add texlab
-rw-r--r--installer/install-texlab.cmd15
-rw-r--r--installer/install-texlab.sh26
-rw-r--r--settings.json40
-rw-r--r--settings/texlab.vim13
4 files changed, 78 insertions, 16 deletions
diff --git a/installer/install-texlab.cmd b/installer/install-texlab.cmd
new file mode 100644
index 0000000..5d7cece
--- /dev/null
+++ b/installer/install-texlab.cmd
@@ -0,0 +1,15 @@
+@echo off
+
+setlocal
+
+cd /d %~dp0
+
+set installer_dir=%cd%
+set server_dir=..\servers\texlab
+if exist %server_dir% rd /Q /S "%server_dir%"
+md "%server_dir%"
+cd /d "%server_dir%"
+
+curl -L -o texlab-x86_64-windows.zip "https://github.com/latex-lsp/texlab/releases/download/v1.8.0/texlab-x86_64-windows.zip"
+call %installer_dir%\run_unzip texlab-x86_64-windows.zip
+del texlab-x86_64-windows.zip
diff --git a/installer/install-texlab.sh b/installer/install-texlab.sh
new file mode 100644
index 0000000..a619ea4
--- /dev/null
+++ b/installer/install-texlab.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+set -e
+
+cd $(dirname $0)
+
+server_dir="../servers/texlab"
+[ -d $server_dir ] && rm -rf $server_dir
+mkdir $server_dir && cd $server_dir
+
+os=$(uname -s | tr "[:upper:]" "[:lower:]")
+
+case $os in
+linux) ;;
+darwin)
+ os="macos"
+ ;;
+*)
+ printf "%s doesn't supported by bash installer" "$os"
+ exit 1
+ ;;
+esac
+
+url="https://github.com/latex-lsp/texlab/releases/download/v1.8.0/texlab-x86_64-$os.tar.gz"
+curl -LO "$url"
+tar xzvf texlab-x86_64-$os.tar.gz
diff --git a/settings.json b/settings.json
index 822ffdb..ccb83af 100644
--- a/settings.json
+++ b/settings.json
@@ -143,6 +143,18 @@
]
}
],
+ "plaintex": [
+ {
+ "command": "texlab",
+ "requires": []
+ },
+ {
+ "command": "digestif",
+ "requires": [
+ "luarocks"
+ ]
+ }
+ ],
"python": [
{
"command": "pyls",
@@ -209,6 +221,18 @@
"requires": []
}
],
+ "tex": [
+ {
+ "command": "texlab",
+ "requires": []
+ },
+ {
+ "command": "digestif",
+ "requires": [
+ "luarocks"
+ ]
+ }
+ ],
"typescript": [
{
"command": "typescript-language-server",
@@ -240,21 +264,5 @@
"npm"
]
}
- ],
- "plaintex": [
- {
- "command": "digestif",
- "requires": [
- "luarocks"
- ]
- }
- ],
- "tex": [
- {
- "command": "digestif",
- "requires": [
- "luarocks"
- ]
- }
]
}
diff --git a/settings/texlab.vim b/settings/texlab.vim
new file mode 100644
index 0000000..3cdee7d
--- /dev/null
+++ b/settings/texlab.vim
@@ -0,0 +1,13 @@
+augroup vimlsp_settings_texlab
+ au!
+ LspRegisterServer {
+ \ 'name': 'texlab',
+ \ 'cmd': {server_info->lsp_settings#get('texlab', 'cmd', [lsp_settings#exec_path('texlab')])},
+ \ 'root_uri':{server_info->lsp_settings#get('texlab', 'root_uri', lsp_settings#root_uri(['.git/']))},
+ \ 'initialization_options': lsp_settings#get('texlab', 'initialization_options', {"diagnostics": "true"}),
+ \ 'whitelist': lsp_settings#get('texlab', 'whitelist', ['plaintex', 'tex']),
+ \ 'blacklist': lsp_settings#get('texlab', 'blacklist', []),
+ \ 'config': lsp_settings#get('texlab', 'config', {}),
+ \ 'workspace_config': lsp_settings#get('texlab', 'workspace_config', {}),
+ \ }
+augroup END