- Merged.

This commit is contained in:
Shougo Matsushita 2012-10-21 18:03:39 +09:00
commit deaa1469f5
4 changed files with 78 additions and 16 deletions

View File

@ -0,0 +1,22 @@
snippet import
abbr import qualified ... as ...
import qualified ${1} as ${2}
snippet importOnly
abbr import ... (...)
import ${1} (${2})
snippet language
abbr {-# LANGUAGE ... #-}
{-# LANGUAGE ${1} #-}
# hard-tab is necessary
snippet case
abbr case ... of
case ${1} of
${2} -> ${0}
snippet main
abbr main = do
main = do
${0}

View File

@ -15,13 +15,11 @@ prev_word '^'
snippet p snippet p
abbr println() abbr println()
prev_word '^' println(${1})
println(${1})${0}
snippet pn snippet pn
abbr println('name, name) abbr println('name, name)
prev_word '^' println('${1:name}, $1)
println('${1:name}, $1)${0}
snippet main snippet main
abbr def main(args: Array[String]) { abbr def main(args: Array[String]) {
@ -32,6 +30,7 @@ prev_word '^'
snippet hello snippet hello
abbr object HelloWorld { def main(...) } abbr object HelloWorld { def main(...) }
prev_word '^'
object HelloWorld { object HelloWorld {
def main(args: Array[String]) { def main(args: Array[String]) {
println("Hello, world!") println("Hello, world!")

View File

@ -0,0 +1,33 @@
snippet vital_of_without_let
abbr vital#of('...')
vital#of('${1:vital}')
snippet vital_of
abbr let s:V = vital#of('...')
let ${1:s:V} = vital#of('${2:vital}')
snippet vital_import_without_let
abbr import
${1:s:V}.import('${2:Module}')
snippet vital_import
abbr let s:M = s:V.import('...')
prev_word '^'
let ${1:s:M} = ${2:s:V}.import('${3:Module}')
snippet vital_load_without_call
abbr s:V.load('...')
${1:s:V}.load('${2:Module}')
snippet vital_load
abbr call s:V.load('...')
call ${1:s:V}.load('${2:Module}')
# FAQ
# Q. Why does this snip file has verbose prefix "vital_" for everything?
# A. Because it's vital.vim specific but this snip is available in any vim
# filetype buffers.
#
# Q. Why didn't provide X/X_with_Y instead of X_without_Y/X?
# A. To show what is encouraged. Programmers usually assume that they should
# always use shorter name of functions, so this snip followed the convention.

View File

@ -366,40 +366,43 @@ Note: To contain "}" character in default value, you must escape "}".
snippet test snippet test
${1:escape \} value} ${1:escape \} value}
< <
'_' (global) snippet feature is supported. '_' snippet is loaded in all '_' (global) snippet feature is available. Neosnippet loads '_' snippet for
filetypes. And neosnippet can load snipMate snippets. all filetypes.
Alias feature is supported. Separator is ' ' or ','. Neosnippet can load snipMate snippets as well.
Alias feature is available. The separator is either ' ' or ','.
> >
alias hoge hogera hogehoge alias hoge hogera hogehoge
< <
Synchronized placeholder feature is supported. $1 is synchronized to ${1}. Synchronized placeholder feature is supported. $1 is synchronized to ${1}.
When you jump next, it is synchlonized. $0 is last jump placeholder. When you jump next, it will be synchronized. $0 will be the final jump
placeholder.
The placeholder value can't contain new lines. Below snippet is illegal: The placeholder value can't contain new lines. The snippet below isn't valid:
> >
snippet test snippet test
${1:constructor: (${2:args\}) -> ${1:constructor: (${2:args\}) ->
${3:# do smth}} ${3:# do smth}}
< <
Multi snippet feature is supported in snipMate. Multi snippet feature in snipMate is available.
neosnippet substitutes trigger and descriptions spaces to '_'. Neosnippet substitutes trigger and descriptions spaces to '_'.
> >
snippet trigger description1 snippet trigger description1
hoge hoge
snippet trigger description2 snippet trigger description2
piyo piyo
< <
You choose snippet <C-n> or <C-p> and expand it with Choose snippets using <C-n> or <C-p> and expand it with
|<Plug>(neosnippet_expand_or_jump)| key-mappings. |<Plug>(neosnippet_expand_or_jump)| key-mappings.
Nested placeholder feature is supported. Nested placeholder feature is available, But you must escape inner "}". "\" is
But must escape inner "}". "\" is eacape sequence. the eacape sequence.
> >
snippet div snippet div
<div ${1:id="${2:someid\}"}>${3}</div>${4} <div ${1:id="${2:someid\}"}>${3}</div>${4}
< <
In following snippet, you must escape "}" twice. You must escape "}" twice in following case.
> >
snippet catch snippet catch
options head options head
@ -409,7 +412,7 @@ Because ${1:} substitutes the pattern to "/${2:pattern: empty, E484,
Vim(cmdname):{errmsg\}}" and ${2:} substitutes the pattern to "pattern: Vim(cmdname):{errmsg\}}" and ${2:} substitutes the pattern to "pattern:
empty, E484, Vim(cmdname):{errmsg}" empty, E484, Vim(cmdname):{errmsg}"
If you use hard tab for indentation in snippet file, neosnippet will use If you use hard-tab for indentation in snippet file, neosnippet will use
'shiftwidth' instead of Vim indent plugin. This feature is useful while some 'shiftwidth' instead of Vim indent plugin. This feature is useful while some
languages' indent files can not work very well (e.g.: PHP, Python). languages' indent files can not work very well (e.g.: PHP, Python).
> >
@ -455,6 +458,11 @@ CHANGELOG *neosnippet-changelog*
- Added options head. - Added options head.
- Added options word. - Added options word.
2012-10-20
- Improved scala snip.
- Added haskell snip.
- Added vim/vital snip.
2012-10-19 2012-10-19
- Fixed syntax highlight. - Fixed syntax highlight.
- Improved documentation. - Improved documentation.