Browse Source

Remove markers

Shougo Matsushita 2 years ago
parent
commit
ddd01d0ee3

+ 10
- 12
autoload/neocomplcache/sources/snippets_complete.vim View File

@@ -11,15 +11,15 @@ let s:source = {
11 11
       \     g:neocomplcache_auto_completion_start_length,
12 12
       \}
13 13
 
14
-function! s:source.initialize() abort "{{{
14
+function! s:source.initialize() abort
15 15
   " Initialize.
16 16
   call neocomplcache#set_dictionary_helper(
17 17
         \ g:neocomplcache_source_rank, 'snippets_complete', 8)
18 18
   call neocomplcache#set_completion_length('snippets_complete',
19 19
         \ g:neocomplcache_auto_completion_start_length)
20
-endfunction"}}}
20
+endfunction
21 21
 
22
-function! s:source.get_keyword_pos(cur_text) abort "{{{
22
+function! s:source.get_keyword_pos(cur_text) abort
23 23
   let cur_word = matchstr(a:cur_text, '\w\+$')
24 24
   let word_candidates = neocomplcache#keyword_filter(
25 25
         \ filter(values(neosnippet#helpers#get_snippets()),
@@ -29,9 +29,9 @@ function! s:source.get_keyword_pos(cur_text) abort "{{{
29 29
   endif
30 30
 
31 31
   return match(a:cur_text, '\S\+$')
32
-endfunction"}}}
32
+endfunction
33 33
 
34
-function! s:source.get_complete_words(cur_keyword_pos, cur_keyword_str) abort "{{{
34
+function! s:source.get_complete_words(cur_keyword_pos, cur_keyword_str) abort
35 35
   let list = s:keyword_filter(neosnippet#helpers#get_snippets(), a:cur_keyword_str)
36 36
 
37 37
   for snippet in list
@@ -42,9 +42,9 @@ function! s:source.get_complete_words(cur_keyword_pos, cur_keyword_str) abort "{
42 42
   endfor
43 43
 
44 44
   return list
45
-endfunction"}}}
45
+endfunction
46 46
 
47
-function! s:keyword_filter(snippets, cur_keyword_str) abort "{{{
47
+function! s:keyword_filter(snippets, cur_keyword_str) abort
48 48
   " Uniq by real_name.
49 49
   let dict = {}
50 50
 
@@ -65,10 +65,8 @@ function! s:keyword_filter(snippets, cur_keyword_str) abort "{{{
65 65
   endfor
66 66
 
67 67
   return values(dict)
68
-endfunction"}}}
68
+endfunction
69 69
 
70
-function! neocomplcache#sources#snippets_complete#define() abort "{{{
70
+function! neocomplcache#sources#snippets_complete#define() abort
71 71
   return s:source
72
-endfunction"}}}
73
-
74
-" vim: foldmethod=marker
72
+endfunction

+ 6
- 8
autoload/neocomplete/sources/neosnippet.vim View File

@@ -15,7 +15,7 @@ let s:source = {
15 15
       \          ['matcher_fuzzy'] : ['matcher_head']),
16 16
       \}
17 17
 
18
-function! s:source.gather_candidates(context) abort "{{{
18
+function! s:source.gather_candidates(context) abort
19 19
   let snippets = values(neosnippet#helpers#get_completion_snippets())
20 20
   if matchstr(a:context.input, '\S\+$') !=#
21 21
         \ matchstr(a:context.input, '\w\+$')
@@ -23,9 +23,9 @@ function! s:source.gather_candidates(context) abort "{{{
23 23
     call filter(snippets, 'v:val.options.word')
24 24
   endif
25 25
   return snippets
26
-endfunction"}}}
26
+endfunction
27 27
 
28
-function! s:source.hooks.on_post_filter(context) abort "{{{
28
+function! s:source.hooks.on_post_filter(context) abort
29 29
   for snippet in a:context.candidates
30 30
     let snippet.dup = 1
31 31
     let snippet.menu = neosnippet#util#strwidthpart(
@@ -33,10 +33,8 @@ function! s:source.hooks.on_post_filter(context) abort "{{{
33 33
   endfor
34 34
 
35 35
   return a:context.candidates
36
-endfunction"}}}
36
+endfunction
37 37
 
38
-function! neocomplete#sources#neosnippet#define() abort "{{{
38
+function! neocomplete#sources#neosnippet#define() abort
39 39
   return s:source
40
-endfunction"}}}
41
-
42
-" vim: foldmethod=marker
40
+endfunction

+ 38
- 40
autoload/neosnippet.vim View File

@@ -4,7 +4,7 @@
4 4
 " License: MIT license
5 5
 "=============================================================================
6 6
 
7
-" Global options definition. "{{{
7
+" Global options definition.
8 8
 call neosnippet#util#set_default(
9 9
       \ 'g:neosnippet#disable_runtime_snippets', {})
10 10
 call neosnippet#util#set_default(
@@ -31,64 +31,62 @@ call neosnippet#util#set_default(
31 31
 call neosnippet#util#set_default(
32 32
       \ 'g:neosnippet#_completed_pairs',
33 33
       \ {'_':{ '(' : ')', '{' : '}', '"' : '"', '[' : ']' }})
34
-"}}}
35 34
 
36
-function! neosnippet#expandable_or_jumpable() abort "{{{
35
+
36
+function! neosnippet#expandable_or_jumpable() abort
37 37
   return neosnippet#mappings#expandable_or_jumpable()
38
-endfunction"}}}
39
-function! neosnippet#expandable() abort "{{{
38
+endfunction
39
+function! neosnippet#expandable() abort
40 40
   return neosnippet#mappings#expandable()
41
-endfunction"}}}
42
-function! neosnippet#jumpable() abort "{{{
41
+endfunction
42
+function! neosnippet#jumpable() abort
43 43
   return neosnippet#mappings#jumpable()
44
-endfunction"}}}
45
-function! neosnippet#anonymous(snippet) abort "{{{
44
+endfunction
45
+function! neosnippet#anonymous(snippet) abort
46 46
   return neosnippet#mappings#_anonymous(a:snippet)
47
-endfunction"}}}
48
-function! neosnippet#expand(trigger) abort "{{{
47
+endfunction
48
+function! neosnippet#expand(trigger) abort
49 49
   return neosnippet#mappings#_expand(a:trigger)
50
-endfunction"}}}
50
+endfunction
51 51
 
52
-function! neosnippet#get_snippets_directory() abort "{{{
52
+function! neosnippet#get_snippets_directory() abort
53 53
   return neosnippet#helpers#get_snippets_directory()
54
-endfunction"}}}
55
-function! neosnippet#get_user_snippets_directory() abort "{{{
54
+endfunction
55
+function! neosnippet#get_user_snippets_directory() abort
56 56
   return copy(neosnippet#variables#snippets_dir())
57
-endfunction"}}}
58
-function! neosnippet#get_runtime_snippets_directory() abort "{{{
57
+endfunction
58
+function! neosnippet#get_runtime_snippets_directory() abort
59 59
   return copy(neosnippet#variables#runtime_dir())
60
-endfunction"}}}
60
+endfunction
61 61
 
62 62
 " Get marker patterns.
63
-function! neosnippet#get_placeholder_target_marker_pattern() abort "{{{
63
+function! neosnippet#get_placeholder_target_marker_pattern() abort
64 64
   return '\%(\\\@<!\|\\\\\zs\)\${\d\+:\(#:\)\?TARGET\%(:.\{-}\)\?\\\@<!}'
65
-endfunction"}}}
66
-function! neosnippet#get_placeholder_marker_pattern() abort "{{{
65
+endfunction
66
+function! neosnippet#get_placeholder_marker_pattern() abort
67 67
   return '<`\d\+\%(:.\{-}\)\?\\\@<!`>'
68
-endfunction"}}}
69
-function! neosnippet#get_placeholder_marker_substitute_pattern() abort "{{{
68
+endfunction
69
+function! neosnippet#get_placeholder_marker_substitute_pattern() abort
70 70
   return '\%(\\\@<!\|\\\\\zs\)\${\(\d\+\%(:.\{-}\)\?\\\@<!\)}'
71
-endfunction"}}}
72
-function! neosnippet#get_placeholder_marker_substitute_nonzero_pattern() abort "{{{
71
+endfunction
72
+function! neosnippet#get_placeholder_marker_substitute_nonzero_pattern() abort
73 73
   return '\%(\\\@<!\|\\\\\zs\)\${\([1-9]\d*\%(:.\{-}\)\?\\\@<!\)}'
74
-endfunction"}}}
75
-function! neosnippet#get_placeholder_marker_substitute_zero_pattern() abort "{{{
74
+endfunction
75
+function! neosnippet#get_placeholder_marker_substitute_zero_pattern() abort
76 76
   return '\%(\\\@<!\|\\\\\zs\)\${\(0\%(:.\{-}\)\?\\\@<!\)}'
77
-endfunction"}}}
78
-function! neosnippet#get_placeholder_marker_default_pattern() abort "{{{
77
+endfunction
78
+function! neosnippet#get_placeholder_marker_default_pattern() abort
79 79
   return '<`\d\+:\zs.\{-}\ze\\\@<!`>'
80
-endfunction"}}}
81
-function! neosnippet#get_sync_placeholder_marker_pattern() abort "{{{
80
+endfunction
81
+function! neosnippet#get_sync_placeholder_marker_pattern() abort
82 82
   return '<{\d\+\%(:.\{-}\)\?\\\@<!}>'
83
-endfunction"}}}
84
-function! neosnippet#get_sync_placeholder_marker_default_pattern() abort "{{{
83
+endfunction
84
+function! neosnippet#get_sync_placeholder_marker_default_pattern() abort
85 85
   return '<{\d\+:\zs.\{-}\ze\\\@<!}>'
86
-endfunction"}}}
87
-function! neosnippet#get_mirror_placeholder_marker_pattern() abort "{{{
86
+endfunction
87
+function! neosnippet#get_mirror_placeholder_marker_pattern() abort
88 88
   return '<|\d\+|>'
89
-endfunction"}}}
90
-function! neosnippet#get_mirror_placeholder_marker_substitute_pattern() abort "{{{
89
+endfunction
90
+function! neosnippet#get_mirror_placeholder_marker_substitute_pattern() abort
91 91
   return '\\\@<!\$\(\d\+\)'
92
-endfunction"}}}
93
-
94
-" vim: foldmethod=marker
92
+endfunction

+ 24
- 26
autoload/neosnippet/commands.vim View File

@@ -4,22 +4,22 @@
4 4
 " License: MIT license
5 5
 "=============================================================================
6 6
 
7
-" Variables  "{{{
7
+" Variables
8 8
 let s:edit_options = [
9 9
       \ '-runtime',
10 10
       \ '-vertical', '-horizontal', '-direction=', '-split',
11 11
       \]
12 12
 let s:Cache = neosnippet#util#get_vital().import('System.Cache.Deprecated')
13
-"}}}
14 13
 
15
-function! s:get_list() abort "{{{
14
+
15
+function! s:get_list() abort
16 16
   if !exists('s:List')
17 17
     let s:List = vital#of('neosnippet').import('Data.List')
18 18
   endif
19 19
   return s:List
20
-endfunction"}}}
20
+endfunction
21 21
 
22
-function! neosnippet#commands#_edit(args) abort "{{{
22
+function! neosnippet#commands#_edit(args) abort
23 23
   if neosnippet#util#is_sudo()
24 24
     call neosnippet#util#print_error(
25 25
           \ '"sudo vim" is detected. This feature is disabled.')
@@ -72,9 +72,9 @@ function! neosnippet#commands#_edit(args) abort "{{{
72 72
     execute 'edit' fnameescape(filename)
73 73
   catch /^Vim\%((\a\+)\)\=:E749/
74 74
   endtry
75
-endfunction"}}}
75
+endfunction
76 76
 
77
-function! neosnippet#commands#_make_cache(filetype) abort "{{{
77
+function! neosnippet#commands#_make_cache(filetype) abort
78 78
   call neosnippet#init#check()
79 79
 
80 80
   let filetype = a:filetype == '' ?
@@ -108,17 +108,17 @@ function! neosnippet#commands#_make_cache(filetype) abort "{{{
108 108
             \ neosnippet#parser#_parse_snippet(filename, trigger)
109 109
     endfor
110 110
   endif
111
-endfunction"}}}
111
+endfunction
112 112
 
113
-function! neosnippet#commands#_source(filename) abort "{{{
113
+function! neosnippet#commands#_source(filename) abort
114 114
   call neosnippet#init#check()
115 115
 
116 116
   let neosnippet = neosnippet#variables#current_neosnippet()
117 117
   let neosnippet.snippets = extend(neosnippet.snippets,
118 118
         \ neosnippet#parser#_parse_snippets(a:filename))
119
-endfunction"}}}
119
+endfunction
120 120
 
121
-function! neosnippet#commands#_clear_markers() abort "{{{
121
+function! neosnippet#commands#_clear_markers() abort
122 122
   let expand_stack = neosnippet#variables#expand_stack()
123 123
 
124 124
   " Get patterns and count.
@@ -129,15 +129,15 @@ function! neosnippet#commands#_clear_markers() abort "{{{
129 129
   endif
130 130
 
131 131
   call neosnippet#view#_clear_markers(expand_stack[-1])
132
-endfunction"}}}
132
+endfunction
133 133
 
134 134
 " Complete helpers.
135
-function! neosnippet#commands#_edit_complete(arglead, cmdline, cursorpos) abort "{{{
135
+function! neosnippet#commands#_edit_complete(arglead, cmdline, cursorpos) abort
136 136
   return filter(s:edit_options +
137 137
         \ neosnippet#commands#_filetype_complete(a:arglead, a:cmdline, a:cursorpos),
138 138
         \ 'stridx(v:val, a:arglead) == 0')
139
-endfunction"}}}
140
-function! neosnippet#commands#_filetype_complete(arglead, cmdline, cursorpos) abort "{{{
139
+endfunction
140
+function! neosnippet#commands#_filetype_complete(arglead, cmdline, cursorpos) abort
141 141
   " Dup check.
142 142
   let ret = {}
143 143
   for item in map(
@@ -151,14 +151,14 @@ function! neosnippet#commands#_filetype_complete(arglead, cmdline, cursorpos) ab
151 151
   endfor
152 152
 
153 153
   return sort(keys(ret))
154
-endfunction"}}}
155
-function! neosnippet#commands#_complete_target_snippets(arglead, cmdline, cursorpos) abort "{{{
154
+endfunction
155
+function! neosnippet#commands#_complete_target_snippets(arglead, cmdline, cursorpos) abort
156 156
   return map(filter(values(neosnippet#helpers#get_snippets()),
157 157
         \ "stridx(v:val.word, a:arglead) == 0
158 158
         \ && v:val.snip =~# neosnippet#get_placeholder_target_marker_pattern()"), 'v:val.word')
159
-endfunction"}}}
159
+endfunction
160 160
 
161
-function! s:initialize_options(options) abort "{{{
161
+function! s:initialize_options(options) abort
162 162
   let default_options = {
163 163
         \ 'runtime' : 0,
164 164
         \ 'vertical' : 0,
@@ -175,9 +175,9 @@ function! s:initialize_options(options) abort "{{{
175 175
   endif
176 176
 
177 177
   return options
178
-endfunction"}}}
178
+endfunction
179 179
 
180
-function! s:get_snippets_files(path, filetype) abort "{{{
180
+function! s:get_snippets_files(path, filetype) abort
181 181
   let snippets_files = []
182 182
   for glob in s:get_list().flatten(
183 183
         \ map(split(get(g:neosnippet#scope_aliases,
@@ -190,8 +190,8 @@ function! s:get_snippets_files(path, filetype) abort "{{{
190 190
     let snippets_files += split(globpath(a:path, glob), '\n')
191 191
   endfor
192 192
   return reverse(s:get_list().uniq(snippets_files))
193
-endfunction"}}}
194
-function! s:get_snippet_files(path, filetype) abort "{{{
193
+endfunction
194
+function! s:get_snippet_files(path, filetype) abort
195 195
   let snippet_files = []
196 196
   for glob in s:get_list().flatten(
197 197
         \ map(split(get(g:neosnippet#scope_aliases,
@@ -200,6 +200,4 @@ function! s:get_snippet_files(path, filetype) abort "{{{
200 200
     let snippet_files += split(globpath(a:path, glob), '\n')
201 201
   endfor
202 202
   return reverse(s:get_list().uniq(snippet_files))
203
-endfunction"}}}
204
-
205
-" vim: foldmethod=marker
203
+endfunction

+ 6
- 8
autoload/neosnippet/handlers.vim View File

@@ -4,7 +4,7 @@
4 4
 " License: MIT license
5 5
 "=============================================================================
6 6
 
7
-function! neosnippet#handlers#_cursor_moved() abort "{{{
7
+function! neosnippet#handlers#_cursor_moved() abort
8 8
   let expand_stack = neosnippet#variables#expand_stack()
9 9
 
10 10
   " Get patterns and count.
@@ -18,9 +18,9 @@ function! neosnippet#handlers#_cursor_moved() abort "{{{
18 18
         \ && line('.') != expand_info.begin_line
19 19
     call neosnippet#view#_clear_markers(expand_info)
20 20
   endif
21
-endfunction"}}}
21
+endfunction
22 22
 
23
-function! neosnippet#handlers#_all_clear_markers() abort "{{{
23
+function! neosnippet#handlers#_all_clear_markers() abort
24 24
   if !&l:modifiable
25 25
     return
26 26
   endif
@@ -36,9 +36,9 @@ function! neosnippet#handlers#_all_clear_markers() abort "{{{
36 36
   finally
37 37
     call setpos('.', pos)
38 38
   endtry
39
-endfunction"}}}
39
+endfunction
40 40
 
41
-function! neosnippet#handlers#_restore_unnamed_register() abort "{{{
41
+function! neosnippet#handlers#_restore_unnamed_register() abort
42 42
   let neosnippet = neosnippet#variables#current_neosnippet()
43 43
 
44 44
   if neosnippet.unnamed_register != ''
@@ -46,6 +46,4 @@ function! neosnippet#handlers#_restore_unnamed_register() abort "{{{
46 46
     let @" = neosnippet.unnamed_register
47 47
     let neosnippet.unnamed_register = ''
48 48
   endif
49
-endfunction"}}}
50
-
51
-" vim: foldmethod=marker
49
+endfunction

+ 24
- 26
autoload/neosnippet/helpers.vim View File

@@ -4,7 +4,7 @@
4 4
 " License: MIT license
5 5
 "=============================================================================
6 6
 
7
-function! neosnippet#helpers#get_cursor_snippet(snippets, cur_text) abort "{{{
7
+function! neosnippet#helpers#get_cursor_snippet(snippets, cur_text) abort
8 8
   let cur_word = matchstr(a:cur_text, '\S\+$')
9 9
   if cur_word != '' && has_key(a:snippets, cur_word)
10 10
       return cur_word
@@ -20,9 +20,9 @@ function! neosnippet#helpers#get_cursor_snippet(snippets, cur_text) abort "{{{
20 20
   endwhile
21 21
 
22 22
   return cur_word
23
-endfunction"}}}
23
+endfunction
24 24
 
25
-function! neosnippet#helpers#get_snippets(...) abort "{{{
25
+function! neosnippet#helpers#get_snippets(...) abort
26 26
   let mode = get(a:000, 0, mode())
27 27
 
28 28
   call neosnippet#init#check()
@@ -51,13 +51,13 @@ function! neosnippet#helpers#get_snippets(...) abort "{{{
51 51
   endif
52 52
 
53 53
   return snippets
54
-endfunction"}}}
55
-function! neosnippet#helpers#get_completion_snippets() abort "{{{
54
+endfunction
55
+function! neosnippet#helpers#get_completion_snippets() abort
56 56
   return filter(neosnippet#helpers#get_snippets(),
57 57
         \ "!get(v:val.options, 'oneshot', 0)")
58
-endfunction"}}}
58
+endfunction
59 59
 
60
-function! neosnippet#helpers#get_snippets_directory() abort "{{{
60
+function! neosnippet#helpers#get_snippets_directory() abort
61 61
   let snippets_dir = copy(neosnippet#variables#snippets_dir())
62 62
   if !get(g:neosnippet#disable_runtime_snippets,
63 63
         \ neosnippet#helpers#get_filetype(),
@@ -66,9 +66,9 @@ function! neosnippet#helpers#get_snippets_directory() abort "{{{
66 66
   endif
67 67
 
68 68
   return snippets_dir
69
-endfunction"}}}
69
+endfunction
70 70
 
71
-function! neosnippet#helpers#get_filetype() abort "{{{
71
+function! neosnippet#helpers#get_filetype() abort
72 72
   " context_filetype.vim installation check.
73 73
   if !exists('s:exists_context_filetype')
74 74
     silent! call context_filetype#version()
@@ -83,9 +83,9 @@ function! neosnippet#helpers#get_filetype() abort "{{{
83 83
   endif
84 84
 
85 85
   return context_filetype
86
-endfunction"}}}
86
+endfunction
87 87
 
88
-function! neosnippet#helpers#get_selected_text(type, ...) abort "{{{
88
+function! neosnippet#helpers#get_selected_text(type, ...) abort
89 89
   let sel_save = &selection
90 90
   let &selection = 'inclusive'
91 91
   let reg_save = @@
@@ -109,8 +109,8 @@ function! neosnippet#helpers#get_selected_text(type, ...) abort "{{{
109 109
     let @@ = reg_save
110 110
     call setpos('.', pos)
111 111
   endtry
112
-endfunction"}}}
113
-function! neosnippet#helpers#delete_selected_text(type, ...) abort "{{{
112
+endfunction
113
+function! neosnippet#helpers#delete_selected_text(type, ...) abort
114 114
   let sel_save = &selection
115 115
   let &selection = 'inclusive'
116 116
   let reg_save = @@
@@ -132,8 +132,8 @@ function! neosnippet#helpers#delete_selected_text(type, ...) abort "{{{
132 132
     let @@ = reg_save
133 133
     call setpos('.', pos)
134 134
   endtry
135
-endfunction"}}}
136
-function! neosnippet#helpers#substitute_selected_text(type, text) abort "{{{
135
+endfunction
136
+function! neosnippet#helpers#substitute_selected_text(type, text) abort
137 137
   let sel_save = &selection
138 138
   let &selection = 'inclusive'
139 139
   let reg_save = @@
@@ -155,30 +155,28 @@ function! neosnippet#helpers#substitute_selected_text(type, text) abort "{{{
155 155
     let @@ = reg_save
156 156
     call setpos('.', pos)
157 157
   endtry
158
-endfunction"}}}
158
+endfunction
159 159
 
160
-function! neosnippet#helpers#vim2json(expr) abort "{{{
160
+function! neosnippet#helpers#vim2json(expr) abort
161 161
   return has('patch-7.4.1498') ? json_encode(a:expr) : string(a:expr)
162
-endfunction "}}}
163
-function! neosnippet#helpers#json2vim(expr) abort "{{{
162
+endfunction
163
+function! neosnippet#helpers#json2vim(expr) abort
164 164
   sandbox return has('patch-7.4.1498') ? json_decode(a:expr) : eval(a:expr)
165
-endfunction "}}}
165
+endfunction
166 166
 
167
-function! s:is_beginning_of_line(cur_text) abort "{{{
167
+function! s:is_beginning_of_line(cur_text) abort
168 168
   let keyword_pattern = '\S\+'
169 169
   let cur_keyword_str = matchstr(a:cur_text, keyword_pattern.'$')
170 170
   let line_part = a:cur_text[: -1-len(cur_keyword_str)]
171 171
   let prev_word_end = matchend(line_part, keyword_pattern)
172 172
 
173 173
   return prev_word_end <= 0
174
-endfunction"}}}
174
+endfunction
175 175
 
176
-function! s:get_sources_filetypes(filetype) abort "{{{
176
+function! s:get_sources_filetypes(filetype) abort
177 177
   let filetypes =
178 178
         \ exists('*context_filetype#get_filetypes') ?
179 179
         \   context_filetype#get_filetypes(a:filetype) :
180 180
         \ split(((a:filetype == '') ? 'nothing' : a:filetype), '\.')
181 181
   return neosnippet#util#uniq(['_'] + filetypes + [a:filetype])
182
-endfunction"}}}
183
-
184
-" vim: foldmethod=marker
182
+endfunction

+ 12
- 14
autoload/neosnippet/init.vim View File

@@ -4,28 +4,28 @@
4 4
 " License: MIT license
5 5
 "=============================================================================
6 6
 
7
-function! neosnippet#init#_initialize() abort "{{{
7
+function! neosnippet#init#_initialize() abort
8 8
   let s:is_initialized = 1
9 9
 
10 10
   call s:initialize_others()
11 11
   call s:initialize_cache()
12
-endfunction"}}}
12
+endfunction
13 13
 
14
-function! neosnippet#init#check() abort "{{{
14
+function! neosnippet#init#check() abort
15 15
   if !exists('s:is_initialized')
16 16
     call neosnippet#init#_initialize()
17 17
   endif
18
-endfunction"}}}
18
+endfunction
19 19
 
20
-function! s:initialize_cache() abort "{{{
20
+function! s:initialize_cache() abort
21 21
   " Make cache for _ snippets.
22 22
   call neosnippet#commands#_make_cache('_')
23 23
 
24 24
   " Initialize check.
25 25
   call neosnippet#commands#_make_cache(&filetype)
26
-endfunction"}}}
27
-function! s:initialize_others() abort "{{{
28
-  augroup neosnippet "{{{
26
+endfunction
27
+function! s:initialize_others() abort
28
+  augroup neosnippet
29 29
     autocmd!
30 30
     " Set make cache event.
31 31
     autocmd FileType *
@@ -35,7 +35,7 @@ function! s:initialize_others() abort "{{{
35 35
           \ call neosnippet#variables#set_snippets({})
36 36
     autocmd BufEnter *
37 37
           \ call neosnippet#mappings#_clear_select_mode_mappings()
38
-  augroup END"}}}
38
+  augroup END
39 39
 
40 40
   if g:neosnippet#enable_auto_clear_markers
41 41
     autocmd neosnippet CursorMoved,CursorMovedI *
@@ -72,7 +72,7 @@ function! s:initialize_others() abort "{{{
72 72
 
73 73
   call neosnippet#mappings#_clear_select_mode_mappings()
74 74
 
75
-  if g:neosnippet#enable_snipmate_compatibility "{{{
75
+  if g:neosnippet#enable_snipmate_compatibility
76 76
     " For snipMate function.
77 77
     function! Filename(...) abort
78 78
       let filename = expand('%:t:r')
@@ -84,7 +84,5 @@ function! s:initialize_others() abort "{{{
84 84
         return substitute(a:1, '$1', filename, 'g')
85 85
       endif
86 86
     endfunction
87
-  endif"}}}
88
-endfunction"}}}
89
-
90
-" vim: foldmethod=marker
87
+  endif
88
+endfunction

+ 36
- 38
autoload/neosnippet/mappings.vim View File

@@ -4,22 +4,22 @@
4 4
 " License: MIT license
5 5
 "=============================================================================
6 6
 
7
-function! neosnippet#mappings#expandable_or_jumpable() abort "{{{
7
+function! neosnippet#mappings#expandable_or_jumpable() abort
8 8
   return neosnippet#mappings#expandable() || neosnippet#mappings#jumpable()
9
-endfunction"}}}
10
-function! neosnippet#mappings#expandable() abort "{{{
9
+endfunction
10
+function! neosnippet#mappings#expandable() abort
11 11
   " Check snippet trigger.
12 12
   return neosnippet#mappings#completed_expandable()
13 13
         \ || neosnippet#helpers#get_cursor_snippet(
14 14
         \      neosnippet#helpers#get_snippets('i'),
15 15
         \      neosnippet#util#get_cur_text()) != ''
16
-endfunction"}}}
17
-function! neosnippet#mappings#jumpable() abort "{{{
16
+endfunction
17
+function! neosnippet#mappings#jumpable() abort
18 18
   " Found snippet placeholder.
19 19
   return search(neosnippet#get_placeholder_marker_pattern(). '\|'
20 20
             \ .neosnippet#get_sync_placeholder_marker_pattern(), 'nw') > 0
21
-endfunction"}}}
22
-function! neosnippet#mappings#completed_expandable() abort "{{{
21
+endfunction
22
+function! neosnippet#mappings#completed_expandable() abort
23 23
   if !s:enabled_completed_snippet()
24 24
     return 0
25 25
   endif
@@ -28,14 +28,14 @@ function! neosnippet#mappings#completed_expandable() abort "{{{
28 28
         \ v:completed_item, neosnippet#util#get_cur_text(),
29 29
         \ neosnippet#util#get_next_text())
30 30
   return snippet != ''
31
-endfunction"}}}
32
-function! s:enabled_completed_snippet() abort "{{{
31
+endfunction
32
+function! s:enabled_completed_snippet() abort
33 33
   return exists('v:completed_item')
34 34
         \ && !empty(v:completed_item)
35 35
         \ && g:neosnippet#enable_completed_snippet
36
-endfunction"}}}
36
+endfunction
37 37
 
38
-function! neosnippet#mappings#_clear_select_mode_mappings() abort "{{{
38
+function! neosnippet#mappings#_clear_select_mode_mappings() abort
39 39
   if !g:neosnippet#disable_select_mode_mappings
40 40
     return
41 41
   endif
@@ -56,9 +56,9 @@ function! neosnippet#mappings#_clear_select_mode_mappings() abort "{{{
56 56
   snoremap <BS>     a<BS>
57 57
   snoremap <Del>    a<BS>
58 58
   snoremap <C-h>    a<BS>
59
-endfunction"}}}
59
+endfunction
60 60
 
61
-function! neosnippet#mappings#_register_oneshot_snippet() abort "{{{
61
+function! neosnippet#mappings#_register_oneshot_snippet() abort
62 62
   let trigger = input('Please input snippet trigger: ', 'oneshot')
63 63
   if trigger == ''
64 64
     return
@@ -84,9 +84,9 @@ function! neosnippet#mappings#_register_oneshot_snippet() abort "{{{
84 84
         \ '', 0, '', trigger)
85 85
 
86 86
   echo 'Registered trigger : ' . trigger
87
-endfunction"}}}
87
+endfunction
88 88
 
89
-function! neosnippet#mappings#_expand_target() abort "{{{
89
+function! neosnippet#mappings#_expand_target() abort
90 90
   let trigger = input('Please input snippet trigger: ',
91 91
         \ '', 'customlist,neosnippet#commands#_complete_target_snippets')
92 92
   let neosnippet = neosnippet#variables#current_neosnippet()
@@ -102,8 +102,8 @@ function! neosnippet#mappings#_expand_target() abort "{{{
102 102
   endif
103 103
 
104 104
   call neosnippet#mappings#_expand_target_trigger(trigger)
105
-endfunction"}}}
106
-function! neosnippet#mappings#_expand_target_trigger(trigger) abort "{{{
105
+endfunction
106
+function! neosnippet#mappings#_expand_target_trigger(trigger) abort
107 107
   let neosnippet = neosnippet#variables#current_neosnippet()
108 108
   let neosnippet.target = substitute(
109 109
         \ neosnippet#helpers#get_selected_text(visualmode(), 1), '\n$', '', '')
@@ -128,25 +128,25 @@ function! neosnippet#mappings#_expand_target_trigger(trigger) abort "{{{
128 128
     call cursor(0, col('.') - 1)
129 129
     stopinsert
130 130
   endif
131
-endfunction"}}}
131
+endfunction
132 132
 
133
-function! neosnippet#mappings#_anonymous(snippet) abort "{{{
133
+function! neosnippet#mappings#_anonymous(snippet) abort
134 134
   let [cur_text, col, expr] = neosnippet#mappings#_pre_trigger()
135 135
   let expr .= printf("\<ESC>:call neosnippet#view#_insert(%s, {}, %s, %d)\<CR>",
136 136
         \ string(a:snippet), string(cur_text), col)
137 137
 
138 138
   return expr
139
-endfunction"}}}
140
-function! neosnippet#mappings#_expand(trigger) abort "{{{
139
+endfunction
140
+function! neosnippet#mappings#_expand(trigger) abort
141 141
   let [cur_text, col, expr] = neosnippet#mappings#_pre_trigger()
142 142
 
143 143
   let expr .= printf("\<ESC>:call neosnippet#view#_expand(%s, %d, %s)\<CR>",
144 144
         \ string(cur_text), col, string(a:trigger))
145 145
 
146 146
   return expr
147
-endfunction"}}}
147
+endfunction
148 148
 
149
-function! s:snippets_expand(cur_text, col) abort "{{{
149
+function! s:snippets_expand(cur_text, col) abort
150 150
   if s:expand_completed_snippets(a:cur_text, a:col)
151 151
     return 0
152 152
   endif
@@ -162,8 +162,8 @@ function! s:snippets_expand(cur_text, col) abort "{{{
162 162
   endif
163 163
 
164 164
   return 1
165
-endfunction"}}}
166
-function! s:expand_completed_snippets(cur_text, col) abort "{{{
165
+endfunction
166
+function! s:expand_completed_snippets(cur_text, col) abort
167 167
   if !s:enabled_completed_snippet()
168 168
     return 0
169 169
   endif
@@ -194,15 +194,15 @@ function! s:expand_completed_snippets(cur_text, col) abort "{{{
194 194
 
195 195
   call neosnippet#view#_insert(snippet, {}, cur_text, a:col)
196 196
   return 1
197
-endfunction"}}}
197
+endfunction
198 198
 
199
-function! s:snippets_expand_or_jump(cur_text, col) abort "{{{
199
+function! s:snippets_expand_or_jump(cur_text, col) abort
200 200
   if s:snippets_expand(a:cur_text, a:col)
201 201
     call neosnippet#view#_jump('', a:col)
202 202
   endif
203
-endfunction"}}}
203
+endfunction
204 204
 
205
-function! s:snippets_jump_or_expand(cur_text, col) abort "{{{
205
+function! s:snippets_jump_or_expand(cur_text, col) abort
206 206
   if search(neosnippet#get_placeholder_marker_pattern(). '\|'
207 207
             \ .neosnippet#get_sync_placeholder_marker_pattern(), 'nw') > 0
208 208
     " Found snippet placeholder.
@@ -210,13 +210,13 @@ function! s:snippets_jump_or_expand(cur_text, col) abort "{{{
210 210
   else
211 211
     return s:snippets_expand(a:cur_text, a:col)
212 212
   endif
213
-endfunction"}}}
213
+endfunction
214 214
 
215
-function! s:SID_PREFIX() abort "{{{
215
+function! s:SID_PREFIX() abort
216 216
   return matchstr(expand('<sfile>'), '<SNR>\d\+_\ze\w\+$')
217
-endfunction"}}}
217
+endfunction
218 218
 
219
-function! neosnippet#mappings#_trigger(function) abort "{{{
219
+function! neosnippet#mappings#_trigger(function) abort
220 220
   let [cur_text, col, expr] = neosnippet#mappings#_pre_trigger()
221 221
 
222 222
   if !neosnippet#mappings#expandable_or_jumpable()
@@ -227,9 +227,9 @@ function! neosnippet#mappings#_trigger(function) abort "{{{
227 227
         \ a:function, string(cur_text), col)
228 228
 
229 229
   return expr
230
-endfunction"}}}
230
+endfunction
231 231
 
232
-function! neosnippet#mappings#_pre_trigger() abort "{{{
232
+function! neosnippet#mappings#_pre_trigger() abort
233 233
   call neosnippet#init#check()
234 234
 
235 235
   let cur_text = neosnippet#util#get_cur_text()
@@ -249,7 +249,7 @@ function! neosnippet#mappings#_pre_trigger() abort "{{{
249 249
   endif
250 250
 
251 251
   return [cur_text, col, expr]
252
-endfunction"}}}
252
+endfunction
253 253
 
254 254
 " Plugin key-mappings.
255 255
 function! neosnippet#mappings#expand_or_jump_impl() abort
@@ -270,5 +270,3 @@ endfunction
270 270
 function! neosnippet#mappings#jump_impl() abort
271 271
   return neosnippet#mappings#_trigger('neosnippet#view#_jump')
272 272
 endfunction
273
-
274
-" vim: foldmethod=marker

+ 22
- 23
autoload/neosnippet/parser.vim View File

@@ -6,7 +6,7 @@
6 6
 
7 7
 let s:Cache = neosnippet#util#get_vital().import('System.Cache.Deprecated')
8 8
 
9
-function! neosnippet#parser#_parse_snippets(filename) abort "{{{
9
+function! neosnippet#parser#_parse_snippets(filename) abort
10 10
   if !filereadable(a:filename)
11 11
     call neosnippet#util#print_error(
12 12
           \ printf('snippet file "%s" is not found.', a:filename))
@@ -32,8 +32,8 @@ function! neosnippet#parser#_parse_snippets(filename) abort "{{{
32 32
   endif
33 33
 
34 34
   return snippets
35
-endfunction"}}}
36
-function! neosnippet#parser#_parse_snippet(filename, trigger) abort "{{{
35
+endfunction
36
+function! neosnippet#parser#_parse_snippet(filename, trigger) abort
37 37
   if !filereadable(a:filename)
38 38
     call neosnippet#util#print_error(
39 39
           \ printf('snippet file "%s" is not found.', a:filename))
@@ -48,9 +48,9 @@ function! neosnippet#parser#_parse_snippet(filename, trigger) abort "{{{
48 48
 
49 49
   return neosnippet#parser#_initialize_snippet(
50 50
         \ snippet_dict, a:filename, 1, '', a:trigger)
51
-endfunction"}}}
51
+endfunction
52 52
 
53
-function! s:parse(snippets_file) abort "{{{
53
+function! s:parse(snippets_file) abort
54 54
   let dup_check = {}
55 55
   let snippet_dict = {}
56 56
   let linenr = 1
@@ -120,9 +120,9 @@ function! s:parse(snippets_file) abort "{{{
120 120
   endif
121 121
 
122 122
   return [snippets, sourced]
123
-endfunction"}}}
123
+endfunction
124 124
 
125
-function! s:parse_snippet_name(snippets_file, line, linenr, dup_check) abort "{{{
125
+function! s:parse_snippet_name(snippets_file, line, linenr, dup_check) abort
126 126
   " Initialize snippet dict.
127 127
   let snippet_dict = {
128 128
         \ 'word' : '',
@@ -162,9 +162,9 @@ function! s:parse_snippet_name(snippets_file, line, linenr, dup_check) abort "{{
162 162
   endif
163 163
 
164 164
   return snippet_dict
165
-endfunction"}}}
165
+endfunction
166 166
 
167
-function! s:add_snippet_attribute(snippets_file, line, linenr, snippet_dict) abort "{{{
167
+function! s:add_snippet_attribute(snippets_file, line, linenr, snippet_dict) abort
168 168
   " Allow overriding/setting of the description (abbr) of the snippet.
169 169
   " This will override what was set via the snippet line.
170 170
   if a:line =~ '^abbr\s'
@@ -203,9 +203,9 @@ function! s:add_snippet_attribute(snippets_file, line, linenr, snippet_dict) abo
203 203
     call neosnippet#util#print_error(
204 204
           \ printf('Invalid syntax : "%s"', a:line))
205 205
   endif
206
-endfunction"}}}
206
+endfunction
207 207
 
208
-function! s:set_snippet_dict(snippet_dict, snippets, dup_check, snippets_file) abort "{{{
208
+function! s:set_snippet_dict(snippet_dict, snippets, dup_check, snippets_file) abort
209 209
   if empty(a:snippet_dict)
210 210
     return
211 211
   endif
@@ -225,9 +225,9 @@ function! s:set_snippet_dict(snippet_dict, snippets, dup_check, snippets_file) a
225 225
     let a:snippets[alias] = alias_snippet
226 226
     let a:dup_check[alias] = alias_snippet
227 227
   endfor
228
-endfunction"}}}
228
+endfunction
229 229
 
230
-function! neosnippet#parser#_initialize_snippet(dict, path, line, pattern, name) abort "{{{
230
+function! neosnippet#parser#_initialize_snippet(dict, path, line, pattern, name) abort
231 231
   let a:dict.word = substitute(a:dict.word, '\n\+$', '', '')
232 232
   if a:dict.word !~ '\n'
233 233
         \ && a:dict.word !~
@@ -265,9 +265,9 @@ function! neosnippet#parser#_initialize_snippet(dict, path, line, pattern, name)
265 265
   endif
266 266
 
267 267
   return snippet
268
-endfunction"}}}
268
+endfunction
269 269
 
270
-function! neosnippet#parser#_initialize_snippet_options() abort "{{{
270
+function! neosnippet#parser#_initialize_snippet_options() abort
271 271
   return {
272 272
         \ 'head' : 0,
273 273
         \ 'word' :
@@ -275,9 +275,9 @@ function! neosnippet#parser#_initialize_snippet_options() abort "{{{
275 275
         \ 'indent' : 0,
276 276
         \ 'oneshot' : 0,
277 277
         \ }
278
-endfunction"}}}
278
+endfunction
279 279
 
280
-function! neosnippet#parser#_get_completed_snippet(completed_item, cur_text, next_text) abort "{{{
280
+function! neosnippet#parser#_get_completed_snippet(completed_item, cur_text, next_text) abort
281 281
   let item = a:completed_item
282 282
 
283 283
   if strridx(a:cur_text, item.word) != len(a:cur_text) - len(item.word)
@@ -376,9 +376,9 @@ function! neosnippet#parser#_get_completed_snippet(completed_item, cur_text, nex
376 376
   let snippet .= '${' . cnt . '}'
377 377
 
378 378
   return snippet
379
-endfunction"}}}
379
+endfunction
380 380
 
381
-function! neosnippet#parser#_get_in_paren(key, pair, str) abort "{{{
381
+function! neosnippet#parser#_get_in_paren(key, pair, str) abort
382 382
   let s = ''
383 383
   let level = 0
384 384
   for c in split(a:str, '\zs')
@@ -402,9 +402,9 @@ function! neosnippet#parser#_get_in_paren(key, pair, str) abort "{{{
402 402
   endfor
403 403
 
404 404
   return ''
405
-endfunction"}}}
405
+endfunction
406 406
 
407
-function! neosnippet#parser#_conceal_argument(arg, cnt, args) abort "{{{
407
+function! neosnippet#parser#_conceal_argument(arg, cnt, args) abort
408 408
   let outside = ''
409 409
   let inside = ''
410 410
   if (a:args != '')
@@ -415,5 +415,4 @@ function! neosnippet#parser#_conceal_argument(arg, cnt, args) abort "{{{
415 415
     endif
416 416
   endif
417 417
   return printf('%s${%d:#:%s%s}', outside, a:cnt, inside, escape(a:arg, '{}'))
418
-endfunction"}}}
419
-" vim: foldmethod=marker
418
+endfunction

+ 50
- 52
autoload/neosnippet/util.vim View File

@@ -4,99 +4,99 @@
4 4
 " License: MIT license
5 5
 "=============================================================================
6 6
 
7
-function! neosnippet#util#get_vital() abort "{{{
7
+function! neosnippet#util#get_vital() abort
8 8
   if !exists('s:V')
9 9
     let s:V = vital#neosnippet#new()
10 10
   endif
11 11
   return s:V
12
-endfunction"}}}
13
-function! s:get_prelude() abort "{{{
12
+endfunction
13
+function! s:get_prelude() abort
14 14
   if !exists('s:Prelude')
15 15
     let s:Prelude = neosnippet#util#get_vital().import('Prelude')
16 16
   endif
17 17
   return s:Prelude
18
-endfunction"}}}
19
-function! s:get_list() abort "{{{
18
+endfunction
19
+function! s:get_list() abort
20 20
   if !exists('s:List')
21 21
     let s:List = neosnippet#util#get_vital().import('Data.List')
22 22
   endif
23 23
   return s:List
24
-endfunction"}}}
25
-function! s:get_string() abort "{{{
24
+endfunction
25
+function! s:get_string() abort
26 26
   if !exists('s:String')
27 27
     let s:String = neosnippet#util#get_vital().import('Data.String')
28 28
   endif
29 29
   return s:String
30
-endfunction"}}}
31
-function! s:get_process() abort "{{{
30
+endfunction
31
+function! s:get_process() abort
32 32
   if !exists('s:Process')
33 33
     let s:Process = neosnippet#util#get_vital().import('Process')
34 34
   endif
35 35
   return s:Process
36
-endfunction"}}}
36
+endfunction
37 37
 
38
-function! neosnippet#util#substitute_path_separator(...) abort "{{{
38
+function! neosnippet#util#substitute_path_separator(...) abort
39 39
   return call(s:get_prelude().substitute_path_separator, a:000)
40
-endfunction"}}}
41
-function! neosnippet#util#system(...) abort "{{{
40
+endfunction
41
+function! neosnippet#util#system(...) abort
42 42
   return call(s:get_process().system, a:000)
43
-endfunction"}}}
44
-function! neosnippet#util#has_vimproc(...) abort "{{{
43
+endfunction
44
+function! neosnippet#util#has_vimproc(...) abort
45 45
   return call(s:get_process().has_vimproc, a:000)
46
-endfunction"}}}
47
-function! neosnippet#util#is_windows(...) abort "{{{
46
+endfunction
47
+function! neosnippet#util#is_windows(...) abort
48 48
   return call(s:get_prelude().is_windows, a:000)
49
-endfunction"}}}
50
-function! neosnippet#util#is_mac(...) abort "{{{
49
+endfunction
50
+function! neosnippet#util#is_mac(...) abort
51 51
   return call(s:get_prelude().is_mac, a:000)
52
-endfunction"}}}
53
-function! neosnippet#util#get_last_status(...) abort "{{{
52
+endfunction
53
+function! neosnippet#util#get_last_status(...) abort
54 54
   return call(s:get_process().get_last_status, a:000)
55
-endfunction"}}}
56
-function! neosnippet#util#escape_pattern(...) abort "{{{
55
+endfunction
56
+function! neosnippet#util#escape_pattern(...) abort
57 57
   return call(s:get_string().escape_pattern, a:000)
58
-endfunction"}}}
59
-function! neosnippet#util#iconv(...) abort "{{{
58
+endfunction
59
+function! neosnippet#util#iconv(...) abort
60 60
   return call(s:get_process().iconv, a:000)
61
-endfunction"}}}
62
-function! neosnippet#util#truncate(...) abort "{{{
61
+endfunction
62
+function! neosnippet#util#truncate(...) abort
63 63
   return call(s:get_string().truncate, a:000)
64
-endfunction"}}}
65
-function! neosnippet#util#strwidthpart(...) abort "{{{
64
+endfunction
65
+function! neosnippet#util#strwidthpart(...) abort
66 66
   return call(s:get_string().strwidthpart, a:000)
67
-endfunction"}}}
67
+endfunction
68 68
 
69
-function! neosnippet#util#expand(path) abort "{{{
69
+function! neosnippet#util#expand(path) abort
70 70
   return neosnippet#util#substitute_path_separator(
71 71
         \ expand(escape(a:path, '*?[]"={}'), 1))
72
-endfunction"}}}
73
-function! neosnippet#util#set_default(var, val, ...) abort  "{{{
72
+endfunction
73
+function! neosnippet#util#set_default(var, val, ...) abort 
74 74
   let old_var = get(a:000, 0, '')
75 75
   if exists(old_var)
76 76
     let {a:var} = {old_var}
77 77
   elseif !exists(a:var)
78 78
     let {a:var} = a:val
79 79
   endif
80
-endfunction"}}}
81
-function! neosnippet#util#set_dictionary_helper(...) abort "{{{
80
+endfunction
81
+function! neosnippet#util#set_dictionary_helper(...) abort
82 82
   return call(s:get_prelude().set_dictionary_helper, a:000)
83
-endfunction"}}}
83
+endfunction
84 84
 
85
-function! neosnippet#util#get_cur_text() abort "{{{
85
+function! neosnippet#util#get_cur_text() abort
86 86
   return
87 87
         \ (mode() ==# 'i' ? (col('.')-1) : col('.')) >= len(getline('.')) ?
88 88
         \      getline('.') :
89 89
         \      matchstr(getline('.'),
90 90
         \         '^.*\%' . col('.') . 'c' . (mode() ==# 'i' ? '' : '.'))
91
-endfunction"}}}
92
-function! neosnippet#util#get_next_text() abort "{{{
91
+endfunction
92
+function! neosnippet#util#get_next_text() abort
93 93
   return getline('.')[len(neosnippet#util#get_cur_text()) :]
94
-endfunction"}}}
95
-function! neosnippet#util#print_error(string) abort "{{{
94
+endfunction
95
+function! neosnippet#util#print_error(string) abort
96 96
   echohl Error | echomsg '[neosnippet] ' . a:string | echohl None
97
-endfunction"}}}
97
+endfunction
98 98
 
99
-function! neosnippet#util#parse_options(args, options_list) abort "{{{
99
+function! neosnippet#util#parse_options(args, options_list) abort
100 100
   let args = []
101 101
   let options = {}
102 102
   for arg in split(a:args, '\%(\\\@<!\s\)\+')
@@ -117,9 +117,9 @@ function! neosnippet#util#parse_options(args, options_list) abort "{{{
117 117
   endfor
118 118
 
119 119
   return [args, options]
120
-endfunction"}}}
120
+endfunction
121 121
 function! neosnippet#util#get_buffer_config(
122
-      \ filetype, buffer_var, user_var, default_var, ...) abort "{{{
122
+      \ filetype, buffer_var, user_var, default_var, ...) abort
123 123
   let default_val = get(a:000, 0, '')
124 124
 
125 125
   if exists(a:buffer_var)
@@ -131,18 +131,18 @@ function! neosnippet#util#get_buffer_config(
131 131
 
132 132
   return get({a:user_var}, filetype,
133 133
         \   get(eval(a:default_var), filetype, default_val))
134
-endfunction"}}}
134
+endfunction
135 135
 
136 136
 " Sudo check.
137
-function! neosnippet#util#is_sudo() abort "{{{
137
+function! neosnippet#util#is_sudo() abort
138 138
   return $SUDO_USER != '' && $USER !=# $SUDO_USER
139 139
       \ && $HOME !=# expand('~'.$USER)
140 140
       \ && $HOME ==# expand('~'.$SUDO_USER)
141
-endfunction"}}}
141
+endfunction
142 142
 
143
-function! neosnippet#util#option2list(str) abort "{{{
143
+function! neosnippet#util#option2list(str) abort
144 144
   return type(a:str) == type('') ? split(a:str, '\s*,\s*') : a:str
145
-endfunction"}}}
145
+endfunction
146 146
 
147 147
 function! neosnippet#util#uniq(list) abort
148 148
   let list = copy(a:list)
@@ -161,5 +161,3 @@ function! neosnippet#util#uniq(list) abort
161 161
   endwhile
162 162
   return list
163 163
 endfunction
164
-
165
-" vim: foldmethod=marker

+ 18
- 20
autoload/neosnippet/variables.vim View File

@@ -4,7 +4,7 @@
4 4
 " License: MIT license
5 5
 "=============================================================================
6 6
 
7
-function! neosnippet#variables#current_neosnippet() abort "{{{
7
+function! neosnippet#variables#current_neosnippet() abort
8 8
   if !exists('b:neosnippet')
9 9
     let b:neosnippet = {
10 10
           \ 'snippets' : {},
@@ -17,42 +17,42 @@ function! neosnippet#variables#current_neosnippet() abort "{{{
17 17
   endif
18 18
 
19 19
   return b:neosnippet
20
-endfunction"}}}
21
-function! neosnippet#variables#expand_stack() abort "{{{
20
+endfunction
21
+function! neosnippet#variables#expand_stack() abort
22 22
   if !exists('s:expand_stack')
23 23
     let s:expand_stack = []
24 24
   endif
25 25
 
26 26
   return s:expand_stack
27
-endfunction"}}}
28
-function! neosnippet#variables#pop_expand_stack() abort "{{{
27
+endfunction
28
+function! neosnippet#variables#pop_expand_stack() abort
29 29
   let s:expand_stack = s:expand_stack[: -2]
30
-endfunction"}}}
31
-function! neosnippet#variables#clear_expand_stack() abort "{{{
30
+endfunction
31
+function! neosnippet#variables#clear_expand_stack() abort
32 32
   let s:expand_stack = []
33
-endfunction"}}}
34
-function! neosnippet#variables#snippets() abort "{{{
33
+endfunction
34
+function! neosnippet#variables#snippets() abort
35 35
   if !exists('s:snippets')
36 36
     let s:snippets= {}
37 37
   endif
38 38
 
39 39
   return s:snippets
40
-endfunction"}}}
41
-function! neosnippet#variables#set_snippets(list) abort "{{{
40
+endfunction
41
+function! neosnippet#variables#set_snippets(list) abort
42 42
   if !exists('s:snippets')
43 43
     let s:snippets= {}
44 44
   endif
45 45
 
46 46
   let s:snippets = a:list
47
-endfunction"}}}
48
-function! neosnippet#variables#snippets_dir() abort "{{{
47
+endfunction
48
+function! neosnippet#variables#snippets_dir() abort
49 49
   " Set snippets_dir.
50 50
   let snippets_dir = map(neosnippet#util#option2list(
51 51
         \   g:neosnippet#snippets_directory),
52 52
         \ 'neosnippet#util#expand(v:val)')
53 53
   return map(snippets_dir, 'substitute(v:val, "[\\\\/]$", "", "")')
54
-endfunction"}}}
55
-function! neosnippet#variables#runtime_dir() abort "{{{
54
+endfunction
55
+function! neosnippet#variables#runtime_dir() abort
56 56
   " Set runtime dir.
57 57
   let runtime_dir = split(globpath(&runtimepath, 'neosnippets'), '\n')
58 58
   if empty(runtime_dir) && empty(g:neosnippet#disable_runtime_snippets)
@@ -71,8 +71,8 @@ function! neosnippet#variables#runtime_dir() abort "{{{
71 71
   endif
72 72
 
73 73
   return map(runtime_dir, 'substitute(v:val, "[\\\\/]$", "", "")')
74
-endfunction"}}}
75
-function! neosnippet#variables#data_dir() abort "{{{
74
+endfunction
75
+function! neosnippet#variables#data_dir() abort
76 76
   let g:neosnippet#data_directory =
77 77
         \ substitute(fnamemodify(get(
78 78
         \   g:, 'neosnippet#data_directory',
@@ -84,6 +84,4 @@ function! neosnippet#variables#data_dir() abort "{{{
84 84
   endif
85 85
 
86 86
   return g:neosnippet#data_directory
87
-endfunction"}}}
88
-
89
-" vim: foldmethod=marker
87
+endfunction

+ 28
- 30
autoload/neosnippet/view.vim View File

@@ -4,7 +4,7 @@
4 4
 " License: MIT license
5 5
 "=============================================================================
6 6
 
7
-function! neosnippet#view#_expand(cur_text, col, trigger_name) abort "{{{
7
+function! neosnippet#view#_expand(cur_text, col, trigger_name) abort
8 8
   let snippets = neosnippet#helpers#get_snippets()
9 9
 
10 10
   if a:trigger_name == '' || !has_key(snippets, a:trigger_name)
@@ -25,8 +25,8 @@ function! neosnippet#view#_expand(cur_text, col, trigger_name) abort "{{{
25 25
   let cur_text = a:cur_text[: -1-len(a:trigger_name)]
26 26
 
27 27
   call neosnippet#view#_insert(snippet.snip, snippet.options, cur_text, a:col)
28
-endfunction"}}}
29
-function! neosnippet#view#_insert(snippet, options, cur_text, col) abort "{{{
28
+endfunction
29
+function! neosnippet#view#_insert(snippet, options, cur_text, col) abort
30 30
   let options = extend(
31 31
         \ neosnippet#parser#_initialize_snippet_options(),
32 32
         \ a:options)
@@ -105,8 +105,8 @@ function! neosnippet#view#_insert(snippet, options, cur_text, col) abort "{{{
105 105
       silent! execute begin_line . ',' . end_line . 'foldopen!'
106 106
     endif
107 107
   endtry
108
-endfunction"}}}
109
-function! neosnippet#view#_jump(_, col) abort "{{{
108
+endfunction
109
+function! neosnippet#view#_jump(_, col) abort
110 110
   try
111 111
     let expand_stack = neosnippet#variables#expand_stack()
112 112
 
@@ -148,9 +148,9 @@ function! neosnippet#view#_jump(_, col) abort "{{{
148 148
   finally
149 149
     call s:skip_next_auto_completion()
150 150
   endtry
151
-endfunction"}}}
151
+endfunction
152 152
 
153
-function! s:indent_snippet(begin, end) abort "{{{
153
+function! s:indent_snippet(begin, end) abort
154 154
   if a:begin > a:end
155 155
     return
156 156
   endif
@@ -187,9 +187,9 @@ function! s:indent_snippet(begin, end) abort "{{{
187 187
     let &l:equalprg = equalprg
188 188
     call setpos('.', pos)
189 189
   endtry
190
-endfunction"}}}
190
+endfunction
191 191
 
192
-function! neosnippet#view#_get_snippet_range(begin_line, begin_patterns, end_line, end_patterns) abort "{{{
192
+function! neosnippet#view#_get_snippet_range(begin_line, begin_patterns, end_line, end_patterns) abort
193 193
   let pos = getpos('.')
194 194
 
195 195
   call cursor(a:begin_line, 0)
@@ -227,8 +227,8 @@ function! neosnippet#view#_get_snippet_range(begin_line, begin_patterns, end_lin
227 227
 
228 228
   call setpos('.', pos)
229 229
   return [begin, end]
230
-endfunction"}}}
231
-function! neosnippet#view#_search_snippet_range(start, end, cnt, ...) abort "{{{
230
+endfunction
231
+function! neosnippet#view#_search_snippet_range(start, end, cnt, ...) abort
232 232
   let is_select = get(a:000, 0, 1)
233 233
   call s:substitute_placeholder_marker(a:start, a:end, a:cnt)
234 234
 
@@ -250,8 +250,8 @@ function! neosnippet#view#_search_snippet_range(start, end, cnt, ...) abort "{{{
250 250
   endfor
251 251
 
252 252
   return 0
253
-endfunction"}}}
254
-function! neosnippet#view#_search_outof_range(col) abort "{{{
253
+endfunction
254
+function! neosnippet#view#_search_outof_range(col) abort
255 255
   call s:substitute_placeholder_marker(1, 0, 0)
256 256
 
257 257
   let pattern = neosnippet#get_placeholder_marker_pattern()
@@ -275,8 +275,8 @@ function! neosnippet#view#_search_outof_range(col) abort "{{{
275 275
 
276 276
   " Not found.
277 277
   return 0
278
-endfunction"}}}
279
-function! neosnippet#view#_clear_markers(expand_info) abort "{{{
278
+endfunction
279
+function! neosnippet#view#_clear_markers(expand_info) abort
280 280
   " Search patterns.
281 281
   let [begin, end] = neosnippet#view#_get_snippet_range(
282 282
         \ a:expand_info.begin_line,
@@ -311,8 +311,8 @@ function! neosnippet#view#_clear_markers(expand_info) abort "{{{
311 311
 
312 312
     call neosnippet#variables#pop_expand_stack()
313 313
   endtry
314
-endfunction"}}}
315
-function! s:expand_placeholder(start, end, holder_cnt, line, ...) abort "{{{
314
+endfunction
315
+function! s:expand_placeholder(start, end, holder_cnt, line, ...) abort
316 316
   let is_select = get(a:000, 0, 1)
317 317
 
318 318
   let pattern = substitute(neosnippet#get_placeholder_marker_pattern(),
@@ -401,8 +401,8 @@ function! s:expand_placeholder(start, end, holder_cnt, line, ...) abort "{{{
401 401
   else
402 402
     startinsert!
403 403
   endif
404
-endfunction"}}}
405
-function! s:expand_target_placeholder(line, col) abort "{{{
404
+endfunction
405
+function! s:expand_target_placeholder(line, col) abort
406 406
   " Expand target
407 407
   let neosnippet = neosnippet#variables#current_neosnippet()
408 408
   let next_line = getline(a:line)[a:col-1 :]
@@ -461,8 +461,8 @@ function! s:expand_target_placeholder(line, col) abort "{{{
461 461
   let neosnippet.target = ''
462 462
 
463 463
   call neosnippet#view#_jump('', col)
464
-endfunction"}}}
465
-function! s:search_sync_placeholder(start, end, number) abort "{{{
464
+endfunction
465
+function! s:search_sync_placeholder(start, end, number) abort
466 466
   if a:end == 0
467 467
     " Search in current buffer.
468 468
     let cnt = matchstr(getline('.'),
@@ -482,8 +482,8 @@ function! s:search_sync_placeholder(start, end, number) abort "{{{
482 482
   endif
483 483
 
484 484
   return -1
485
-endfunction"}}}
486
-function! s:substitute_placeholder_marker(start, end, snippet_holder_cnt) abort "{{{
485
+endfunction
486
+function! s:substitute_placeholder_marker(start, end, snippet_holder_cnt) abort
487 487
   if a:snippet_holder_cnt > 0
488 488
     let cnt = a:snippet_holder_cnt-1
489 489
     let sync_marker = substitute(neosnippet#get_sync_placeholder_marker_pattern(),
@@ -518,8 +518,8 @@ function! s:substitute_placeholder_marker(start, end, snippet_holder_cnt) abort
518 518
         \ '\\d\\+', cnt, '')
519 519
     call setline('.', substitute(getline('.'), sync_marker, sub, ''))
520 520
   endif
521
-endfunction"}}}
522
-function! s:eval_snippet(snippet_text) abort "{{{
521
+endfunction
522
+function! s:eval_snippet(snippet_text) abort
523 523
   let snip_word = ''
524 524
   let prev_match = 0
525 525
   let match = match(a:snippet_text, '\\\@<!`.\{-}\\\@<!`')
@@ -540,8 +540,8 @@ function! s:eval_snippet(snippet_text) abort "{{{
540 540
   endif
541 541
 
542 542
   return snip_word
543
-endfunction"}}}
544
-function! s:skip_next_auto_completion() abort "{{{
543
+endfunction
544
+function! s:skip_next_auto_completion() abort
545 545
   " Skip next auto completion.
546 546
   let neosnippet = neosnippet#variables#current_neosnippet()
547 547
   let neosnippet.trigger = 0
@@ -552,6 +552,4 @@ function! s:skip_next_auto_completion() abort "{{{
552 552
   if exists('#deoplete#CompleteDone')
553 553
     doautocmd deoplete CompleteDone
554 554
   endif
555
-endfunction"}}}
556
-
557
-" vim: foldmethod=marker
555
+endfunction

+ 18
- 20
autoload/unite/sources/neosnippet.vim View File

@@ -4,7 +4,7 @@
4 4
 " License: MIT license
5 5
 "=============================================================================
6 6
 
7
-function! unite#sources#neosnippet#define() abort "{{{
7
+function! unite#sources#neosnippet#define() abort
8 8
   let kind = {
9 9
         \ 'name' : 'neosnippet',
10 10
         \ 'default_action' : 'expand',
@@ -15,7 +15,7 @@ function! unite#sources#neosnippet#define() abort "{{{
15 15
   call unite#define_kind(kind)
16 16
 
17 17
   return s:source
18
-endfunction "}}}
18
+endfunction
19 19
 
20 20
 " neosnippet source.
21 21
 let s:source = {
@@ -24,14 +24,14 @@ let s:source = {
24 24
       \ 'action_table' : {},
25 25
       \ }
26 26
 
27
-function! s:source.hooks.on_init(args, context) abort "{{{
27
+function! s:source.hooks.on_init(args, context) abort
28 28
   let a:context.source__cur_keyword_pos =
29 29
         \ s:get_keyword_pos(neosnippet#util#get_cur_text())
30 30
   let a:context.source__snippets =
31 31
         \ sort(values(neosnippet#helpers#get_completion_snippets()))
32
-endfunction"}}}
32
+endfunction
33 33
 
34
-function! s:source.gather_candidates(args, context) abort "{{{
34
+function! s:source.gather_candidates(args, context) abort
35 35
   return map(copy(a:context.source__snippets), "{
36 36
         \   'word' : v:val.word,
37 37
         \   'abbr' : printf('%-50s %s', v:val.word, v:val.menu_abbr),
@@ -44,29 +44,29 @@ function! s:source.gather_candidates(args, context) abort "{{{
44 44
         \   'source__snip' : v:val.snip,
45 45
         \   'source__snip_ref' : v:val,
46 46
         \ }")
47
-endfunction "}}}
47
+endfunction
48 48
 
49
-" Actions "{{{
49
+" Actions
50 50
 let s:action_table = {}
51 51
 
52 52
 let s:action_table.expand = {
53 53
       \ 'description' : 'expand snippet',
54 54
       \ }
55
-function! s:action_table.expand.func(candidate) abort "{{{
55
+function! s:action_table.expand.func(candidate) abort
56 56
   let cur_text = neosnippet#util#get_cur_text()
57 57
   let cur_keyword_str = matchstr(cur_text, '\S\+$')
58 58
   let context = unite#get_context()
59 59
   call neosnippet#view#_expand(
60 60
         \ cur_text . a:candidate.action__complete_word[len(cur_keyword_str)],
61 61
         \ context.col, a:candidate.action__complete_word)
62
-endfunction"}}}
62
+endfunction
63 63
 
64 64
 let s:action_table.preview = {
65 65
       \ 'description' : 'preview snippet',
66 66
       \ 'is_selectable' : 1,
67 67
       \ 'is_quit' : 0,
68 68
       \ }
69
-function! s:action_table.preview.func(candidates) abort "{{{
69
+function! s:action_table.preview.func(candidates) abort
70 70
   for snip in a:candidates
71 71
     echohl String
72 72
     echo snip.action__complete_word
@@ -74,13 +74,13 @@ function! s:action_table.preview.func(candidates) abort "{{{
74 74
     echo snip.source__snip
75 75
     echo ' '
76 76
   endfor
77
-endfunction"}}}
77
+endfunction
78 78
 
79 79
 let s:action_table.unite__new_candidate = {
80 80
       \ 'description' : 'add new snippet',
81 81
       \ 'is_quit' : 1,
82 82
       \ }
83
-function! s:action_table.unite__new_candidate.func(candidate) abort "{{{
83
+function! s:action_table.unite__new_candidate.func(candidate) abort
84 84
   let trigger = unite#util#input('Please input snippet trigger: ')
85 85
   if trigger == ''
86 86
     echo 'Canceled.'
@@ -107,14 +107,14 @@ function! s:action_table.unite__new_candidate.func(candidate) abort "{{{
107 107
 
108 108
   call cursor(line('$'), 0)
109 109
   call cursor(0, col('$'))
110
-endfunction"}}}
110
+endfunction
111 111
 
112 112
 
113 113
 let s:source.action_table = s:action_table
114 114
 unlet! s:action_table
115
-"}}}
116 115
 
117
-function! unite#sources#neosnippet#start_complete() abort "{{{
116
+
117
+function! unite#sources#neosnippet#start_complete() abort
118 118
   if !exists(':Unite')
119 119
     call neosnippet#util#print_error(
120 120
           \ 'unite.vim is not installed.')
@@ -125,9 +125,9 @@ function! unite#sources#neosnippet#start_complete() abort "{{{
125 125
 
126 126
   return unite#start_complete(['neosnippet'],
127 127
         \ { 'input': neosnippet#util#get_cur_text(), 'buffer_name' : '' })
128
-endfunction "}}}
128
+endfunction
129 129
 
130
-function! s:get_keyword_pos(cur_text) abort "{{{
130
+function! s:get_keyword_pos(cur_text) abort
131 131
   let cur_keyword_pos = match(a:cur_text, '\S\+$')
132 132
   if cur_keyword_pos < 0
133 133
     " Empty string.
@@ -135,6 +135,4 @@ function! s:get_keyword_pos(cur_text) abort "{{{
135 135
   endif
136 136
 
137 137
   return cur_keyword_pos
138
-endfunction"}}}
139
-
140
-" vim: foldmethod=marker
138
+endfunction

+ 14
- 16
autoload/unite/sources/neosnippet_file.vim View File

@@ -4,9 +4,9 @@
4 4
 " License: MIT license
5 5
 "=============================================================================
6 6
 
7
-function! unite#sources#neosnippet_file#define() abort "{{{
7
+function! unite#sources#neosnippet_file#define() abort
8 8
   return [s:source_user, s:source_runtime]
9
-endfunction "}}}
9
+endfunction
10 10
 
11 11
 " common action table
12 12
 let s:action_table = {}
@@ -15,14 +15,14 @@ let s:action_table.neosnippet_source = {
15 15
       \ 'is_selectable' : 1,
16 16
       \ 'is_quit' : 1,
17 17
       \ }
18
-function! s:action_table.neosnippet_source.func(candidates) abort "{{{
18
+function! s:action_table.neosnippet_source.func(candidates) abort
19 19
   for candidate in a:candidates
20 20
     let snippet_name = candidate.action__path
21 21
     if snippet_name != ''
22 22
       call neosnippet#commands#_source(snippet_name)
23 23
     endif
24 24
   endfor
25
-endfunction"}}}
25
+endfunction
26 26
 
27 27
 " neosnippet source.
28 28
 let s:source_user = {
@@ -30,23 +30,23 @@ let s:source_user = {
30 30
       \ 'description' : 'neosnippet user file',
31 31
       \ 'action_table' : copy(s:action_table),
32 32
       \ }
33
-function! s:source_user.gather_candidates(args, context) abort "{{{
33
+function! s:source_user.gather_candidates(args, context) abort
34 34
   return s:get_snippet_candidates(
35 35
         \ neosnippet#get_user_snippets_directory())
36
-endfunction "}}}
36
+endfunction
37 37
 
38 38
 let s:source_user.action_table.unite__new_candidate = {
39 39
       \ 'description' : 'create new user snippet',
40 40
       \ 'is_invalidate_cache' : 1,
41 41
       \ 'is_quit' : 1,
42 42
       \ }
43
-function! s:source_user.action_table.unite__new_candidate.func(candidate) abort "{{{
43
+function! s:source_user.action_table.unite__new_candidate.func(candidate) abort
44 44
   let filename = input(
45 45
         \ 'New snippet file name: ', neosnippet#helpers#get_filetype())
46 46
   if filename != ''
47 47
     call neosnippet#commands#_edit(filename)
48 48
   endif
49
-endfunction"}}}
49
+endfunction
50 50
 
51 51
 
52 52
 " neosnippet source.
@@ -55,26 +55,26 @@ let s:source_runtime = {
55 55
       \ 'description' : 'neosnippet runtime file',
56 56
       \ 'action_table' : copy(s:action_table),
57 57
       \ }
58
-function! s:source_runtime.gather_candidates(args, context) abort "{{{
58
+function! s:source_runtime.gather_candidates(args, context) abort
59 59
   return s:get_snippet_candidates(
60 60
         \ neosnippet#get_runtime_snippets_directory())
61
-endfunction "}}}
61
+endfunction
62 62
 
63 63
 let s:source_runtime.action_table.unite__new_candidate = {
64 64
       \ 'description' : 'create new runtime snippet',
65 65
       \ 'is_invalidate_cache' : 1,
66 66
       \ 'is_quit' : 1,
67 67
       \ }
68
-function! s:source_runtime.action_table.unite__new_candidate.func(candidate) abort "{{{
68
+function! s:source_runtime.action_table.unite__new_candidate.func(candidate) abort
69 69
   let filename = input(
70 70
         \ 'New snippet file name: ', neosnippet#helpers#get_filetype())
71 71
   if filename != ''
72 72
     call neosnippet#commands#_edit('-runtime ' . filename)
73 73
   endif
74
-endfunction"}}}
74
+endfunction
75 75
 
76 76
 
77
-function! s:get_snippet_candidates(dirs) abort "{{{
77
+function! s:get_snippet_candidates(dirs) abort
78 78
   let _ = []
79 79
   for directory in a:dirs
80 80
     let _ += map(split(unite#util#substitute_path_separator(
@@ -86,6 +86,4 @@ function! s:get_snippet_candidates(dirs) abort "{{{
86 86
   endfor
87 87
 
88 88
   return _
89
-endfunction "}}}
90
-
91
-" vim: foldmethod=marker
89
+endfunction

+ 6
- 9
plugin/neosnippet.vim View File

@@ -11,7 +11,7 @@ elseif v:version < 704
11 11
   finish
12 12
 endif
13 13
 
14
-" Plugin key-mappings. "{{{
14
+" Plugin key-mappings.
15 15
 inoremap <silent><expr> <Plug>(neosnippet_expand_or_jump)
16 16
       \ neosnippet#mappings#expand_or_jump_impl()
17 17
 inoremap <silent><expr> <Plug>(neosnippet_jump_or_expand)
@@ -39,13 +39,13 @@ xnoremap <silent> <Plug>(neosnippet_register_oneshot_snippet)
39 39
 
40 40
 inoremap <expr><silent> <Plug>(neosnippet_start_unite_snippet)
41 41
       \ unite#sources#neosnippet#start_complete()
42
-"}}}
43 42
 
44
-augroup neosnippet "{{{
43
+
44
+augroup neosnippet
45 45
   autocmd InsertEnter * call neosnippet#init#_initialize()
46
-augroup END"}}}
46
+augroup END
47 47
 
48
-" Commands. "{{{
48
+" Commands.
49 49
 command! -nargs=? -bar
50 50
       \ -complete=customlist,neosnippet#commands#_edit_complete
51 51
       \ NeoSnippetEdit
@@ -62,9 +62,6 @@ command! -nargs=1 -bar -complete=file
62 62
 
63 63
 command! -bar NeoSnippetClearMarkers
64 64
       \ call neosnippet#commands#_clear_markers()
65
-"}}}
66 65
 
67
-let g:loaded_neosnippet = 1
68 66
 
69
-" __END__
70
-" vim: foldmethod=marker
67
+let g:loaded_neosnippet = 1