vim/UltiSnips/all.snippets

44 lines
998 B
Plaintext

snippet me "Identify me"
Kenneth Benzie (Benie) <k.benzie83@gmail.com>
endsnippet
global !p
comment=vim.current.buffer.options['commentstring'].strip()
def commentbefore():
commentbefore = comment[0:comment.find('%s')].strip()
row, col = vim.current.window.cursor
row -= 1
col -= 1
line = vim.current.buffer[row]
if (col - 1) >= 0 and commentbefore == line[col - 1:len(commentbefore)]:
return ''
return commentbefore + ' '
def commentafter():
after=comment[comment.find('%s')+2:].strip()
if 0 < len(after):
return ' ' + after
return ''
import datetime
def date():
return datetime.datetime.now().strftime('%B %d, %Y')
endglobal
snippet date "Today's date"
`!p snip.rv=date()`
endsnippet
snippet todo "TODO commment"
`!p snip.rv=commentbefore()`TODO${1/.+/(/}$1${1/.+/)/}: $0`!p snip.rv=commentafter()`
endsnippet
snippet note "NOTE comment"
`!p snip.rv=commentbefore()`NOTE: $0`!p snip.rv=commentafter()`
endsnippet
snippet *x "GitHub style checkbox"
* [${1:x}] $0
endsnippet