“Coc.nvim”的版本间的差异

来自wrc's Wiki
跳到导航 跳到搜索
(建立内容为“{{lowercase}} [https://github.com/neoclide/coc.nvim coc.nvim](Conquer of Completion)是一个自动补全的框架,依赖 nodejs。 == 自动补全 ==…”的新页面)
 
第68行: 第68行:
  
 
=== [https://github.com/fannheyward/coc-rust-analyzer coc-rust-analyzer] ===
 
=== [https://github.com/fannheyward/coc-rust-analyzer coc-rust-analyzer] ===
 +
 +
[https://github.com/fannheyward/coc-rust-analyzer#configurations 配置选项]。
  
 
== 参考资料 ==
 
== 参考资料 ==

2021年5月2日 (日) 02:12的版本

coc.nvim(Conquer of Completion)是一个自动补全的框架,依赖 nodejs。

自动补全

对不同语言的支持和配置方式见 Language servers

通用的 language server

安装扩展 coc-diagnostic。如 shell:[1]

"diagnostic-languageserver.filetypes": {
    "sh": "shellcheck",
    "PKGBUILD": "pkgbuildcheck"
},
"diagnostic-languageserver.formatFiletypes": {
    "sh": "shfmt"
},
"diagnostic-languageserver.formatters": {
    "shfmt": {
        "command": "shfmt",
        "args": ["-i", "4", "-ci"]
    }
}

定义新的 linter 可参照已有的 Linters。如用于 PKGBUILD 的:[2]

"diagnostic-languageserver.linters": {
    "pkgbuildcheck": {
        "command": "shellcheck",
        "debounce": 100,
        "args": [
            "--shell=bash", "--exclude=SC2034,SC2154,SC2164",
            "--format", "json", "-"
        ],
        "sourceName": "shellcheck",
        "parseJson": {
            "line": "line",
            "column": "column",
            "endLine": "endLine",
            "endColumn": "endColumn",
            "message": "${message} [${code}]",
            "security": "level"
        },
        "securities": {
            "error": "error",
            "warning": "warning",
            "info": "info",
            "style": "hint"
        }
    }
},

扩展

可以为 coc.nvim 安装扩展(extension)

:CocInstall coc-json

coc-word

补全常见英文单词,包括在 coc-sources 中。

只对几个文件类型开启:"coc.source.word.filetypes": ["text", "markdown", "html", "gitcommit", "mail", "nroff", "tex", ""], [3]

coc-rust-analyzer

配置选项

参考资料