From 6987d4bb75b588bcbaffa49e8716fe6f0db4037d Mon Sep 17 00:00:00 2001 From: Martino Pilia Date: Fri, 26 Apr 2019 11:41:08 +0200 Subject: [PATCH] Add ALE --- ALE.md | 30 ++++++++++++++++++++++++++++++ _Sidebar.md | 1 + vim-lsc.md | 2 +- vim-lsp.md | 2 +- 4 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 ALE.md diff --git a/ALE.md b/ALE.md new file mode 100644 index 0000000..73a9939 --- /dev/null +++ b/ALE.md @@ -0,0 +1,30 @@ +Install [ALE](https://github.com/w0rp/ale) following its README. + +ALE automatically loads all available linters and LSP clients for the filetype so, if `ccls` is correctly installed, it should work out-of-the-box. Moreover, ALE will automatically detect the root folder of your project. + +To set init options for `ccls`, add to `~/.vimrc` or `~/.vim/vimrc` (example for `cpp` files, set other filetypes as needed): + +```viml +let g:ale_cpp_ccls_init_options = { +\ 'cache': { +\ 'directory': '/tmp/ccls/cache'), +\ }, +\ } +``` + +Diagnostic is enabled out-of-the-box. Completion (omnifunc) can be enabled with: + +```viml +let g:ale_completion_enabled = 1 +``` + +ALE also provides a completion source for [deoplete](https://github.com/Shougo/deoplete.nvim), which should work out-of-the-box if deoplete is installed and enabled. + +ALE exposes commands to invoke LSP features (see `|ale|`): +```viml +" Example keybindings +nn :ALEGoToDefinition +nn :ALEFindReferences +nn :ALESymbolSearch +nn :ALEHover +``` \ No newline at end of file diff --git a/_Sidebar.md b/_Sidebar.md index 53a328c..2be5cdb 100644 --- a/_Sidebar.md +++ b/_Sidebar.md @@ -7,6 +7,7 @@ + [[lsp-mode]] (+ emacs-ccls) + [[eglot]] - Vim/Neovim + + [[ALE]] + [[coc.nvim]] + [[LanguageClient-neovim]] + [[vim-lsp]] diff --git a/vim-lsc.md b/vim-lsc.md index 09b5ba0..d56b0bc 100644 --- a/vim-lsc.md +++ b/vim-lsc.md @@ -16,7 +16,7 @@ let g:lsc_server_commands = { \} ``` -If the [compilation database](https://github.com/MaskRay/ccls/wiki/compile_commands.json) is correctly set, then things should work (e.g. reference highlight of the symbol under the cursor should be visible). See `|lsc-commands|` for the list of all available commands. +If the [compilation database](https://github.com/MaskRay/ccls/wiki/Project-Setup) is correctly set, then things should work (e.g. reference highlight of the symbol under the cursor should be visible). See `|lsc-commands|` for the list of all available commands. Default mappings are provided out-of-the-box (see `|lsc-default-map|`). To set custom mappings, change the values in `|g:lsc_auto_map|`, e.g.: diff --git a/vim-lsp.md b/vim-lsp.md index 873d534..ec0fe80 100644 --- a/vim-lsp.md +++ b/vim-lsp.md @@ -28,4 +28,4 @@ nn :LspWorkspaceSymbol nn :LspDocumentSymbol ``` -Now it's good to go! Navigate to a C/C++/... project and test. Make sure you have [compilation database](https://github.com/MaskRay/ccls/wiki/compile_commands.json) in that project. +Now it's good to go! Navigate to a C/C++/... project and test. Make sure you have [compilation database](https://github.com/MaskRay/ccls/wiki/Project-Setup) in that project.