diff --git a/after/plugin/snipMate.vim b/after/plugin/snipMate.vim index 98cf0e60..be4bd244 100644 --- a/after/plugin/snipMate.vim +++ b/after/plugin/snipMate.vim @@ -8,16 +8,23 @@ let s:did_snips_mappings = 1 " This is put here in the 'after' directory in order for snipMate to override " other plugin mappings (e.g., supertab). " -" You can safely adjust these mappings to your preferences (as explained in -" :help snipMate-remap). -ino u=TriggerSnippet() -snor i=TriggerSnippet() -ino =BackwardsSnippet() -snor i=BackwardsSnippet() -ino =ShowAvailableSnips() +" To adjust the tirgger key see (:h snipMate-trigger) +" +if !exists('g:snips_trigger_key') + let g:snips_trigger_key = '' +endif + +" Need the key without <>: +let s:snips_trigger_key_normalized = substitute(g:snips_trigger_key, '[<>]', '', 'g') + +exec 'ino ' . g:snips_trigger_key . ' u=TriggerSnippet()' +exec 'snor ' . g:snips_trigger_key . ' i=TriggerSnippet()' +exec 'ino =BackwardsSnippet()' +exec 'snor i=BackwardsSnippet()' +exec 'ino ' . g:snips_trigger_key. ' =ShowAvailableSnips()' " maybe there is a better way without polluting registers ? -vnoremap s:letg:snipmate_content_visual=getreg('1') +exec 'vnoremap ' . g:snips_trigger_key. ' s:letg:snipmate_content_visual=getreg('1')' " 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 0597d7d6..819d8399 100644 --- a/doc/snipMate.txt +++ b/doc/snipMate.txt @@ -242,18 +242,13 @@ If you would like your snippets to be expanded using spaces instead of tabs, 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: > - - ino =TriggerSnippet() - snor i=TriggerSnippet() - -to this: > - ino =TriggerSnippet() - snor i=TriggerSnippet() + *snipMate-trigger* +snipMate comes with a setting to configure the key that is used to trigger +snipMate. To configure the key set g:snips_trigger_key to something other than +,e.g. use: + + let g:snips_trigger_key='' + ============================================================================== FEATURES *snipMate-features*