All Projects → natebosch → Vim Lsc

natebosch / Vim Lsc

Licence: bsd-3-clause
A vim plugin for communicating with a language server

Projects that are alternatives of or similar to Vim Lsc

Ale
Check syntax in Vim asynchronously and fix files, with Language Server Protocol (LSP) support
Stars: ✭ 11,380 (+1988.07%)
Mutual labels:  language-server-protocol, autocomplete
Vim Lsp Cxx Highlight
Vim plugin for C/C++/ObjC semantic highlighting using cquery, ccls, or clangd
Stars: ✭ 231 (-57.61%)
Mutual labels:  language-server-protocol, neovim
Vim Lsp
async language server protocol plugin for vim and neovim
Stars: ✭ 2,230 (+309.17%)
Mutual labels:  language-server-protocol, neovim
Php Language Server
PHP Implementation of the VS Code Language Server Protocol 🆚↔🖥
Stars: ✭ 1,019 (+86.97%)
Mutual labels:  language-server-protocol, autocomplete
Coc Flutter
flutter support for (Neo)vim
Stars: ✭ 259 (-52.48%)
Mutual labels:  neovim, autocomplete
Vista.vim
🌵 Viewer & Finder for LSP symbols and tags
Stars: ✭ 1,218 (+123.49%)
Mutual labels:  language-server-protocol, neovim
Lua Lsp
A Lua language server
Stars: ✭ 219 (-59.82%)
Mutual labels:  language-server-protocol, autocomplete
Autocomplete Swift
Autocompletion for Swift in NeoVim with deoplete.
Stars: ✭ 92 (-83.12%)
Mutual labels:  neovim, autocomplete
jdtls-launcher
The simplest way to install and launch JDTLS
Stars: ✭ 29 (-94.68%)
Mutual labels:  neovim, language-server-protocol
Neomake
Asynchronous linting and make framework for Neovim/Vim
Stars: ✭ 2,512 (+360.92%)
Mutual labels:  linting, neovim
Deoplete Rust
Rust completion for Neovim (Deoplete) via Racer
Stars: ✭ 126 (-76.88%)
Mutual labels:  neovim, autocomplete
Sqls
SQL language server written in Go.
Stars: ✭ 301 (-44.77%)
Mutual labels:  language-server-protocol, autocomplete
Ncm R
R autocompletion for Neovim and vim 8 📝 📊 ⚡️
Stars: ✭ 102 (-81.28%)
Mutual labels:  neovim, autocomplete
Nvim Lspconfig
Quickstart configurations for the Nvim LSP client
Stars: ✭ 3,410 (+525.69%)
Mutual labels:  language-server-protocol, neovim
Coc Angular
Angular Language Service coc extension for (neo)vim
Stars: ✭ 95 (-82.57%)
Mutual labels:  neovim, autocomplete
Intelephense
Intellisense for PHP
Stars: ✭ 212 (-61.1%)
Mutual labels:  language-server-protocol, autocomplete
Fastolympiccoding
Tools for competitive programming for Sublime Text 3
Stars: ✭ 146 (-73.21%)
Mutual labels:  linting, autocomplete
Vim Language Server
VImScript language server, LSP for vim script
Stars: ✭ 264 (-51.56%)
Mutual labels:  neovim, autocomplete
Neovim Init.vim
🏮 The perfect Neovim configuration for productive people who wants to level up their Vim experience with a clean, minimal-looking aesthetic, as well as a highly extensible, easily customizable set of popular tools and shortcuts to boost productivity. 🏮
Stars: ✭ 440 (-19.27%)
Mutual labels:  neovim, autocomplete
Accessible Autocomplete
An autocomplete component, built to be accessible.
Stars: ✭ 474 (-13.03%)
Mutual labels:  autocomplete

Vim Language Server Client

Adds language-aware tooling to vim by communicating with a language server following the language server protocol. For more information see langserver.org.

Installation

Install with your plugin management method of choice. If you don't have a preference check out vim-plug. Install a language server and ensure it is executable from your $PATH.

vim-lsc is compatible with vim 8, and neovim.

Note: When using neovim be sure to use set shortmess-=F to avoid suppressing error messages from this plugin.

Configuration

Map a filetype to the command that starts the language server for that filetype in your vimrc.

let g:lsc_server_commands = {'dart': 'dart_language_server'}

To disable autocomplete in favor of manual completion also add

let g:lsc_enable_autocomplete = v:false

Most interactive features are triggered by commands. You can use g:lsc_auto_map to have them automatically mapped for the buffers which have a language server enabled. You can use the default mappings by setting it to v:true, or specify your own mappings in a dict.

Most keys take strings or lists of strings which are the keys bound to that command in normal mode. The 'ShowHover' key can also be v:true in which case it sets keywordprg instead of a keybind (keywordprg maps K). The 'Completion' key sets a completion function for manual invocation, and should be either 'completefunc' or 'omnifunc' (see :help complete-functions).

" Use all the defaults (recommended):
let g:lsc_auto_map = v:true

" Apply the defaults with a few overrides:
let g:lsc_auto_map = {'defaults': v:true, 'FindReferences': '<leader>r'}

" Setting a value to a blank string leaves that command unmapped:
let g:lsc_auto_map = {'defaults': v:true, 'FindImplementations': ''}

" ... or set only the commands you want mapped without defaults.
" Complete default mappings are:
let g:lsc_auto_map = {
    \ 'GoToDefinition': '<C-]>',
    \ 'GoToDefinitionSplit': ['<C-W>]', '<C-W><C-]>'],
    \ 'FindReferences': 'gr',
    \ 'NextReference': '<C-n>',
    \ 'PreviousReference': '<C-p>',
    \ 'FindImplementations': 'gI',
    \ 'FindCodeActions': 'ga',
    \ 'Rename': 'gR',
    \ 'ShowHover': v:true,
    \ 'DocumentSymbol': 'go',
    \ 'WorkspaceSymbol': 'gS',
    \ 'SignatureHelp': 'gm',
    \ 'Completion': 'completefunc',
    \}

During the initialization call LSP supports a trace argument which configures logging on the server. Set this with g:lsc_trace_level. Valid values are 'off', 'messages', or 'verbose'. Defaults to 'off'.

Features

The protocol does not require that every language server supports every feature so support may vary.

All communication with the server is asynchronous and will not block the editor. For requests that trigger an action the response might be silently ignored if it can no longer be used - you can abort most operations that are too slow by moving the cursor.

The client can be temporarily disabled for a session with LSClientDisable and re-enabled with LSClientEnable. At any time the server can be exited and restarted with LSClientRestartServer - this sends a request for the server to exit rather than kill it's process so a completely unresponsive server should be killed manually instead.

Diagnostics

Errors, warnings, and hints reported by the server are highlighted in the buffer. When the cursor is on a line with a diagnostic the message will be displayed. If there are multiple diagnostics on a line the one closest to the cursor will be displayed.

Diagnostics are also reported in the location list for each window which has the buffer open.

Run :LSClientAllDiagnostics to populate, and maintain, a list of all diagnostics across the project in the quickfix list.

Autocomplete

When more than 3 word characters or a trigger character are typed a request for autocomplete suggestions is sent to the server. If the server responds before the cursor moves again the options will be provided using vim's built in completion.

Note: By default completeopt includes preview and completion items include documentation in the preview window. Close the window after completion with <c-w><c-z> or disable with set completeopt-=preview. To automatically close the documentation window use the following:

autocmd CompleteDone * silent! pclose

Disable autocomplete with let g:lsc_enable_autocomplete = v:false. A completion function is available at lsc#complete#complete (set to completefunc if applying the default keymap). This is synchronous and has a cap of 5 seconds to wait for the server to respond. It can be used whether autocomplete is enabled or not.

Reference Highlights

If the server supports the textDocument/documentHighlight call references to the element under the cursor throughout the document will be highlighted. Disable with let g:lsc_reference_highlights = v:false or customize the highlighting with the group lscReference. Use <c-n> (:LSClientNextReference) or <c-p> (:LSClientPReviousReference) to jump to other reference to the currently highlighted element.

Jump to definition

While the cursor is on any identifier call LSClientGoToDefinition (<C-]> if using the default mappings) to jump to the location of the definition. If the cursor moves before the server responds the response will be ignored.

Find references

While the cursor is on any identifier call LSClientFindReferences (gr if using the default mappings) to populate the quickfix list with usage locations.

Find implementations

While the cursor is on any identifier call LSClientFindImplementations (gI if using the default mappings) to populate the quickfix list with implementation locations.

Document Symbols

Call LSClientDocumentSymbol (go if using the default mappings) to populate the quickfix list with the locations of all symbols in that document.

Workspace Symbol Search

Call LSClientWorkspaceSymbol with a no arguments, or with a single String argument. (gS if using the default mappings) to query the server for symbols matching a search string. Results will populate the quickfix list.

Hover

While the cursor is on any identifier call LSClientShowHover (K if using the default mappings, bound through keywordprg) to request hover text and show it in a popup or preview window. Override the direction of the split by setting g:lsc_preview_split_direction to either 'below' or 'above'. Quickly close the preview without switching buffers with <c-w><c-z>. See :help preview-window.

Code Actions

Call LSClientFindCodeActions (ga if using the default mappings) to look for code actions available at the cursor location and run one by entering the number of the chosen action.

Signature help

Call LSClientSignatureHelp (gm if using the default mappings) to get help while writing a function call. The currently active parameter is highlighted with the group lscCurrentParameter.

Integrations with other plugins

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].