Improve snipMate compatibility

This commit is contained in:
Shougo Matsushita 2014-01-11 05:53:23 +09:00
parent 76278170ac
commit dcf2d8518c
2 changed files with 11 additions and 11 deletions

View File

@ -1,7 +1,7 @@
"============================================================================= "=============================================================================
" FILE: init.vim " FILE: init.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com> " AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" Last Modified: 28 Dec 2013. " Last Modified: 11 Jan 2014.
" License: MIT license {{{ " License: MIT license {{{
" Permission is hereby granted, free of charge, to any person obtaining " Permission is hereby granted, free of charge, to any person obtaining
" a copy of this software and associated documentation files (the " a copy of this software and associated documentation files (the
@ -49,10 +49,10 @@ function! s:initialize_script_variables() "{{{
" Load snipMate snippet directories. " Load snipMate snippet directories.
let runtime_dir += split(globpath(&runtimepath, let runtime_dir += split(globpath(&runtimepath,
\ 'snippets'), '\n') \ 'snippets'), '\n')
if exists('g:snippets_dir')
let runtime_dir += neosnippet#util#option2list(g:snippets_dir)
endif
endif endif
let runtime_dir += (exists('g:snippets_dir') ?
\ split(g:snippets_dir, '\s*,\s*')
\ : split(globpath(&runtimepath, 'snippets'), '\n'))
call map(runtime_dir, 'substitute(v:val, "[\\\\/]$", "", "")') call map(runtime_dir, 'substitute(v:val, "[\\\\/]$", "", "")')
" Set snippets_dir. " Set snippets_dir.

View File

@ -164,12 +164,11 @@ g:neosnippet#disable_select_mode_mappings
g:neosnippet#disable_runtime_snippets g:neosnippet#disable_runtime_snippets
This is a dictionary variable which uses file types as key. This is a dictionary variable which uses file types as key.
If you set the value of a file type entry to 1, this prevents If you set the value of a file type entry to 1, this prevents
loading all the file type specific built-in snippets. This is loading "neosnippets" directories from 'runtimepath'. This is
very useful to prevent snippet conflicts between self very useful to prevent snippet conflicts between self defined
defined snippet files and the built-in snippet files of snippet files and the built-in snippet files of neosnippet. If
neosnippet. If you use a "_" as key for an entry this will you use a "_" as key for an entry this will treat the value of
treat the value of the entry as default value for all file the entry as default value for all file types.
types.
Note: This dictionary must be set in your .vimrc. Note: This dictionary must be set in your .vimrc.
@ -190,7 +189,8 @@ g:neosnippet#disable_runtime_snippets
g:neosnippet#enable_snipmate_compatibility g:neosnippet#enable_snipmate_compatibility
If this variable is not 0, neosnippet will enable the snipMate If this variable is not 0, neosnippet will enable the snipMate
compatibility feature (For example: Filename() function) and compatibility feature (For example: Filename() function) and
load snipMate snippets automatically from 'runtimepath'. load |g:snippets_dir| and snipMate snippets automatically from
'runtimepath'.
The default value is 0. The default value is 0.