Skip to content

Commit cc8cd2f

Browse files
committed
Extend the doc with more examples
1 parent 65c5479 commit cc8cd2f

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

DOC.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -746,11 +746,24 @@ more than once). You can escape $ by repeating it.
746746

747747
In order to use add something like this to your config:
748748
```vim
749-
vnoremap <leader>e "pd:lua require('luasnip.extras.otf').on_the_fly()<cr>
750-
nnoremap <leader>e "p:lua require('luasnip.extras.otf').on_the_fly()<cr>
749+
vnoremap <c-f> "ed:lua require('luasnip.extras.otf').on_the_fly()<cr>
750+
inoremap <c-f> <C-\><C-O>"e:lua require('luasnip.extras.otf').on_the_fly()<cr>
751751
```
752-
Notice that you can use your own mapping instead of <leader>e and you can pick another register
753-
instead of `"p`
752+
753+
Notice that you can use your own mapping instead of <c-f> and you can pick another register
754+
instead of `"p`. You can even use it several times, as if it where a macro if you add several
755+
mapppings like:
756+
```vim
757+
; For register a
758+
vnoremap <c-f>a "ad:lua require('luasnip.extras.otf').on_the_fly()<cr>
759+
inoremap <c-f>a <C-\><C-O>"a:lua require('luasnip.extras.otf').on_the_fly()<cr>
760+
761+
762+
; For register b
763+
vnoremap <c-f>b "bd:lua require('luasnip.extras.otf').on_the_fly()<cr>
764+
inoremap <c-f>b <C-\><C-O>"b:lua require('luasnip.extras.otf').on_the_fly()<cr>
765+
```
766+
754767
# LSP-SNIPPETS
755768

756769
Luasnip is capable of parsing lsp-style snippets using

0 commit comments

Comments
 (0)