diff --git a/after/plugin/snipMate.vim b/after/plugin/snipMate.vim index bdbe1993..142ea9ac 100644 --- a/after/plugin/snipMate.vim +++ b/after/plugin/snipMate.vim @@ -10,11 +10,24 @@ let s:did_snips_mappings = 1 " " You can safely adjust these mappings to your preferences (as explained in " :help snipMate-remap). -ino =TriggerSnippet() -snor i=TriggerSnippet() -ino =BackwardsSnippet() -snor i=BackwardsSnippet() -ino =ShowAvailableSnips() +if !exists("g:snipMateTriggerSnippetKey") + let g:snipMateTriggerSnippetKey = "" +endif + +if !exists("g:snipMateBackwardSnippetKey") + let g:snipMateBackwardSnippetKey = "" +endif + +if !exists("g:snipMateShowAvailableSnipsKey") + let g:snipMateShowAvailableSnipsKey = "" +endif + + +exe "ino ".g:snipMateTriggerSnippetKey." =TriggerSnippet()" +exe "snor ".g:snipMateTriggerSnippetKey." i=TriggerSnippet()" +exe "ino ".g:snipMateBackwardSnippetKey." =BackwardsSnippet()" +exe "snor ".g:snipMateBackwardSnippetKey." i=BackwardsSnippet()" +exe "ino ".g:snipMateShowAvailableSnipsKey." =ShowAvailableSnips()" " 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. diff --git a/doc/snipMate.txt b/doc/snipMate.txt index 521235d9..55a1859f 100644 --- a/doc/snipMate.txt +++ b/doc/snipMate.txt @@ -234,17 +234,18 @@ just enable 'expandtab' and set 'softtabstop' to your preferred amount of spaces. If 'softtabstop' is not set, 'shiftwidth' is used instead. *snipMate-remap* -snipMate does not come with a setting to customize the trigger key, but you -can remap it easily in the two lines it's defined in the 'after' directory -under 'plugin/snipMate.vim'. For instance, to change the trigger key -to CTRL-J, just change this: > +snipMate comes with a setting to customize the trigger key. You +can remap it easily in your config by setting a corresponding variable. For +instance, to have CTRL-J to trigger snippets add the following line to your +config: - ino =TriggerSnippet() - snor i=TriggerSnippet() + let g:snipMateTriggerSnippetKey = "" -to this: > - ino =TriggerSnippet() - snor i=TriggerSnippet() +Default mappings are: + + g:snipMateTriggerSnippetKey = "" + g:snipMateBackwardSnippetKey = "" + g:snipMateShowAvailableSnipsKey = "" ============================================================================== FEATURES *snipMate-features*