From 95f323522716f6b72133fefb615f4ede906dc0f2 Mon Sep 17 00:00:00 2001 From: Oxbian Date: Sat, 1 Jul 2023 10:03:16 +0200 Subject: Adding LSP keybinds & doc --- readme.md | 69 +++++++++++++++++++++++++++++++++++++++------------------------ 1 file changed, 43 insertions(+), 26 deletions(-) (limited to 'readme.md') diff --git a/readme.md b/readme.md index 62667a0..b4a0bae 100644 --- a/readme.md +++ b/readme.md @@ -25,9 +25,10 @@ This config has just the necessary plugins installed: - [Vim devicons](https://github.com/ryanoasis/vim-devicons) language icons for vim. - [Vim nerdtree syntax highlighting](https://github.com/tiagofumo/vim-nerdtree-syntax-highlight) nerdtree syntax highlighting - [Vim gitgutter](https://github.com/airblade/vim-gitgutter) to see diff between files with git. -- [ALE](https://github.com/dense-analysis/ale) vim linter, autocompleter, a Swiss knife for all the LSP things. +- [Vim-lsp](https://github.com/prabirshrestha/vim-lsp) linter & formatter for language. +- [Vim-lsp settings](https://github.com/mattn/vim-lsp-settings) easily setup lsp servers for languages. - [Asyncomplete](https://github.com/prabirshrestha/asyncomplete.vim) async autocompletion -- [Asyncomplete ALE](https://github.com/andreypopp/asyncomplete-ale.vim) LSP server for asyncomplete & ALE +- [Asyncomplete & lsp-vim](https://github.com/prabirshrestha/asyncomplete-lsp.vim) use vim-lsp as source for autocompletion lsp server. ## Command & keybinds @@ -37,35 +38,35 @@ This config has just the necessary plugins installed: #### Window -- `Ctrl+h` move to the left window -- `Ctrl+j` move to the bottom window -- `Ctrl+k` move to the upper window -- `Ctrl+l` move to the right window +- `Ctrl+h` move to the left window, +- `Ctrl+j` move to the bottom window, +- `Ctrl+k` move to the upper window, +- `Ctrl+l` move to the right window, #### Buffer -- `bd` close the current buffer -- `ba` close all the buffers -- `l` go to the next buffer -- `h` go to the precedent buffer +- `bd` close the current buffer, +- `ba` close all the buffers, +- `]b` go to the next buffer, +- `[b` go to the precedent buffer, #### Tabs -- `tn` open a new tab -- `to` close all other tabs -- `tc` close current tab page -- `tm` move the tab after another -- `t` go to the next tab -- `tl` toggle between this tab and the last accessed tab -- `te` open a new tab with the current buffer +- `tn` open a new tab, +- `to` close all other tabs, +- `tc` close current tab page, +- `tm` move the tab after another, +- `t` go to the next tab, +- `tl` toggle between this tab and the last accessed tab, +- `te` open a new tab with the current buffer, #### Spell check -- `ss` toggle / untoggle spellchecking -- `sn` go to the next word to spellcheck -- `sp` go to the previous word to spellcheck -- `sa` add a word into the dictionary -- `s?` show the list of alternatives for the word +- `ss` toggle / untoggle spellchecking, +- `sn` go to the next word to spellcheck, +- `sp` go to the previous word to spellcheck, +- `sa` add a word into the dictionary, +- `s?` show the list of alternatives for the word, More help at `:help spell` @@ -77,16 +78,32 @@ Keybinds: ### Vim Gutter -For help, use `:help gitgutter`. +For help, use `:help gitgutter`. Keybinds: -- `[c` & `]c` to jump between hunks, +- `[h` go to the previous hunk, +- `]h` go to the next hunk, - `hp` to preview hunk, - `hs` to stage hunk, - `hu` to undo hunk, -- `d` to toggle GitGutter. +- `ht` to toggle GitGutter. Hunks are the difference between your file and the git file. +### LSP + +For help, use `:help vim-lsp`. +Keybinds: +- `ld` go to the definition, +- `lnd` go to the next diagnostic, +- `lpd` go to the previous diagnostic, +- `lf` go to the reference, +- `lr` rename element, +- `ls` stop lsp server, +- `lp` peek a view to the definition, +- `la` code action, +- `lh` lsp hover, +- `ldf` format document. + ## Linters & fixers ### Python @@ -96,5 +113,5 @@ For using python linters & fixers, you will need to setup a virtual env & instal ```bash python -m venv .venv source .venv/bin/activate -pip install flake8 pylint pydocstyle bandit mypy black isort +pip install python-lsp-server[all] ``` -- cgit v1.2.3