diff options
Diffstat (limited to 'docs/user')
-rw-r--r-- | docs/user/README.md | 5 | ||||
-rw-r--r-- | docs/user/assists.md | 19 |
2 files changed, 24 insertions, 0 deletions
diff --git a/docs/user/README.md b/docs/user/README.md index bfb190449..913ecea18 100644 --- a/docs/user/README.md +++ b/docs/user/README.md | |||
@@ -132,6 +132,11 @@ to load path and require it in `init.el` | |||
132 | 132 | ||
133 | ## Vim and NeoVim | 133 | ## Vim and NeoVim |
134 | 134 | ||
135 | Neovim 0.5 has a built in language server. For a quick start configuration of | ||
136 | rust-analyzer, use [neovim/nvim-lsp](https://github.com/neovim/nvim-lsp#rust_analyzer). | ||
137 | Once `neovim/nvim-lsp` is installed, you can use `call nvim_lsp#setup("rust_analyzer", {})` | ||
138 | or `lua require'nvim_lsp'.rust_analyzer.setup({})` to quickly get set up. | ||
139 | |||
135 | * Install coc.nvim by following the instructions at [coc.nvim] | 140 | * Install coc.nvim by following the instructions at [coc.nvim] |
136 | - You will need nodejs installed. | 141 | - You will need nodejs installed. |
137 | - You may want to include some of the sample vim configurations [from here][coc-vim-conf] | 142 | - You may want to include some of the sample vim configurations [from here][coc-vim-conf] |
diff --git a/docs/user/assists.md b/docs/user/assists.md index 8da7578e2..6f4c30bee 100644 --- a/docs/user/assists.md +++ b/docs/user/assists.md | |||
@@ -329,6 +329,25 @@ fn main() { | |||
329 | } | 329 | } |
330 | ``` | 330 | ``` |
331 | 331 | ||
332 | ## `invert_if` | ||
333 | |||
334 | Apply invert_if | ||
335 | This transforms if expressions of the form `if !x {A} else {B}` into `if x {B} else {A}` | ||
336 | This also works with `!=`. This assist can only be applied with the cursor | ||
337 | on `if`. | ||
338 | |||
339 | ```rust | ||
340 | // BEFORE | ||
341 | fn main() { | ||
342 | if┃ !y { A } else { B } | ||
343 | } | ||
344 | |||
345 | // AFTER | ||
346 | fn main() { | ||
347 | if y { B } else { A } | ||
348 | } | ||
349 | ``` | ||
350 | |||
332 | ## `make_raw_string` | 351 | ## `make_raw_string` |
333 | 352 | ||
334 | Adds `r#` to a plain string literal. | 353 | Adds `r#` to a plain string literal. |