diff --git a/autoload/neosnippet/snippets/coffee.snip b/autoload/neosnippet/snippets/coffee.snip index 57acffe..b1f5e59 100644 --- a/autoload/neosnippet/snippets/coffee.snip +++ b/autoload/neosnippet/snippets/coffee.snip @@ -64,7 +64,7 @@ snippet bfun snippet cla abbr cla -prev_word '^' +options head class ${1:ClassName}${2: extends ${3:Ancestor\}} constructor: (${4:args}) -> diff --git a/autoload/neosnippet/snippets/cpp.snip b/autoload/neosnippet/snippets/cpp.snip index 53d8256..a315d7b 100644 --- a/autoload/neosnippet/snippets/cpp.snip +++ b/autoload/neosnippet/snippets/cpp.snip @@ -43,7 +43,7 @@ abbr static_assert(,"") delete namespace snippet namespace abbr namespace {} -prev_word '^' +options head namespace ${1:name} ${0} } // namespace $1 diff --git a/autoload/neosnippet/snippets/python.snip b/autoload/neosnippet/snippets/python.snip index 2d7d6bf..0fc9698 100644 --- a/autoload/neosnippet/snippets/python.snip +++ b/autoload/neosnippet/snippets/python.snip @@ -1,13 +1,13 @@ snippet class abbr class Class(...): ... -prev_word '^' +options head class ${1:name}(${2:object}): def __init__(self, ${3}): ${0} snippet classd abbr class Class(...): "..." -prev_word '^' +options head class ${1:name}(${2:object}): """${3:class documentation}""" def __init__(self, ${4}): @@ -16,45 +16,45 @@ prev_word '^' snippet def abbr def function(...): ... -prev_word '^' +options head def ${1:name}(${2}): ${0} snippet defd abbr def function(...): """...""" -prev_word '^' +options head def ${1:name}(${2}): """${3:function documentation}""" ${0} snippet defm abbr def method(self, ...): ... -prev_word '^' +options head def ${1:name}(self, ${2}): ${0} snippet defmd abbr def method(self, ...): "..." -prev_word '^' +options head def ${1:name}(self, ${2}): """${3:method documentation}""" ${0} snippet elif abbr elif ...: ... -prev_word '^' +options head elif ${1:condition}: ${0} snippet else abbr else: ... -prev_word '^' +options head else: ${0} snippet fileidiom abbr f = None try: f = open(...) finally: ... -prev_word '^' +options head ${1:f} = None try: $1 = open(${2}) @@ -65,25 +65,25 @@ prev_word '^' snippet for abbr for ... in ...: ... -prev_word '^' +options head for ${1:value} in ${2:list}: ${0} snippet if abbr if ...: ... -prev_word '^' +options head if ${1:condition}: ${0} snippet ifmain abbr if __name__ == '__main__': ... -prev_word '^' +options head if __name__ == '__main__': ${0} snippet tryexcept abbr try: ... except ...: ... -prev_word '^' +options head try: ${1} except ${2:ExceptionClass}: @@ -91,7 +91,7 @@ prev_word '^' snippet tryfinally abbr try: ... finally: ... -prev_word '^' +options head try: ${1} finally: @@ -99,7 +99,7 @@ prev_word '^' snippet while abbr while ...: ... -prev_word '^' +options head while ${1:condition}: ${0} diff --git a/autoload/neosnippet/snippets/scala.snip b/autoload/neosnippet/snippets/scala.snip index 409bb9f..2a00959 100644 --- a/autoload/neosnippet/snippets/scala.snip +++ b/autoload/neosnippet/snippets/scala.snip @@ -6,7 +6,7 @@ abbr match {\n case .. => .. snippet try abbr try {} catch { case ... } -prev_word '^' +options head try { ${1} } catch { @@ -23,14 +23,14 @@ abbr println('name, name) snippet main abbr def main(args: Array[String]) { -prev_word '^' +options head def main(args: Array[String]) { ${0} } snippet hello abbr object HelloWorld { def main(...) } -prev_word '^' +options head object HelloWorld { def main(args: Array[String]) { println("Hello, world!") diff --git a/autoload/neosnippet/snippets/snippet.snip b/autoload/neosnippet/snippets/snippet.snip index e900e0f..cb9b6fa 100644 --- a/autoload/neosnippet/snippets/snippet.snip +++ b/autoload/neosnippet/snippets/snippet.snip @@ -1,8 +1,8 @@ snippet snippet -abbr snippet abbr prev_word +abbr snippet abbr options alias snip -prev_word '^' +options head snippet ${1:trigger} abbr ${2:abbr} - prev_word '^' + options head ${3:snippet code} diff --git a/autoload/neosnippet/snippets/vim/vital.snip b/autoload/neosnippet/snippets/vim/vital.snip index 0ee6771..f9cce4b 100644 --- a/autoload/neosnippet/snippets/vim/vital.snip +++ b/autoload/neosnippet/snippets/vim/vital.snip @@ -12,7 +12,7 @@ abbr import snippet vital_import abbr let s:M = s:V.import('...') -prev_word '^' +options head let ${1:s:M} = ${2:s:V}.import('${3:Module}') snippet vital_load_without_call diff --git a/autoload/unite/sources/snippet.vim b/autoload/unite/sources/snippet.vim index 911f034..fe17648 100644 --- a/autoload/unite/sources/snippet.vim +++ b/autoload/unite/sources/snippet.vim @@ -1,7 +1,7 @@ "============================================================================= " FILE: snippet.vim " AUTHOR: Shougo Matsushita -" Last Modified: 18 Oct 2012. +" Last Modified: 21 Oct 2012. " License: MIT license {{{ " Permission is hereby granted, free of charge, to any person obtaining " a copy of this software and associated documentation files (the @@ -136,8 +136,12 @@ function! s:action_table.unite__new_candidate.func(candidate)"{{{ call append('$', '') endif - call append('$', ['snippet ' . trigger, 'abbr ' . trigger, - \ "prev_word '^'", ' ']) + call append('$', [ + \ 'snippet ' . trigger, + \ 'abbr ' . trigger, + \ 'options head', + \ ' ' + \ ]) call cursor(line('$'), 0) call cursor(0, col('$')) diff --git a/doc/neosnippet.txt b/doc/neosnippet.txt index 0eafa6c..04ae305 100644 --- a/doc/neosnippet.txt +++ b/doc/neosnippet.txt @@ -458,6 +458,7 @@ CHANGELOG *neosnippet-changelog* - Added options head. - Added options word. - Improved options word behavior. +- Use head instead of prev_word. 2012-10-20 - Improved scala snip. diff --git a/indent/snippet.vim b/indent/snippet.vim index cba235a..ae7df7a 100644 --- a/indent/snippet.vim +++ b/indent/snippet.vim @@ -1,7 +1,7 @@ "============================================================================= " FILE: snippets.vim " AUTHOR: Shougo Matsushita -" Last Modified: 19 Sep 2011. +" Last Modified: 21 Oct 2012. " License: MIT license {{{ " Permission is hereby granted, free of charge, to any person obtaining " a copy of this software and associated documentation files (the @@ -45,8 +45,8 @@ function! SnippetsIndent()"{{{ if prev_line =~ '^\s*$' return 0 - elseif prev_line =~ '^\%(include\|snippet\|abbr\|prev_word\|rank\|delete\|alias\|condition\)' - \&& line !~ '^\s*\%(include\|snippet\|abbr\|prev_word\|rank\|delete\|alias\|condition\)' + elseif prev_line =~ '^\%(include\|snippet\|abbr\|prev_word\|delete\|alias\|options\)' + \&& line !~ '^\s*\%(include\|snippet\|abbr\|prev_word\|delete\|alias\|options\)' return &shiftwidth else return match(line, '\S')