step0、参考:language servers used with YCM
step1、安装依赖
下载时 | git |
编译时 | JDK |
运行时 | JDK |
step2、创建~/.lsp/kotlin-language-server
目录
mkdir -p ~/.lsp/kotlin-language-server
step3、使用git命令下载源代码
git -C ~/.lsp clone https://github.com/fwcd/kotlin-language-server
step4、进入~/.lsp/kotlin-language-server
目录并查看内容
step5、在settings.gradle
的开头处加入如下代码
pluginManagement {
repositories {
maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
}
}
step6、将所有的build.gradle
中的mavenCentral()
替换为如下的代码:
maven { url "https://maven.aliyun.com/repository/public" }
step7、编译:
./gradlew --no-daemon server:installDist
step8、在~/.vimrc
中加入如下的配置:
let g:ycm_language_server = [
\{ 'name': 'kotlin',
\ 'filetypes': [ 'kotlin' ],
\ 'cmdline': [ expand( '$HOME/.lsp/kotlin-language-server/server/build/install/server/bin/kotlin-language-server' ) ],
\}
]