mirror of
https://github.com/gryf/snipmate.vim.git
synced 2026-01-07 14:44:12 +01:00
significantly refactored code, and added support for file-based snippets and delimeters before snippet triggers.
This commit is contained in:
@@ -5,9 +5,19 @@ if exists('s:did_snips_mappings') || &cp || version < 700
|
||||
en
|
||||
let s:did_snips_mappings = 1
|
||||
|
||||
ino <tab> <c-r>=ExpandSnippet()<cr>
|
||||
snor <tab> <esc>i<right><c-r>=ExpandSnippet()<cr>
|
||||
ino <tab> <c-r>=TriggerSnippet()<cr>
|
||||
snor <tab> <esc>i<right><c-r>=TriggerSnippet()<cr>
|
||||
snor <bs> b<bs>
|
||||
snor ' b<bs>'
|
||||
snor <right> <esc>a
|
||||
snor <left> <esc>bi
|
||||
|
||||
" By default load snippets in ~/.vim/snippets/<filetype>
|
||||
if isdirectory($HOME.'/.vim/snippets')
|
||||
if isdirectory($HOME.'/.vim/snippets/_')
|
||||
cal ExtractSnips($HOME.'/.vim/snippets/_', '_')
|
||||
en
|
||||
au FileType * if !exists('s:did_'.&ft) &&
|
||||
\ isdirectory($HOME.'/.vim/snippets/'.&ft)
|
||||
\| cal ExtractSnips($HOME.'/.vim/snippets/'.&ft, &ft) | en
|
||||
en
|
||||
|
||||
Reference in New Issue
Block a user