Add generic TODO snippet using commentstring
This commit is contained in:
parent
437476694c
commit
9ff37a4055
@ -1,3 +1,22 @@
|
|||||||
snippet tab "Insert tab literal"
|
snippet tab "Insert tab literal"
|
||||||
$0
|
$0
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
|
global !p
|
||||||
|
comment=vim.current.buffer.options['commentstring'].strip()
|
||||||
|
def commentbefore():
|
||||||
|
return comment[0:comment.find('%s')].strip() + ' '
|
||||||
|
def commentafter():
|
||||||
|
after=comment[comment.find('%s')+2:].strip()
|
||||||
|
if 0 < len(after):
|
||||||
|
return ' ' + after
|
||||||
|
return ''
|
||||||
|
endglobal
|
||||||
|
|
||||||
|
snippet todo "TODO commment"
|
||||||
|
`!p snip.rv=commentbefore()`TODO$1: $0`!p snip.rv=commentafter()`
|
||||||
|
endsnippet
|
||||||
|
|
||||||
|
snippet note "NOTE comment"
|
||||||
|
`!p snip.rv=commentbefore()`NOTE: $0`!p snip.rv=commentafter()`
|
||||||
|
endsnippet
|
||||||
|
@ -155,26 +155,6 @@ int main(int argc, char **argv) {
|
|||||||
}
|
}
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
# TODO: Should this be in all.snippets?
|
|
||||||
# 1. Take the form '<comment> TODO: issue ${1:id} $0'
|
|
||||||
snippet todo "Todo comment"
|
|
||||||
// TODO$1: $0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
# TODO: Should this be in all.snippets?
|
|
||||||
# 1. Take the form '<comment> NOTE: issue ${1:id} $0'
|
|
||||||
snippet note "Note comment"
|
|
||||||
// NOTE$1: $0
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet in "Doxygen [in]" i
|
|
||||||
[in]
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet out "Doxygen [out]" i
|
|
||||||
[out]
|
|
||||||
endsnippet
|
|
||||||
|
|
||||||
snippet @param "Doxygen param tag"
|
snippet @param "Doxygen param tag"
|
||||||
@param[$1`!p snip.rv = complete(t[1], ['in', 'out'])`]
|
@param[$1`!p snip.rv = complete(t[1], ['in', 'out'])`]
|
||||||
endsnippet
|
endsnippet
|
||||||
|
@ -814,7 +814,3 @@ while(${1:condition})
|
|||||||
$0
|
$0
|
||||||
endwhile()
|
endwhile()
|
||||||
endsnippet
|
endsnippet
|
||||||
|
|
||||||
snippet todo "TODO"
|
|
||||||
# TODO$1: $0
|
|
||||||
endsnippet
|
|
||||||
|
@ -12,3 +12,5 @@
|
|||||||
"
|
"
|
||||||
" setlocal foldmethod=syntax
|
" setlocal foldmethod=syntax
|
||||||
setlocal foldmethod=indent
|
setlocal foldmethod=indent
|
||||||
|
" Set comment string
|
||||||
|
setlocal commentstring=#%s
|
||||||
|
Loading…
x
Reference in New Issue
Block a user