aboutsummaryrefslogtreecommitdiff
path: root/modules/vim/vim.dot.link/after/plugin/snipMate.vim
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-02-01 01:25:10 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-02-01 01:25:10 -0200
commit6b9187673ee62d11042832f938913f15131592a7 (patch)
tree9e70016667efe273a72ab351aafaddbdb099e123 /modules/vim/vim.dot.link/after/plugin/snipMate.vim
parent25235935e6c90557a4d6791c8d8f3a5cdf89681a (diff)
downloaddotfiles-6b9187673ee62d11042832f938913f15131592a7.tar.gz
dotfiles-6b9187673ee62d11042832f938913f15131592a7.tar.bz2
Adding metadot script
Diffstat (limited to 'modules/vim/vim.dot.link/after/plugin/snipMate.vim')
-rw-r--r--modules/vim/vim.dot.link/after/plugin/snipMate.vim35
1 files changed, 35 insertions, 0 deletions
diff --git a/modules/vim/vim.dot.link/after/plugin/snipMate.vim b/modules/vim/vim.dot.link/after/plugin/snipMate.vim
new file mode 100644
index 0000000..03e79ae
--- /dev/null
+++ b/modules/vim/vim.dot.link/after/plugin/snipMate.vim
@@ -0,0 +1,35 @@
+" These are the mappings for snipMate.vim. Putting it here ensures that it
+" will be mapped after other plugins such as supertab.vim.
+if !exists('loaded_snips') || exists('s:did_snips_mappings')
+ finish
+endif
+let s:did_snips_mappings = 1
+
+ino <silent> <tab> <c-r>=TriggerSnippet()<cr>
+snor <silent> <tab> <esc>i<right><c-r>=TriggerSnippet()<cr>
+ino <silent> <s-tab> <c-r>=BackwardsSnippet()<cr>
+snor <silent> <s-tab> <esc>i<right><c-r>=BackwardsSnippet()<cr>
+ino <silent> <c-r><tab> <c-r>=ShowAvailableSnips()<cr>
+
+" The default mappings for these are annoying & sometimes break snipMate.
+" You can change them back if you want, I've put them here for convenience.
+snor <bs> b<bs>
+snor <right> <esc>a
+snor <left> <esc>bi
+snor ' b<bs>'
+snor ` b<bs>`
+snor % b<bs>%
+snor U b<bs>U
+snor ^ b<bs>^
+snor \ b<bs>\
+snor <c-x> b<bs><c-x>
+
+" By default load snippets in snippets_dir
+if empty(snippets_dir)
+ finish
+endif
+
+call GetSnippets(snippets_dir, '_') " Get global snippets
+
+au FileType * if &ft != 'help' | call GetSnippets(snippets_dir, &ft) | endif
+" vim:noet:sw=4:ts=4:ft=vim