2012-08-16 23:41:25 -04:00
|
|
|
# This file contains snippets that are always defined. I personally
|
|
|
|
# have snippets for signatures and often needed texts
|
|
|
|
|
2014-03-11 16:10:50 -04:00
|
|
|
# sligthly lower priority than everything else since specialized versions
|
|
|
|
# should overwrite. The user needs to adjust her priority in her snippets to
|
|
|
|
# ~-55 so that other filetypes will still overwrite.
|
|
|
|
priority -60
|
|
|
|
|
2012-08-16 23:41:25 -04:00
|
|
|
##############
|
|
|
|
# NICE BOXES #
|
|
|
|
##############
|
|
|
|
global !p
|
2015-12-08 08:20:04 -05:00
|
|
|
from vimsnippets import foldmarker, make_box, get_comment_format
|
2012-08-16 23:41:25 -04:00
|
|
|
endglobal
|
|
|
|
|
|
|
|
snippet box "A nice box with the current comment symbol" b
|
|
|
|
`!p
|
|
|
|
box = make_box(len(t[1]))
|
2015-01-18 07:58:28 -05:00
|
|
|
snip.rv = box[0]
|
|
|
|
snip += box[1]
|
2012-08-16 23:41:25 -04:00
|
|
|
`${1:content}`!p
|
|
|
|
box = make_box(len(t[1]))
|
2015-01-18 07:58:28 -05:00
|
|
|
snip.rv = box[2]
|
|
|
|
snip += box[3]`
|
2012-08-16 23:41:25 -04:00
|
|
|
$0
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet bbox "A nice box over the full width" b
|
|
|
|
`!p
|
2015-07-13 06:22:46 -04:00
|
|
|
if not snip.c:
|
|
|
|
width = int(vim.eval("&textwidth - (virtcol('.') == 1 ? 0 : virtcol('.'))")) or 71
|
2014-03-11 16:10:50 -04:00
|
|
|
box = make_box(len(t[1]), width)
|
2015-01-18 07:58:28 -05:00
|
|
|
snip.rv = box[0]
|
|
|
|
snip += box[1]
|
2012-08-16 23:41:25 -04:00
|
|
|
`${1:content}`!p
|
2014-03-11 16:10:50 -04:00
|
|
|
box = make_box(len(t[1]), width)
|
2015-01-18 07:58:28 -05:00
|
|
|
snip.rv = box[2]
|
|
|
|
snip += box[3]`
|
2012-08-16 23:41:25 -04:00
|
|
|
$0
|
|
|
|
endsnippet
|
|
|
|
|
2014-03-11 16:10:50 -04:00
|
|
|
snippet fold "Insert a vim fold marker" b
|
2015-12-08 08:20:04 -05:00
|
|
|
`!p snip.rv = get_comment_format()[0]` ${1:Fold description} `!p snip.rv = foldmarker()[0]`${2:1} `!p snip.rv = get_comment_format()[2]`
|
2014-03-11 16:10:50 -04:00
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet foldc "Insert a vim fold close marker" b
|
2015-12-08 08:20:04 -05:00
|
|
|
`!p snip.rv = get_comment_format()[0]` ${2:1}`!p snip.rv = foldmarker()[1]` `!p snip.rv = get_comment_format()[2]`
|
2014-03-11 16:10:50 -04:00
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet foldp "Insert a vim fold marker pair" b
|
2015-12-08 08:20:04 -05:00
|
|
|
`!p snip.rv = get_comment_format()[0]` ${1:Fold description} `!p snip.rv = foldmarker()[0]` `!p snip.rv = get_comment_format()[2]`
|
2014-03-11 16:10:50 -04:00
|
|
|
${2:${VISUAL:Content}}
|
2015-12-08 08:20:04 -05:00
|
|
|
`!p snip.rv = get_comment_format()[0]` `!p snip.rv = foldmarker()[1]` $1 `!p snip.rv = get_comment_format()[2]`
|
2014-03-11 16:10:50 -04:00
|
|
|
endsnippet
|
|
|
|
|
2012-08-16 23:41:25 -04:00
|
|
|
##########################
|
|
|
|
# LOREM IPSUM GENERATORS #
|
|
|
|
##########################
|
|
|
|
snippet lorem "Lorem Ipsum - 50 Words" b
|
|
|
|
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
|
|
|
|
tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At
|
|
|
|
vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,
|
|
|
|
no sea takimata sanctus est Lorem ipsum dolor sit amet.
|
|
|
|
endsnippet
|
|
|
|
|
2014-09-27 11:32:18 -04:00
|
|
|
##########################
|
|
|
|
# VIM MODELINE GENERATOR #
|
|
|
|
##########################
|
|
|
|
# See advice on `:help 'tabstop'` for why these values are set. Uses second
|
|
|
|
# modeline form ('set') to work in languages with comment terminators
|
|
|
|
# (/* like C */).
|
|
|
|
snippet modeline "Vim modeline"
|
|
|
|
vim`!v ':set '. (&expandtab ? printf('et sw=%i ts=%i', &sw, &ts) : printf('noet sts=%i sw=%i ts=%i', &sts, &sw, &ts)) . (&tw ? ' tw='. &tw : '') . ':'`
|
|
|
|
endsnippet
|
|
|
|
|
2016-10-02 07:37:21 -04:00
|
|
|
#########
|
|
|
|
# DATES #
|
|
|
|
#########
|
|
|
|
snippet date "YYYY-MM-DD" w
|
|
|
|
`date +%Y-%m-%d`
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet ddate "Month DD, YYYY" w
|
|
|
|
`date +%B\ %d,\ %Y`
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet diso "ISO format datetime" w
|
|
|
|
`date +%Y-%m-%dT%H:%M:%S%:z`
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet time "hh:mm" w
|
|
|
|
`date +%H:%M`
|
|
|
|
endsnippet
|
|
|
|
|
|
|
|
snippet datetime "YYYY-MM-DD hh:mm" w
|
|
|
|
`date +%Y-%m-%d\ %H:%M`
|
|
|
|
endsnippet
|
|
|
|
|
2012-08-16 23:41:25 -04:00
|
|
|
# vim:ft=snippets:
|