snipMate.vim 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. " This is put here in the 'after' directory in order for snipMate to override
  8. " other plugin mappings (e.g., supertab).
  9. "
  10. " You can safely adjust these mappings to your preferences (as explained in
  11. " :help snipMate-remap).
  12. ino <silent> <tab> <c-r>=TriggerSnippet()<cr>
  13. snor <silent> <tab> <esc>i<right><c-r>=TriggerSnippet()<cr>
  14. ino <silent> <s-tab> <c-r>=BackwardsSnippet()<cr>
  15. snor <silent> <s-tab> <esc>i<right><c-r>=BackwardsSnippet()<cr>
  16. ino <silent> <c-r><tab> <c-r>=ShowAvailableSnips()<cr>
  17. " The default mappings for these are annoying & sometimes break snipMate.
  18. " You can change them back if you want, I've put them here for convenience.
  19. snor <bs> b<bs>
  20. snor <right> <esc>a
  21. snor <left> <esc>bi
  22. snor ' b<bs>'
  23. snor ` b<bs>`
  24. snor % b<bs>%
  25. snor U b<bs>U
  26. snor ^ b<bs>^
  27. snor \ b<bs>\
  28. snor <c-x> b<bs><c-x>
  29. " By default load snippets in snippets_dir
  30. if empty(snippets_dir)
  31. finish
  32. endif
  33. call GetSnippets(snippets_dir, '_') " Get global snippets
  34. au FileType * if &ft != 'help' | call GetSnippets(snippets_dir, &ft) | endif
  35. " vim:noet:sw=4:ts=4:ft=vim