Skip to content

Commit

Permalink
Extend the doc with more examples
Browse files Browse the repository at this point in the history
  • Loading branch information
leiserfg committed Feb 13, 2022
1 parent 65c5479 commit cc8cd2f
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions DOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -746,11 +746,24 @@ more than once). You can escape $ by repeating it.

In order to use add something like this to your config:
```vim
vnoremap <leader>e "pd:lua require('luasnip.extras.otf').on_the_fly()<cr>
nnoremap <leader>e "p:lua require('luasnip.extras.otf').on_the_fly()<cr>
vnoremap <c-f> "ed:lua require('luasnip.extras.otf').on_the_fly()<cr>
inoremap <c-f> <C-\><C-O>"e:lua require('luasnip.extras.otf').on_the_fly()<cr>
```
Notice that you can use your own mapping instead of <leader>e and you can pick another register
instead of `"p`

Notice that you can use your own mapping instead of <c-f> and you can pick another register
instead of `"p`. You can even use it several times, as if it where a macro if you add several
mapppings like:
```vim
; For register a
vnoremap <c-f>a "ad:lua require('luasnip.extras.otf').on_the_fly()<cr>
inoremap <c-f>a <C-\><C-O>"a:lua require('luasnip.extras.otf').on_the_fly()<cr>
; For register b
vnoremap <c-f>b "bd:lua require('luasnip.extras.otf').on_the_fly()<cr>
inoremap <c-f>b <C-\><C-O>"b:lua require('luasnip.extras.otf').on_the_fly()<cr>
```

# LSP-SNIPPETS

Luasnip is capable of parsing lsp-style snippets using
Expand Down

0 comments on commit cc8cd2f

Please sign in to comment.