diff --git a/autoload/neosnippet.vim b/autoload/neosnippet.vim index ba69119..6f5f029 100644 --- a/autoload/neosnippet.vim +++ b/autoload/neosnippet.vim @@ -1,7 +1,7 @@ "============================================================================= " FILE: neosnippet.vim " AUTHOR: Shougo Matsushita -" Last Modified: 28 Sep 2012. +" Last Modified: 30 Sep 2012. " License: MIT license {{{ " Permission is hereby granted, free of charge, to any person obtaining " a copy of this software and associated documentation files (the @@ -33,7 +33,7 @@ function! s:initialize()"{{{ let s:snippets_dir = [] let s:runtime_dir = split(globpath(&runtimepath, - \ 'autoload/neosnippet'), '\n') + \ 'autoload/neosnippet/snippets'), '\n') if !g:neocomplcache_snippets_disable_runtime_snippets " Set snippets dir. diff --git a/autoload/neosnippet/_.snip b/autoload/neosnippet/snippets/_.snip similarity index 100% rename from autoload/neosnippet/_.snip rename to autoload/neosnippet/snippets/_.snip diff --git a/autoload/neosnippet/actionscript.snip b/autoload/neosnippet/snippets/actionscript.snip similarity index 100% rename from autoload/neosnippet/actionscript.snip rename to autoload/neosnippet/snippets/actionscript.snip diff --git a/autoload/neosnippet/apache.snip b/autoload/neosnippet/snippets/apache.snip similarity index 100% rename from autoload/neosnippet/apache.snip rename to autoload/neosnippet/snippets/apache.snip diff --git a/autoload/neosnippet/applescript.snip b/autoload/neosnippet/snippets/applescript.snip similarity index 100% rename from autoload/neosnippet/applescript.snip rename to autoload/neosnippet/snippets/applescript.snip diff --git a/autoload/neosnippet/c.snip b/autoload/neosnippet/snippets/c.snip similarity index 100% rename from autoload/neosnippet/c.snip rename to autoload/neosnippet/snippets/c.snip diff --git a/autoload/neosnippet/coffee.snip b/autoload/neosnippet/snippets/coffee.snip similarity index 100% rename from autoload/neosnippet/coffee.snip rename to autoload/neosnippet/snippets/coffee.snip diff --git a/autoload/neosnippet/cpp.snip b/autoload/neosnippet/snippets/cpp.snip similarity index 100% rename from autoload/neosnippet/cpp.snip rename to autoload/neosnippet/snippets/cpp.snip diff --git a/autoload/neosnippet/css.snip b/autoload/neosnippet/snippets/css.snip similarity index 100% rename from autoload/neosnippet/css.snip rename to autoload/neosnippet/snippets/css.snip diff --git a/autoload/neosnippet/d.snip b/autoload/neosnippet/snippets/d.snip similarity index 100% rename from autoload/neosnippet/d.snip rename to autoload/neosnippet/snippets/d.snip diff --git a/autoload/neosnippet/eruby.snip b/autoload/neosnippet/snippets/eruby.snip similarity index 100% rename from autoload/neosnippet/eruby.snip rename to autoload/neosnippet/snippets/eruby.snip diff --git a/autoload/neosnippet/java.snip b/autoload/neosnippet/snippets/java.snip similarity index 100% rename from autoload/neosnippet/java.snip rename to autoload/neosnippet/snippets/java.snip diff --git a/autoload/neosnippet/javascript.snip b/autoload/neosnippet/snippets/javascript.snip similarity index 100% rename from autoload/neosnippet/javascript.snip rename to autoload/neosnippet/snippets/javascript.snip diff --git a/autoload/neosnippet/lua.snip b/autoload/neosnippet/snippets/lua.snip similarity index 100% rename from autoload/neosnippet/lua.snip rename to autoload/neosnippet/snippets/lua.snip diff --git a/autoload/neosnippet/markdown.snip b/autoload/neosnippet/snippets/markdown.snip similarity index 100% rename from autoload/neosnippet/markdown.snip rename to autoload/neosnippet/snippets/markdown.snip diff --git a/autoload/neosnippet/objc.snip b/autoload/neosnippet/snippets/objc.snip similarity index 100% rename from autoload/neosnippet/objc.snip rename to autoload/neosnippet/snippets/objc.snip diff --git a/autoload/neosnippet/perl.snip b/autoload/neosnippet/snippets/perl.snip similarity index 100% rename from autoload/neosnippet/perl.snip rename to autoload/neosnippet/snippets/perl.snip diff --git a/autoload/neosnippet/php.snip b/autoload/neosnippet/snippets/php.snip similarity index 100% rename from autoload/neosnippet/php.snip rename to autoload/neosnippet/snippets/php.snip diff --git a/autoload/neosnippet/python.snip b/autoload/neosnippet/snippets/python.snip similarity index 100% rename from autoload/neosnippet/python.snip rename to autoload/neosnippet/snippets/python.snip diff --git a/autoload/neosnippet/rails.snip b/autoload/neosnippet/snippets/rails.snip similarity index 100% rename from autoload/neosnippet/rails.snip rename to autoload/neosnippet/snippets/rails.snip diff --git a/autoload/neosnippet/ruby.snip b/autoload/neosnippet/snippets/ruby.snip similarity index 100% rename from autoload/neosnippet/ruby.snip rename to autoload/neosnippet/snippets/ruby.snip diff --git a/autoload/neosnippet/sh.snip b/autoload/neosnippet/snippets/sh.snip similarity index 100% rename from autoload/neosnippet/sh.snip rename to autoload/neosnippet/snippets/sh.snip diff --git a/autoload/neosnippet/snippet.snip b/autoload/neosnippet/snippets/snippet.snip similarity index 100% rename from autoload/neosnippet/snippet.snip rename to autoload/neosnippet/snippets/snippet.snip diff --git a/autoload/neosnippet/tex.snip b/autoload/neosnippet/snippets/tex.snip similarity index 100% rename from autoload/neosnippet/tex.snip rename to autoload/neosnippet/snippets/tex.snip diff --git a/autoload/neosnippet/vim.snip b/autoload/neosnippet/snippets/vim.snip similarity index 100% rename from autoload/neosnippet/vim.snip rename to autoload/neosnippet/snippets/vim.snip diff --git a/autoload/neosnippet/vimshell.snip b/autoload/neosnippet/snippets/vimshell.snip similarity index 100% rename from autoload/neosnippet/vimshell.snip rename to autoload/neosnippet/snippets/vimshell.snip diff --git a/autoload/neosnippet/xhtml.snip b/autoload/neosnippet/snippets/xhtml.snip similarity index 100% rename from autoload/neosnippet/xhtml.snip rename to autoload/neosnippet/snippets/xhtml.snip diff --git a/autoload/neosnippet/util.vim b/autoload/neosnippet/util.vim new file mode 100644 index 0000000..afc7b7e --- /dev/null +++ b/autoload/neosnippet/util.vim @@ -0,0 +1,138 @@ +"============================================================================= +" FILE: util.vim +" AUTHOR: Shougo Matsushita +" Last Modified: 28 Sep 2012. +" License: MIT license {{{ +" Permission is hereby granted, free of charge, to any person obtaining +" a copy of this software and associated documentation files (the +" "Software"), to deal in the Software without restriction, including +" without limitation the rights to use, copy, modify, merge, publish, +" distribute, sublicense, and/or sell copies of the Software, and to +" permit persons to whom the Software is furnished to do so, subject to +" the following conditions: +" +" The above copyright notice and this permission notice shall be included +" in all copies or substantial portions of the Software. +" +" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +" IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +" }}} +"============================================================================= + +let s:save_cpo = &cpo +set cpo&vim + +let s:V = vital#of('neocomplcache') +let s:List = vital#of('neocomplcache').import('Data.List') + +function! neocomplcache#util#truncate_smart(...)"{{{ + return call(s:V.truncate_smart, a:000) +endfunction"}}} + +function! neocomplcache#util#truncate(...)"{{{ + return call(s:V.truncate, a:000) +endfunction"}}} + +function! neocomplcache#util#strchars(...)"{{{ + return call(s:V.strchars, a:000) +endfunction"}}} +function! neocomplcache#util#wcswidth(...)"{{{ + return call(s:V.wcswidth, a:000) +endfunction"}}} +function! neocomplcache#util#strwidthpart(...)"{{{ + return call(s:V.strwidthpart, a:000) +endfunction"}}} +function! neocomplcache#util#strwidthpart_reverse(...)"{{{ + return call(s:V.strwidthpart_reverse, a:000) +endfunction"}}} + +function! neocomplcache#util#substitute_path_separator(...)"{{{ + return call(s:V.substitute_path_separator, a:000) +endfunction"}}} +function! neocomplcache#util#mb_strlen(...)"{{{ + return call(s:V.strchars, a:000) +endfunction"}}} +function! neocomplcache#util#uniq(list)"{{{ + let dict = {} + for item in a:list + if !has_key(dict, item) + let dict[item] = item + endif + endfor + + return values(dict) +endfunction"}}} +function! neocomplcache#util#system(...)"{{{ + return call(s:V.system, a:000) +endfunction"}}} +function! neocomplcache#util#has_vimproc(...)"{{{ + return call(s:V.has_vimproc, a:000) +endfunction"}}} +function! neocomplcache#util#is_windows(...)"{{{ + return call(s:V.is_windows, a:000) +endfunction"}}} +function! neocomplcache#util#is_mac(...)"{{{ + return call(s:V.is_mac, a:000) +endfunction"}}} +function! neocomplcache#util#get_last_status(...)"{{{ + return call(s:V.get_last_status, a:000) +endfunction"}}} +function! neocomplcache#util#escape_pattern(...)"{{{ + return call(s:V.escape_pattern, a:000) +endfunction"}}} +function! neocomplcache#util#iconv(...)"{{{ + return call(s:V.iconv, a:000) +endfunction"}}} +function! neocomplcache#util#uniq(...)"{{{ + return call(s:List.uniq, a:000) +endfunction"}}} + +function! neocomplcache#util#glob(pattern, ...)"{{{ + if a:pattern =~ "'" + " Use glob('*'). + let cwd = getcwd() + let base = neocomplcache#util#substitute_path_separator( + \ fnamemodify(a:pattern, ':h')) + lcd `=base` + + let files = map(split(neocomplcache#util#substitute_path_separator( + \ glob('*')), '\n'), "base . '/' . v:val") + + lcd `=cwd` + + return files + endif + + " let is_force_glob = get(a:000, 0, 0) + let is_force_glob = get(a:000, 0, 1) + + if !is_force_glob && a:pattern =~ '^[^\\*]\+/\*' + \ && neocomplcache#util#has_vimproc() && exists('*vimproc#readdir') + return filter(vimproc#readdir(a:pattern[: -2]), 'v:val !~ "/\\.\\.\\?$"') + else + " Escape [. + if neocomplcache#util#is_windows() + let glob = substitute(a:pattern, '\[', '\\[[]', 'g') + else + let glob = escape(a:pattern, '[') + endif + + return split(neocomplcache#util#substitute_path_separator(glob(glob)), '\n') + endif +endfunction"}}} +function! neocomplcache#util#expand(path)"{{{ + return expand(escape(a:path, '*?[]"={}'), 1) +endfunction"}}} +function! neocomplcache#util#set_dictionary_helper(...)"{{{ + return call(s:V.set_dictionary_helper, a:000) +endfunction"}}} + +let &cpo = s:save_cpo +unlet s:save_cpo + +" vim: foldmethod=marker diff --git a/doc/neosnippet.txt b/doc/neosnippet.txt index 780993c..a0823fc 100644 --- a/doc/neosnippet.txt +++ b/doc/neosnippet.txt @@ -317,6 +317,9 @@ snippet *neosnippet-unite-action-snippet* ============================================================================== CHANGELOG *neosnippet-changelog* +2012-09-30 +- Changed runtime directory. + 2012-09-27 - Ver.3 development is started. - Renamed documentation.