snipMate.vim 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. " These are the mappings for snipMate.vim. Putting it here ensures that it
  2. " will be mapped after other plugins such as supertab.vim.
  3. if !exists('loaded_snips') || exists('s:did_snips_mappings')
  4. finish
  5. endif
  6. let s:did_snips_mappings = 1
  7. ino <silent> <tab> <c-r>=TriggerSnippet()<cr>
  8. snor <silent> <tab> <esc>i<right><c-r>=TriggerSnippet()<cr>
  9. ino <silent> <s-tab> <c-r>=BackwardsSnippet()<cr>
  10. snor <silent> <s-tab> <esc>i<right><c-r>=BackwardsSnippet()<cr>
  11. ino <silent> <c-r><tab> <c-r>=ShowAvailableSnips()<cr>
  12. " The default mappings for these are annoying & sometimes break snipMate.
  13. " You can change them back if you want, I've put them here for convenience.
  14. snor <bs> b<bs>
  15. snor <right> <esc>a
  16. snor <left> <esc>bi
  17. snor ' b<bs>'
  18. snor ` b<bs>`
  19. snor % b<bs>%
  20. snor U b<bs>U
  21. snor ^ b<bs>^
  22. snor \ b<bs>\
  23. snor <c-x> b<bs><c-x>
  24. " By default load snippets in snippets_dir
  25. if empty(snippets_dir)
  26. finish
  27. endif
  28. call GetSnippets(snippets_dir, '_') " Get global snippets
  29. au FileType * if &ft != 'help' | call GetSnippets(snippets_dir, &ft) | endif
  30. " vim:noet:sw=4:ts=4:ft=vim