diff --git a/UltiSnips/all.snippets b/UltiSnips/all.snippets index 532010e..f816ba4 100644 --- a/UltiSnips/all.snippets +++ b/UltiSnips/all.snippets @@ -120,4 +120,14 @@ 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 +########################## +# 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 + # vim:ft=snippets: diff --git a/UltiSnips/help.snippets b/UltiSnips/help.snippets index 6132738..b07a7de 100644 --- a/UltiSnips/help.snippets +++ b/UltiSnips/help.snippets @@ -29,4 +29,9 @@ ${1:SubSubsection}:`!p snip.rv = sec_title(snip, t)` $0 endsnippet +# For vim help, follow the same settings as the official docs. +snippet modeline "Vim help modeline" + `!v 'vim'`:tw=78:ts=8:ft=help:norl: +endsnippet + # vim:ft=snippets: