-
Notifications
You must be signed in to change notification settings - Fork 11
/
support_functions.vim
46 lines (34 loc) · 1002 Bytes
/
support_functions.vim
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"ruby {{{1
function! Snippet_RubyClassNameFromFilename()
let name = expand("%:t:r")
return NS_camelcase(name)
endfunction
function! Snippet_MigrationNameFromFilename()
let name = substitute(expand("%:t:r"), '^.\{-}_', '', '')
return NS_camelcase(name)
endfunction
"python {{{1
function! Snippet_PythonClassNameFromFilename()
let name = expand("%:t:r")
return NS_camelcase(name)
endfunction
"php {{{1
function! Snippet_PHPClassNameFromFilename()
return expand("%:t:r:r")
endfunction
"java {{{1
function! Snippet_JavaClassNameFromFilename()
return expand("%:t:r")
endfunction
"global {{{1
function! s:start_comment()
return substitute(&commentstring, '^\([^ ]*\)\s*%s\(.*\)$', '\1', '')
endfunction
function! s:end_comment()
return substitute(&commentstring, '^.*%s\(.*\)$', '\1', '')
endfunction
function! Snippet_Modeline()
return s:start_comment() . " vim: set <+settings+>:" . s:end_comment()
endfunction
" modeline {{{1
" vim: set fdm=marker: