From 857f3e546c5ad16fe6050211beeef42887d71b86 Mon Sep 17 00:00:00 2001 From: Who? Me?! Date: Tue, 18 Jun 2019 09:25:59 -0500 Subject: More details on how to set up coc --- docs/user/README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'docs/user') diff --git a/docs/user/README.md b/docs/user/README.md index af8a99a47..d56330192 100644 --- a/docs/user/README.md +++ b/docs/user/README.md @@ -92,7 +92,13 @@ to load path and require it in `init.el` ## Vim and NeoVim * Install coc.nvim by following the instructions at [coc.nvim] + - You will need nodejs installed. + - You may want to include some of the sample vim configurations [from here][coc-vim-conf] + - Note that if you use a plugin manager other than `vim-plug`, you may need to manually + checkout the `release` branch wherever your plugin manager cloned it. Otherwise you will + get errors about a missing javascript file. * Add rust analyzer using: [coc.nvim wiki][coc-wiki] + - Use `:CocConfig` in command mode to edit the config file. ```jsonc "languageserver": { @@ -101,11 +107,26 @@ to load path and require it in `init.el` "filetypes": ["rust"], "rootPatterns": ["Cargo.toml"] } + } +``` + +For those not familiar with js, the whole file should be enclosed in `{` and `}`, with all of your config options in between. So for example, if rust-analyzer was your only language server, you could do the following: + +```jsonc +{ + "languageserver": { + "rust": { + "command": "ra_lsp_server", + "filetypes": ["rust"], + "rootPatterns": ["Cargo.toml"] + } + } } ``` [coc.nvim]: https://github.com/neoclide/coc.nvim [coc-wiki]: https://github.com/neoclide/coc.nvim/wiki/Language-servers#rust +[coc-vim-conf]: https://github.com/neoclide/coc.nvim/#example-vim-configuration ## Sublime Text 3 -- cgit v1.2.3