Refactored
This commit is contained in:
parent
6dc9701417
commit
382f68dbd0
@ -1,12 +1,9 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: snippets_complete.vim
|
" FILE: snippets_complete.vim
|
||||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
|
||||||
" License: MIT license
|
" License: MIT license
|
||||||
"=============================================================================
|
"=============================================================================
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
let s:source = {
|
let s:source = {
|
||||||
\ 'name' : 'snippets_complete',
|
\ 'name' : 'snippets_complete',
|
||||||
\ 'kind' : 'complfunc',
|
\ 'kind' : 'complfunc',
|
||||||
@ -74,7 +71,4 @@ function! neocomplcache#sources#snippets_complete#define() abort "{{{
|
|||||||
return s:source
|
return s:source
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
||||||
|
|
||||||
" vim: foldmethod=marker
|
" vim: foldmethod=marker
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: neosnippet.vim
|
" FILE: neosnippet.vim
|
||||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
|
||||||
" License: MIT license
|
" License: MIT license
|
||||||
"=============================================================================
|
"=============================================================================
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
let s:source = {
|
let s:source = {
|
||||||
\ 'name' : 'neosnippet',
|
\ 'name' : 'neosnippet',
|
||||||
\ 'kind' : 'keyword',
|
\ 'kind' : 'keyword',
|
||||||
@ -42,7 +39,4 @@ function! neocomplete#sources#neosnippet#define() abort "{{{
|
|||||||
return s:source
|
return s:source
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
||||||
|
|
||||||
" vim: foldmethod=marker
|
" vim: foldmethod=marker
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: neosnippet.vim
|
" FILE: neosnippet.vim
|
||||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
|
||||||
" License: MIT license
|
" License: MIT license
|
||||||
"=============================================================================
|
"=============================================================================
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
" Global options definition. "{{{
|
" Global options definition. "{{{
|
||||||
call neosnippet#util#set_default(
|
call neosnippet#util#set_default(
|
||||||
\ 'g:neosnippet#disable_runtime_snippets', {})
|
\ 'g:neosnippet#disable_runtime_snippets', {})
|
||||||
@ -92,7 +89,4 @@ function! neosnippet#get_mirror_placeholder_marker_substitute_pattern() abort "{
|
|||||||
return '\\\@<!\$\(\d\+\)'
|
return '\\\@<!\$\(\d\+\)'
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
||||||
|
|
||||||
" vim: foldmethod=marker
|
" vim: foldmethod=marker
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: commands.vim
|
" FILE: commands.vim
|
||||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
|
||||||
" License: MIT license
|
" License: MIT license
|
||||||
"=============================================================================
|
"=============================================================================
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
" Variables "{{{
|
" Variables "{{{
|
||||||
let s:edit_options = [
|
let s:edit_options = [
|
||||||
\ '-runtime',
|
\ '-runtime',
|
||||||
@ -205,7 +202,4 @@ function! s:get_snippet_files(path, filetype) abort "{{{
|
|||||||
return reverse(s:get_list().uniq(snippet_files))
|
return reverse(s:get_list().uniq(snippet_files))
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
||||||
|
|
||||||
" vim: foldmethod=marker
|
" vim: foldmethod=marker
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: handlers.vim
|
" FILE: handlers.vim
|
||||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
|
||||||
" License: MIT license
|
" License: MIT license
|
||||||
"=============================================================================
|
"=============================================================================
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
function! neosnippet#handlers#_cursor_moved() abort "{{{
|
function! neosnippet#handlers#_cursor_moved() abort "{{{
|
||||||
let expand_stack = neosnippet#variables#expand_stack()
|
let expand_stack = neosnippet#variables#expand_stack()
|
||||||
|
|
||||||
@ -51,7 +48,4 @@ function! neosnippet#handlers#_restore_unnamed_register() abort "{{{
|
|||||||
endif
|
endif
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
||||||
|
|
||||||
" vim: foldmethod=marker
|
" vim: foldmethod=marker
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: helpers.vim
|
" FILE: helpers.vim
|
||||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
|
||||||
" License: MIT license
|
" License: MIT license
|
||||||
"=============================================================================
|
"=============================================================================
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
function! neosnippet#helpers#get_cursor_snippet(snippets, cur_text) abort "{{{
|
function! neosnippet#helpers#get_cursor_snippet(snippets, cur_text) abort "{{{
|
||||||
let cur_word = matchstr(a:cur_text, '\S\+$')
|
let cur_word = matchstr(a:cur_text, '\S\+$')
|
||||||
if cur_word != '' && has_key(a:snippets, cur_word)
|
if cur_word != '' && has_key(a:snippets, cur_word)
|
||||||
@ -184,7 +181,4 @@ function! s:get_sources_filetypes(filetype) abort "{{{
|
|||||||
return ['_'] + filetypes
|
return ['_'] + filetypes
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
||||||
|
|
||||||
" vim: foldmethod=marker
|
" vim: foldmethod=marker
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: init.vim
|
" FILE: init.vim
|
||||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
|
||||||
" License: MIT license
|
" License: MIT license
|
||||||
"=============================================================================
|
"=============================================================================
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
function! neosnippet#init#_initialize() abort "{{{
|
function! neosnippet#init#_initialize() abort "{{{
|
||||||
let s:is_initialized = 1
|
let s:is_initialized = 1
|
||||||
|
|
||||||
@ -90,7 +87,4 @@ function! s:initialize_others() abort "{{{
|
|||||||
endif"}}}
|
endif"}}}
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
||||||
|
|
||||||
" vim: foldmethod=marker
|
" vim: foldmethod=marker
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: mappings.vim
|
" FILE: mappings.vim
|
||||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
|
||||||
" License: MIT license
|
" License: MIT license
|
||||||
"=============================================================================
|
"=============================================================================
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
function! neosnippet#mappings#expandable_or_jumpable() abort "{{{
|
function! neosnippet#mappings#expandable_or_jumpable() abort "{{{
|
||||||
return neosnippet#mappings#expandable() || neosnippet#mappings#jumpable()
|
return neosnippet#mappings#expandable() || neosnippet#mappings#jumpable()
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
@ -247,7 +244,4 @@ function! neosnippet#mappings#jump_impl() abort
|
|||||||
return neosnippet#mappings#_trigger('neosnippet#view#_jump')
|
return neosnippet#mappings#_trigger('neosnippet#view#_jump')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
||||||
|
|
||||||
" vim: foldmethod=marker
|
" vim: foldmethod=marker
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: parser.vim
|
" FILE: parser.vim
|
||||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
|
||||||
" License: MIT license
|
" License: MIT license
|
||||||
"=============================================================================
|
"=============================================================================
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
let s:Cache = neosnippet#util#get_vital().import('System.Cache.Deprecated')
|
let s:Cache = neosnippet#util#get_vital().import('System.Cache.Deprecated')
|
||||||
|
|
||||||
function! neosnippet#parser#_parse_snippets(filename) abort "{{{
|
function! neosnippet#parser#_parse_snippets(filename) abort "{{{
|
||||||
@ -409,8 +406,4 @@ function! neosnippet#parser#_get_in_paren(key, pair, str) abort "{{{
|
|||||||
return ''
|
return ''
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
||||||
|
|
||||||
" vim: foldmethod=marker
|
" vim: foldmethod=marker
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: util.vim
|
" FILE: util.vim
|
||||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
|
||||||
" License: MIT license
|
" License: MIT license
|
||||||
"=============================================================================
|
"=============================================================================
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
function! neosnippet#util#get_vital() abort "{{{
|
function! neosnippet#util#get_vital() abort "{{{
|
||||||
if !exists('s:V')
|
if !exists('s:V')
|
||||||
let s:V = vital#neosnippet#new()
|
let s:V = vital#neosnippet#new()
|
||||||
@ -147,7 +144,4 @@ function! neosnippet#util#option2list(str) abort "{{{
|
|||||||
return type(a:str) == type('') ? split(a:str, '\s*,\s*') : a:str
|
return type(a:str) == type('') ? split(a:str, '\s*,\s*') : a:str
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
||||||
|
|
||||||
" vim: foldmethod=marker
|
" vim: foldmethod=marker
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: variables.vim
|
" FILE: variables.vim
|
||||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
|
||||||
" License: MIT license
|
" License: MIT license
|
||||||
"=============================================================================
|
"=============================================================================
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
function! neosnippet#variables#current_neosnippet() abort "{{{
|
function! neosnippet#variables#current_neosnippet() abort "{{{
|
||||||
if !exists('b:neosnippet')
|
if !exists('b:neosnippet')
|
||||||
let b:neosnippet = {
|
let b:neosnippet = {
|
||||||
@ -89,7 +86,4 @@ function! neosnippet#variables#data_dir() abort "{{{
|
|||||||
return g:neosnippet#data_directory
|
return g:neosnippet#data_directory
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
||||||
|
|
||||||
" vim: foldmethod=marker
|
" vim: foldmethod=marker
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: view.vim
|
" FILE: view.vim
|
||||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
|
||||||
" License: MIT license
|
" License: MIT license
|
||||||
"=============================================================================
|
"=============================================================================
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
function! neosnippet#view#_expand(cur_text, col, trigger_name) abort "{{{
|
function! neosnippet#view#_expand(cur_text, col, trigger_name) abort "{{{
|
||||||
let snippets = neosnippet#helpers#get_snippets()
|
let snippets = neosnippet#helpers#get_snippets()
|
||||||
|
|
||||||
@ -557,7 +554,4 @@ function! s:skip_next_auto_completion() abort "{{{
|
|||||||
endif
|
endif
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
||||||
|
|
||||||
" vim: foldmethod=marker
|
" vim: foldmethod=marker
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: neosnippet.vim
|
" FILE: neosnippet.vim
|
||||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
|
||||||
" License: MIT license
|
" License: MIT license
|
||||||
"=============================================================================
|
"=============================================================================
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
function! unite#sources#neosnippet#define() abort "{{{
|
function! unite#sources#neosnippet#define() abort "{{{
|
||||||
let kind = {
|
let kind = {
|
||||||
\ 'name' : 'neosnippet',
|
\ 'name' : 'neosnippet',
|
||||||
@ -140,7 +137,4 @@ function! s:get_keyword_pos(cur_text) abort "{{{
|
|||||||
return cur_keyword_pos
|
return cur_keyword_pos
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
||||||
|
|
||||||
" vim: foldmethod=marker
|
" vim: foldmethod=marker
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: neosnippet_file.vim
|
" FILE: neosnippet_file.vim
|
||||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
|
||||||
" License: MIT license
|
" License: MIT license
|
||||||
"=============================================================================
|
"=============================================================================
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
function! unite#sources#neosnippet_file#define() abort "{{{
|
function! unite#sources#neosnippet_file#define() abort "{{{
|
||||||
return [s:source_user, s:source_runtime]
|
return [s:source_user, s:source_runtime]
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
@ -91,7 +88,4 @@ function! s:get_snippet_candidates(dirs) abort "{{{
|
|||||||
return _
|
return _
|
||||||
endfunction "}}}
|
endfunction "}}}
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
||||||
|
|
||||||
" vim: foldmethod=marker
|
" vim: foldmethod=marker
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
The neo-snippet plugin contains snippet source
|
The neo-snippet plugin contains snippet source
|
||||||
|
|
||||||
Version: 5.0
|
Version: 5.0
|
||||||
Author: Shougo <Shougo.Matsu@gmail.com>
|
Author: Shougo <Shougo.Matsu at gmail.com>
|
||||||
License: MIT license
|
License: MIT license
|
||||||
|
|
||||||
CONTENTS *neosnippet-contents*
|
CONTENTS *neosnippet-contents*
|
||||||
|
@ -1,12 +1,9 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: snippets.vim
|
" FILE: snippets.vim
|
||||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
|
||||||
" License: MIT license
|
" License: MIT license
|
||||||
"=============================================================================
|
"=============================================================================
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
if !exists('b:undo_ftplugin')
|
if !exists('b:undo_ftplugin')
|
||||||
let b:undo_ftplugin = ''
|
let b:undo_ftplugin = ''
|
||||||
else
|
else
|
||||||
@ -21,6 +18,3 @@ let &l:commentstring="#%s"
|
|||||||
let b:undo_ftplugin .= '
|
let b:undo_ftplugin .= '
|
||||||
\ setlocal expandtab< shiftwidth< softtabstop< tabstop< commentstring<
|
\ setlocal expandtab< shiftwidth< softtabstop< tabstop< commentstring<
|
||||||
\'
|
\'
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
||||||
|
@ -1,26 +1,7 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: snippets.vim
|
" FILE: snippets.vim
|
||||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
|
||||||
" License: MIT license {{{
|
" 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.
|
|
||||||
" }}}
|
|
||||||
"=============================================================================
|
"=============================================================================
|
||||||
|
|
||||||
" Only load this indent file when no other was loaded.
|
" Only load this indent file when no other was loaded.
|
||||||
@ -29,13 +10,10 @@ if exists('b:did_indent')
|
|||||||
endif
|
endif
|
||||||
let b:did_indent = 1
|
let b:did_indent = 1
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
if !exists('b:undo_indent')
|
if !exists('b:undo_indent')
|
||||||
let b:undo_indent = ''
|
let b:undo_indent = ''
|
||||||
else
|
else
|
||||||
let b:undo_indent .= '|'
|
let b:undo_indent .= '|'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
setlocal autoindent
|
setlocal autoindent
|
||||||
@ -49,34 +27,31 @@ let b:undo_indent .= 'setlocal
|
|||||||
\'
|
\'
|
||||||
|
|
||||||
function! SnippetsIndent() abort "{{{
|
function! SnippetsIndent() abort "{{{
|
||||||
let line = getline('.')
|
let line = getline('.')
|
||||||
let prev_line = (line('.') == 1)? '' : getline(line('.')-1)
|
let prev_line = (line('.') == 1)? '' : getline(line('.')-1)
|
||||||
let syntax = '\%(include\|snippet\|abbr\|prev_word\|delete\|alias\|options\|regexp\)\s'
|
let syntax = '\%(include\|snippet\|abbr\|prev_word\|delete\|alias\|options\|regexp\)\s'
|
||||||
let defining = '\%(snippet\|abbr\|prev_word\|alias\|options\|regexp\)\s'
|
let defining = '\%(snippet\|abbr\|prev_word\|alias\|options\|regexp\)\s'
|
||||||
|
|
||||||
"for indentkeys o,O
|
"for indentkeys o,O
|
||||||
if s:is_empty(line)
|
if s:is_empty(line)
|
||||||
if prev_line =~ '^' . defining
|
if prev_line =~ '^' . defining
|
||||||
return shiftwidth()
|
return shiftwidth()
|
||||||
else
|
else
|
||||||
return -1
|
return -1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
"for indentkeys =words
|
"for indentkeys =words
|
||||||
|
else
|
||||||
|
if line =~ '^\s*' . syntax
|
||||||
|
\ && (s:is_empty(prev_line)
|
||||||
|
\ || prev_line =~ '^' . defining)
|
||||||
|
return 0
|
||||||
else
|
else
|
||||||
if line =~ '^\s*' . syntax
|
return -1
|
||||||
\ && (s:is_empty(prev_line)
|
|
||||||
\ || prev_line =~ '^' . defining)
|
|
||||||
return 0
|
|
||||||
else
|
|
||||||
return -1
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
endfunction"}}}
|
endfunction"}}}
|
||||||
|
|
||||||
function! s:is_empty(line)
|
function! s:is_empty(line)
|
||||||
return a:line =~ '^\s*$'
|
return a:line =~ '^\s*$'
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: neosnippet.vim
|
" FILE: neosnippet.vim
|
||||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
|
||||||
" License: MIT license
|
" License: MIT license
|
||||||
"=============================================================================
|
"=============================================================================
|
||||||
|
|
||||||
@ -11,9 +11,6 @@ elseif v:version < 704
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let s:save_cpo = &cpo
|
|
||||||
set cpo&vim
|
|
||||||
|
|
||||||
" Plugin key-mappings. "{{{
|
" Plugin key-mappings. "{{{
|
||||||
inoremap <silent><expr> <Plug>(neosnippet_expand_or_jump)
|
inoremap <silent><expr> <Plug>(neosnippet_expand_or_jump)
|
||||||
\ neosnippet#mappings#expand_or_jump_impl()
|
\ neosnippet#mappings#expand_or_jump_impl()
|
||||||
@ -69,8 +66,5 @@ command! -bar NeoSnippetClearMarkers
|
|||||||
|
|
||||||
let g:loaded_neosnippet = 1
|
let g:loaded_neosnippet = 1
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
||||||
|
|
||||||
" __END__
|
" __END__
|
||||||
" vim: foldmethod=marker
|
" vim: foldmethod=marker
|
||||||
|
@ -1,31 +1,9 @@
|
|||||||
"=============================================================================
|
"=============================================================================
|
||||||
" FILE: syntaxtax/snippet.vim
|
" FILE: syntaxtax/snippet.vim
|
||||||
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
|
" AUTHOR: Shougo Matsushita <Shougo.Matsu at gmail.com>
|
||||||
" License: MIT license {{{
|
" 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
|
|
||||||
|
|
||||||
if version < 700
|
if version < 700
|
||||||
syntax clear
|
syntax clear
|
||||||
elseif exists("b:current_syntax")
|
elseif exists("b:current_syntax")
|
||||||
@ -109,7 +87,4 @@ highlight def link neosnippetOption PreProc
|
|||||||
highlight def link neosnippetAlias Identifier
|
highlight def link neosnippetAlias Identifier
|
||||||
highlight def link neosnippetEscape Special
|
highlight def link neosnippetEscape Special
|
||||||
|
|
||||||
let b:current_syntax = "snippet"
|
let b:current_syntax = 'snippet'
|
||||||
|
|
||||||
let &cpo = s:save_cpo
|
|
||||||
unlet s:save_cpo
|
|
||||||
|
Loading…
Reference in New Issue
Block a user