From fe46dfbbe6464506edd92e1eaf841183e7ba4ae4 Mon Sep 17 00:00:00 2001 From: amix Date: Sat, 11 Feb 2017 14:01:38 +0100 Subject: [PATCH] Updated plugins --- .../ctrlp.vim/autoload/ctrlp.vim | 12 +- .../ctrlp.vim/autoload/ctrlp/tag.vim | 4 +- sources_non_forked/ctrlp.vim/doc/ctrlp.txt | 4 + sources_non_forked/goyo.vim/autoload/goyo.vim | 4 +- .../nerdtree/lib/nerdtree/path.vim | 4 +- .../syntastic/doc/syntastic-checkers.txt | 2 +- .../syntastic/plugin/syntastic.vim | 18 +- .../erlang/erlang_check_file.erl | 213 +++- .../syntastic/syntax_checkers/haxe/haxe.vim | 7 +- .../syntax_checkers/javascript/flow.vim | 6 +- .../syntastic/syntax_checkers/vala/valac.vim | 54 +- .../vim-coffee-script/after/indent/html.vim | 2 +- .../vim-coffee-script/after/syntax/html.vim | 2 +- .../vim-coffee-script/test/test.html | 10 + .../vim-fugitive/plugin/fugitive.vim | 12 +- sources_non_forked/vim-go/.gitignore | 4 + sources_non_forked/vim-go/.travis.yml | 22 + sources_non_forked/vim-go/CHANGELOG.md | 46 +- sources_non_forked/vim-go/Makefile | 7 + sources_non_forked/vim-go/README.md | 49 +- sources_non_forked/vim-go/Rakefile | 13 - .../vim-go/autoload/go/asmfmt.vim | 2 +- sources_non_forked/vim-go/autoload/go/cmd.vim | 7 +- .../vim-go/autoload/go/complete.vim | 12 +- .../vim-go/autoload/go/coverage.vim | 2 +- sources_non_forked/vim-go/autoload/go/def.vim | 13 +- .../vim-go/autoload/go/def_test.vim | 32 + sources_non_forked/vim-go/autoload/go/doc.vim | 14 +- sources_non_forked/vim-go/autoload/go/fmt.vim | 283 ++--- .../vim-go/autoload/go/fmt_test.vim | 31 + .../vim-go/autoload/go/guru.vim | 16 +- .../vim-go/autoload/go/jobcontrol.vim | 44 +- .../vim-go/autoload/go/lint.vim | 31 +- .../vim-go/autoload/go/path.vim | 3 + .../vim-go/autoload/go/rename.vim | 4 +- .../autoload/go/test-fixtures/def/jump.go | 7 + .../autoload/go/test-fixtures/fmt/hello.go | 7 + .../go/test-fixtures/fmt/hello_golden.go | 7 + .../vim-go/autoload/go/textobj.vim | 4 +- .../vim-go/autoload/go/util.vim | 13 + sources_non_forked/vim-go/doc/vim-go.txt | 3 +- .../vim-go/gosnippets/UltiSnips/go.snippets | 8 + .../vim-go/gosnippets/snippets/go.snip | 7 + sources_non_forked/vim-go/plugin/go.vim | 2 +- sources_non_forked/vim-go/scripts/runtest.vim | 81 ++ sources_non_forked/vim-go/scripts/test.sh | 86 +- sources_non_forked/vim-go/syntax/go.vim | 14 +- sources_non_forked/vim-go/t/coverlay.vim | 191 ---- .../vim-go/t/fixtures/src/buildfail/sample.go | 13 - .../t/fixtures/src/buildfail/sample_test.go | 7 - .../t/fixtures/src/buildtestfail/sample.go | 7 - .../fixtures/src/buildtestfail/sample_test.go | 15 - .../vim-go/t/fixtures/src/failtest/sample.go | 12 - .../t/fixtures/src/failtest/sample_test.go | 8 - .../vim-go/t/fixtures/src/parsefail/sample.go | 14 - .../t/fixtures/src/parsefail/sample_test.go | 7 - .../vim-go/t/fixtures/src/pkg1/sample.go | 12 - .../vim-go/t/fixtures/src/pkg1/sample.out | 6 - .../vim-go/t/fixtures/src/pkg1/sample_test.go | 7 - sources_non_forked/vim-pug/README.markdown | 2 + sources_non_forked/vim-pug/syntax/pug.vim | 5 +- sources_non_forked/vim-snippets/README.md | 6 +- .../vim-snippets/UltiSnips/all.snippets | 10 +- .../vim-snippets/UltiSnips/c.snippets | 20 +- .../UltiSnips/coffee-react.snippets | 24 +- .../vim-snippets/UltiSnips/cpp.snippets | 4 +- .../vim-snippets/UltiSnips/crystal.snippets | 13 + .../vim-snippets/UltiSnips/cs.snippets | 2 +- .../vim-snippets/UltiSnips/css.snippets | 6 - .../vim-snippets/UltiSnips/d.snippets | 110 +- .../vim-snippets/UltiSnips/django.snippets | 36 +- .../vim-snippets/UltiSnips/eruby.snippets | 14 +- .../vim-snippets/UltiSnips/go.snippets | 2 +- .../vim-snippets/UltiSnips/html.snippets | 98 +- .../UltiSnips/html_minimal.snippets | 12 +- .../UltiSnips/htmldjango.snippets | 112 +- .../vim-snippets/UltiSnips/java.snippets | 6 +- .../UltiSnips/javascript-angular.snippets | 14 +- .../UltiSnips/javascript-node.snippets | 24 +- .../UltiSnips/javascript-openui5.snippets | 272 ++--- .../UltiSnips/javascript.snippets | 88 +- .../UltiSnips/php-laravel.snippets | 18 +- .../UltiSnips/php-phpspec.snippets | 28 +- .../UltiSnips/php-symfony2.snippets | 48 +- .../vim-snippets/UltiSnips/php.snippets | 2 +- .../vim-snippets/UltiSnips/proto.snippets | 6 +- .../vim-snippets/UltiSnips/puppet.snippets | 50 +- .../vim-snippets/UltiSnips/python.snippets | 2 +- .../vim-snippets/UltiSnips/r.snippets | 32 +- .../vim-snippets/UltiSnips/rails.snippets | 36 +- .../vim-snippets/UltiSnips/rst.snippets | 20 +- .../vim-snippets/UltiSnips/rust.snippets | 40 +- .../UltiSnips/supercollider.snippets | 2 +- .../vim-snippets/UltiSnips/tcl.snippets | 14 +- .../vim-snippets/UltiSnips/tex.snippets | 18 +- .../vim-snippets/UltiSnips/vim.snippets | 4 +- .../snippets/actionscript.snippets | 6 +- .../vim-snippets/snippets/ada.snippets | 10 +- .../vim-snippets/snippets/apache.snippets | 8 +- .../vim-snippets/snippets/arduino.snippets | 2 +- .../vim-snippets/snippets/awk.snippets | 4 +- .../vim-snippets/snippets/c.snippets | 14 +- .../snippets/coffee/coffee.snippets | 8 +- .../vim-snippets/snippets/crystal.snippets | 82 ++ .../vim-snippets/snippets/cs.snippets | 14 +- .../vim-snippets/snippets/css.snippets | 10 +- .../vim-snippets/snippets/d.snippets | 6 +- .../vim-snippets/snippets/dart.snippets | 4 +- .../vim-snippets/snippets/eelixir.snippets | 4 +- .../vim-snippets/snippets/elixir.snippets | 14 +- .../vim-snippets/snippets/elm.snippets | 2 +- .../vim-snippets/snippets/erlang.snippets | 2 +- .../vim-snippets/snippets/eruby.snippets | 2 +- .../vim-snippets/snippets/go.snippets | 27 +- .../vim-snippets/snippets/haml.snippets | 4 +- .../vim-snippets/snippets/handlebars.snippets | 6 +- .../vim-snippets/snippets/html.snippets | 4 +- .../snippets/htmltornado.snippets | 2 +- .../vim-snippets/snippets/java.snippets | 4 +- .../snippets/javascript-mocha.snippets | 34 +- .../snippets/javascript.es6.react.snippets | 2 +- .../javascript/javascript.es6.snippets | 16 +- .../snippets/javascript/javascript.snippets | 127 +-- .../vim-snippets/snippets/julia.snippets | 2 +- .../vim-snippets/snippets/ls.snippets | 2 +- .../vim-snippets/snippets/make.snippets | 8 +- .../vim-snippets/snippets/mako.snippets | 2 +- .../vim-snippets/snippets/mustache.snippets | 6 +- .../vim-snippets/snippets/php.snippets | 123 ++- .../vim-snippets/snippets/processing.snippets | 4 +- .../vim-snippets/snippets/python.snippets | 26 +- .../vim-snippets/snippets/rst.snippets | 4 +- .../vim-snippets/snippets/ruby.snippets | 14 +- .../vim-snippets/snippets/rust.snippets | 14 +- .../vim-snippets/snippets/sass.snippets | 993 +++++++++++++++++- .../vim-snippets/snippets/scala.snippets | 16 +- .../vim-snippets/snippets/sh.snippets | 12 +- .../vim-snippets/snippets/tex.snippets | 11 +- .../vim-snippets/snippets/twig.snippets | 8 +- .../vim-snippets/snippets/vim.snippets | 10 +- .../vim-snippets/snippets/zsh.snippets | 20 +- 141 files changed, 2790 insertions(+), 1630 deletions(-) create mode 100644 sources_non_forked/vim-go/.travis.yml create mode 100644 sources_non_forked/vim-go/Makefile delete mode 100644 sources_non_forked/vim-go/Rakefile create mode 100644 sources_non_forked/vim-go/autoload/go/def_test.vim create mode 100644 sources_non_forked/vim-go/autoload/go/fmt_test.vim create mode 100644 sources_non_forked/vim-go/autoload/go/test-fixtures/def/jump.go create mode 100644 sources_non_forked/vim-go/autoload/go/test-fixtures/fmt/hello.go create mode 100644 sources_non_forked/vim-go/autoload/go/test-fixtures/fmt/hello_golden.go create mode 100644 sources_non_forked/vim-go/scripts/runtest.vim delete mode 100644 sources_non_forked/vim-go/t/coverlay.vim delete mode 100644 sources_non_forked/vim-go/t/fixtures/src/buildfail/sample.go delete mode 100644 sources_non_forked/vim-go/t/fixtures/src/buildfail/sample_test.go delete mode 100644 sources_non_forked/vim-go/t/fixtures/src/buildtestfail/sample.go delete mode 100644 sources_non_forked/vim-go/t/fixtures/src/buildtestfail/sample_test.go delete mode 100644 sources_non_forked/vim-go/t/fixtures/src/failtest/sample.go delete mode 100644 sources_non_forked/vim-go/t/fixtures/src/failtest/sample_test.go delete mode 100644 sources_non_forked/vim-go/t/fixtures/src/parsefail/sample.go delete mode 100644 sources_non_forked/vim-go/t/fixtures/src/parsefail/sample_test.go delete mode 100644 sources_non_forked/vim-go/t/fixtures/src/pkg1/sample.go delete mode 100644 sources_non_forked/vim-go/t/fixtures/src/pkg1/sample.out delete mode 100644 sources_non_forked/vim-go/t/fixtures/src/pkg1/sample_test.go create mode 100644 sources_non_forked/vim-snippets/UltiSnips/crystal.snippets create mode 100644 sources_non_forked/vim-snippets/snippets/crystal.snippets diff --git a/sources_non_forked/ctrlp.vim/autoload/ctrlp.vim b/sources_non_forked/ctrlp.vim/autoload/ctrlp.vim index fc8b8830..65589393 100644 --- a/sources_non_forked/ctrlp.vim/autoload/ctrlp.vim +++ b/sources_non_forked/ctrlp.vim/autoload/ctrlp.vim @@ -303,7 +303,6 @@ fu! s:match_window_opts() let s:mw_res = \ s:mw =~ 'results:[^,]\+' ? str2nr(matchstr(s:mw, 'results:\zs\d\+')) \ : min([s:mw_max, &lines]) - let s:mw_res = max([s:mw_res, 1]) endf "}}}1 " * Open & Close {{{1 @@ -1995,9 +1994,14 @@ fu! s:bufnrfilpath(line) en let filpath = fnamemodify(filpath, ':p') let bufnr = bufnr('^'.filpath.'$') - if (a:line =~ '[\/]\?\[\d\+\*No Name\]$' && !filereadable(filpath) && bufnr < 1) - let bufnr = str2nr(matchstr(a:line, '[\/]\?\[\zs\d\+\ze\*No Name\]$')) - let filpath = bufnr + if (!filereadable(filpath) && bufnr < 1) + if (a:line =~ '[\/]\?\[\d\+\*No Name\]$') + let bufnr = str2nr(matchstr(a:line, '[\/]\?\[\zs\d\+\ze\*No Name\]$')) + let filpath = bufnr + else + let bufnr = bufnr(a:line) + retu [bufnr, a:line] + en en retu [bufnr, filpath] endf diff --git a/sources_non_forked/ctrlp.vim/autoload/ctrlp/tag.vim b/sources_non_forked/ctrlp.vim/autoload/ctrlp/tag.vim index 31504dcc..c2294805 100644 --- a/sources_non_forked/ctrlp.vim/autoload/ctrlp/tag.vim +++ b/sources_non_forked/ctrlp.vim/autoload/ctrlp/tag.vim @@ -137,8 +137,8 @@ fu! ctrlp#tag#id() endf fu! ctrlp#tag#enter() - let tfs = tagfiles() - let s:tagfiles = tfs != [] ? filter(map(tfs, 'fnamemodify(v:val, ":p")'), + let tfs = get(g:, 'ctrlp_custom_tag_files', tagfiles()) + let s:tagfiles = type(tfs) == 3 && tfs != [] ? filter(map(tfs, 'fnamemodify(v:val, ":p")'), \ 'filereadable(v:val)') : [] endf "}}} diff --git a/sources_non_forked/ctrlp.vim/doc/ctrlp.txt b/sources_non_forked/ctrlp.vim/doc/ctrlp.txt index 1107497b..f703ba4f 100644 --- a/sources_non_forked/ctrlp.vim/doc/ctrlp.txt +++ b/sources_non_forked/ctrlp.vim/doc/ctrlp.txt @@ -148,6 +148,7 @@ The minimum and maximum heights: The maximum number of results: results:{n} - list maximum {n} results (default: sync with max height). + 0 mean no-limit. Note: When a setting isn't set, its default value will be used. @@ -1497,6 +1498,9 @@ Special thanks:~ =============================================================================== CHANGELOG *ctrlp-changelog* + * New option |g:ctrlp_custom_tag_files| to specify custom tag files. + * Accept 0 for g:ctrlp_match_window no-limited window size. + Before 2016/11/28~ + New command: |YankLine()| to yank current line. diff --git a/sources_non_forked/goyo.vim/autoload/goyo.vim b/sources_non_forked/goyo.vim/autoload/goyo.vim index 3e014667..735c950a 100644 --- a/sources_non_forked/goyo.vim/autoload/goyo.vim +++ b/sources_non_forked/goyo.vim/autoload/goyo.vim @@ -122,7 +122,7 @@ function! s:tranquilize() endfunction function! s:hide_statusline() - let &l:statusline = repeat(' ', winwidth(0)) + setlocal statusline=\ endfunction function! s:hide_linenr() @@ -239,7 +239,7 @@ function! s:goyo_on(dim) set showtabline=0 set noruler set fillchars+=vert:\ - set fillchars+=stl:. + set fillchars+=stl:\ set fillchars+=stlnc:\ set sidescroll=1 set sidescrolloff=0 diff --git a/sources_non_forked/nerdtree/lib/nerdtree/path.vim b/sources_non_forked/nerdtree/lib/nerdtree/path.vim index 5f3b16ad..26db4a31 100644 --- a/sources_non_forked/nerdtree/lib/nerdtree/path.vim +++ b/sources_non_forked/nerdtree/lib/nerdtree/path.vim @@ -301,10 +301,10 @@ endfunction "FUNCTION: Path._escChars() {{{1 function! s:Path._escChars() if nerdtree#runningWindows() - return " `\|\"#%&,?()\*^<>" + return " `\|\"#%&,?()\*^<>$" endif - return " \\`\|\"#%&,?()\*^<>[]" + return " \\`\|\"#%&,?()\*^<>[]$" endfunction "FUNCTION: Path.getDir() {{{1 diff --git a/sources_non_forked/syntastic/doc/syntastic-checkers.txt b/sources_non_forked/syntastic/doc/syntastic-checkers.txt index d8fb584d..48536491 100644 --- a/sources_non_forked/syntastic/doc/syntastic-checkers.txt +++ b/sources_non_forked/syntastic/doc/syntastic-checkers.txt @@ -3226,7 +3226,7 @@ accepts the standard options described at |syntastic-config-makeprg|. Notes~ -Syntastic requires "Flow" version 0.18.1 or later. +Syntastic requires "Flow" version 0.34.0 or later. To use "Flow" with your projects, you must: diff --git a/sources_non_forked/syntastic/plugin/syntastic.vim b/sources_non_forked/syntastic/plugin/syntastic.vim index 2c8bdbad..4e65ea07 100644 --- a/sources_non_forked/syntastic/plugin/syntastic.vim +++ b/sources_non_forked/syntastic/plugin/syntastic.vim @@ -19,7 +19,7 @@ if has('reltime') lockvar! g:_SYNTASTIC_START endif -let g:_SYNTASTIC_VERSION = '3.8.0-10' +let g:_SYNTASTIC_VERSION = '3.8.0-21' lockvar g:_SYNTASTIC_VERSION " Sanity checks {{{1 @@ -67,6 +67,15 @@ else endif lockvar g:_SYNTASTIC_UNAME +" XXX Ugly hack to make g:_SYNTASTIC_UNAME available to :SyntasticInfo without +" polluting session namespaces +let g:syntastic_version = + \ g:_SYNTASTIC_VERSION . + \ ' (Vim ' . v:version . (has('nvim') ? ', Neovim' : '') . ', ' . + \ g:_SYNTASTIC_UNAME . + \ (has('gui') ? ', GUI' : '') . ')' +lockvar g:syntastic_version + " }}}1 " Defaults {{{1 @@ -344,13 +353,6 @@ function! s:BufWinEnterHook(fname) abort " {{{2 endfunction " }}}2 function! s:VimEnterHook() abort " {{{2 - let g:syntastic_version = - \ g:_SYNTASTIC_VERSION . - \ ' (Vim ' . v:version . (has('nvim') ? ', Neovim' : '') . ', ' . - \ g:_SYNTASTIC_UNAME . - \ (has('gui') ? ', GUI' : '') . ')' - lockvar g:syntastic_version - let buf = bufnr('') call syntastic#log#debug(g:_SYNTASTIC_DEBUG_AUTOCOMMANDS, \ 'autocmd: VimEnter, buffer ' . buf . ' = ' . string(bufname(buf)) . ', &buftype = ' . string(&buftype)) diff --git a/sources_non_forked/syntastic/syntax_checkers/erlang/erlang_check_file.erl b/sources_non_forked/syntastic/syntax_checkers/erlang/erlang_check_file.erl index 730e6005..89884345 100644 --- a/sources_non_forked/syntastic/syntax_checkers/erlang/erlang_check_file.erl +++ b/sources_non_forked/syntastic/syntax_checkers/erlang/erlang_check_file.erl @@ -13,28 +13,58 @@ main([File]) -> %% `rebar.config` is looked for, %% but it is not necessarily the one in the project root. %% I.e. it may be one deeper in the project file hierarchy. - RebarFile = rebar_file(Dir), - %% `rebar.config` might contain relative paths. - %% They are relative to the file! Not to the project root. - RebarOpts = rebar_opts(Dir ++ "/" ++ RebarFile), + Profile = which_compile_opts_profile(filename:absname(File)), + CompileOpts = case which_build_tool(Dir, Profile) of + {rebar, RebarFile} -> + %% `rebar.config` might contain relative paths. + %% They are relative to the file! Not to the project root. + %% rebar specific begin + rebar_opts(RebarFile); + %% rebar specific end + {erlangmk, ErlangMkDir} -> + %% Erlang.mk specific begin + erlangmk_opts(ErlangMkDir, Profile); + %% Erlang.mk specific end + undefined -> + fallback_opts() + end, code:add_patha(filename:absname("ebin")), %% `compile:file/2` requires the `{i, Path}` to be relative %% to CWD - no surprise here. - compile:file(File, Defs ++ translate_paths(Dir, RebarOpts)); + compile:file(File, Defs ++ translate_paths(Dir, CompileOpts)); main(_) -> io:format("Usage: ~s ~n", [escript:script_name()]), halt(1). -rebar_file(Dir) -> - DirList = filename:split(Dir), - case lists:last(DirList) of - "test" -> - "rebar.test.config"; - _ -> - "rebar.config" +which_compile_opts_profile(File) -> + case filename:basename(filename:dirname(File)) of + "test" -> test; + _ -> normal end. +which_build_tool(Dir, Profile) -> + %% rebar specific begin + RebarFile = rebar_file(Dir, Profile), + %% rebar specific end + case filelib:is_file(RebarFile) of + true -> + {rebar, RebarFile}; + false -> + %% Erlang.mk specific begin + ErlangMk = erlangmk_file(Dir), + %% Erlang.mk specific end + case filelib:is_file(ErlangMk) of + true -> {erlangmk, Dir}; + false -> undefined + end + end. + +rebar_file(Dir, normal) -> filename:join(Dir, "rebar.config"); +rebar_file(Dir, test) -> filename:join(Dir, "rebar.test.config"). + +erlangmk_file(Dir) -> filename:join(Dir, "erlang.mk"). + rebar_opts(RebarFile) -> Dir = get_root(filename:dirname(RebarFile)), case file:consult(RebarFile) of @@ -54,6 +84,165 @@ rebar_opts(RebarFile) -> rebar_opts("rebar.config") end. +erlangmk_opts(BaseDir, Profile) -> + Make = + case os:getenv("MAKE") of + false -> + case os:find_executable("gmake") of + false -> "make"; + Path -> Path + end; + Cmd -> + case (lists:member($/, Cmd) orelse lists:member($\\, Cmd)) of + true -> Cmd; + false -> os:find_executable(Cmd) + end + end, + ERLC_OPTS_Target = + case Profile of + normal -> "show-ERLC_OPTS"; + test -> "show-TEST_ERLC_OPTS" + end, + Args = [ + "--no-print-directory", + "-C", BaseDir, + "show-ERL_LIBS", + ERLC_OPTS_Target + ], + try + Port = erlang:open_port({spawn_executable, Make}, [ + {args, Args}, + exit_status, use_stdio, stderr_to_stdout]), + case erlangmk_port_receive_loop(Port, "", BaseDir) of + {error, _} -> + fallback_opts(); + {ok, {ErlLibs, ErlcOpts}} -> + [code:add_pathsa(filelib:wildcard( + filename:join([ErlLib, "*", "ebin"]))) + || ErlLib <- ErlLibs], + ErlcOpts + end + catch + error:_ -> + fallback_opts() + end. + +erlangmk_port_receive_loop(Port, Stdout, BaseDir) -> + receive + {Port, {exit_status, 0}} -> + erlangmk_format_opts(Stdout, BaseDir); + {Port, {exit_status, _}} -> + {error, {erlangmk, make_target_failure}}; + {Port, {data, Out}} -> + erlangmk_port_receive_loop(Port, Stdout ++ Out, BaseDir) + end. + +erlangmk_format_opts(Stdout, BaseDir) -> + case string:tokens(Stdout, "\n") of + [ErlLibsLine | ErlcOptsLines] -> + ErlLibs = erlangmk_format_erl_libs(ErlLibsLine), + ErlcOpts = erlangmk_format_erlc_opts(ErlcOptsLines, BaseDir), + {ok, {ErlLibs, ErlcOpts}}; + _ -> + {error, {erlangmk, incorrect_output}} + end. + +erlangmk_format_erl_libs(ErlLibsLine) -> + case os:type() of + {win32, _} -> string:tokens(ErlLibsLine, ";"); + _ -> string:tokens(ErlLibsLine, ":") + end. + +erlangmk_format_erlc_opts(ErlcOptsLines, BaseDir) -> + erlangmk_format_erlc_opts(ErlcOptsLines, [], BaseDir). + +erlangmk_format_erlc_opts(["+" ++ Option | Rest], Opts, BaseDir) -> + case make_term(Option) of + {error, _} -> erlangmk_format_erlc_opts(Rest, Opts, BaseDir); + Opt -> erlangmk_format_erlc_opts(Rest, [Opt | Opts], BaseDir) + end; +erlangmk_format_erlc_opts(["-I" ++ Opt | Rest], Opts, BaseDir) + when Opt =/= "" -> + erlangmk_format_erlc_opts(["-I", Opt | Rest], Opts, BaseDir); +erlangmk_format_erlc_opts(["-I", [C | _] = Dir | Rest], Opts, BaseDir) + when C =/= $- andalso C =/= $+ -> + AbsDir = filename:absname(Dir, BaseDir), + erlangmk_format_erlc_opts(Rest, [{i, AbsDir} | Opts], BaseDir); +erlangmk_format_erlc_opts(["-W" ++ Warn | Rest], Opts, BaseDir) + when Warn =/= "" -> + erlangmk_format_erlc_opts(["-W", Warn | Rest], Opts, BaseDir); +erlangmk_format_erlc_opts(["-W", Warn | Rest], Opts, BaseDir) -> + case Warn of + "all" -> + erlangmk_format_erlc_opts(Rest, [{warn_format, 999} | Opts], + BaseDir); + "error" -> + erlangmk_format_erlc_opts(Rest, [warnings_as_errors | Opts], + BaseDir); + "" -> + erlangmk_format_erlc_opts(Rest, [{warn_format, 1} | Opts], + BaseDir); + _ -> + try list_to_integer(Warn) of + Level -> + erlangmk_format_erlc_opts(Rest, + [{warn_format, Level} | Opts], BaseDir) + catch + error:badarg -> + erlangmk_format_erlc_opts(Rest, Opts, BaseDir) + end + end; +erlangmk_format_erlc_opts(["-D" ++ Opt | Rest], Opts, BaseDir) + when Opt =/= "" -> + erlangmk_format_erlc_opts(["-D", Opt | Rest], Opts, BaseDir); +erlangmk_format_erlc_opts(["-D", [C | _] = Val0 | Rest], Opts, BaseDir) + when C =/= $- andalso C =/= $+ -> + {Key0, Val1} = split_at_equals(Val0, []), + Key = list_to_atom(Key0), + case Val1 of + [] -> + erlangmk_format_erlc_opts(Rest, [{d, Key} | Opts], BaseDir); + Val2 -> + case make_term(Val2) of + {error, _} -> + erlangmk_format_erlc_opts(Rest, Opts, BaseDir); + Val -> + erlangmk_format_erlc_opts(Rest, [{d, Key, Val} | Opts], BaseDir) + end + end; +erlangmk_format_erlc_opts([PathFlag, [_ | _] = Dir | Rest], Opts, BaseDir) + when PathFlag =:= "-pa" orelse PathFlag =:= "-pz" -> + AbsDir = filename:absname(Dir, BaseDir), + case PathFlag of + "-pa" -> code:add_patha(AbsDir); + "-pz" -> code:add_pathz(AbsDir) + end, + erlangmk_format_erlc_opts(Rest, Opts, BaseDir); +erlangmk_format_erlc_opts([_ | Rest], Opts, BaseDir) -> + erlangmk_format_erlc_opts(Rest, Opts, BaseDir); +erlangmk_format_erlc_opts([], Opts, _) -> + lists:reverse(Opts). + +%% Function imported from erl_compile.erl from Erlang 19.1. +make_term(Str) -> + case erl_scan:string(Str) of + {ok, Tokens, _} -> + case erl_parse:parse_term(Tokens ++ [{dot, 1}]) of + {ok, Term} -> Term; + {error, Reason} -> {error, Reason} + end; + {error, Reason, _} -> + {error, Reason} + end. + +%% Function imported from erl_compile.erl from Erlang 19.1. +split_at_equals([$=|T], Acc) -> + {lists:reverse(Acc),T}; +split_at_equals([H|T], Acc) -> + split_at_equals(T, [H|Acc]); +split_at_equals([], Acc) -> + {lists:reverse(Acc),[]}. + fallback_opts() -> code:add_pathsa(filelib:wildcard("deps/*/ebin")), code:add_pathsa(nested_app_ebins()), diff --git a/sources_non_forked/syntastic/syntax_checkers/haxe/haxe.vim b/sources_non_forked/syntastic/syntax_checkers/haxe/haxe.vim index 789e9f3a..99ab4a17 100644 --- a/sources_non_forked/syntastic/syntax_checkers/haxe/haxe.vim +++ b/sources_non_forked/syntastic/syntax_checkers/haxe/haxe.vim @@ -32,9 +32,12 @@ function! SyntaxCheckers_haxe_haxe_GetLocList() dict if hxml !=# '' let makeprg = self.makeprgBuild({ - \ 'fname': syntastic#util#shescape(fnamemodify(hxml, ':t')) }) + \ 'fname': syntastic#util#shescape(fnamemodify(hxml, ':t')), + \ 'args_after' : ['--no-output'] }) - let errorformat = '%E%f:%l: characters %c-%n : %m' + let errorformat = + \ '%W%f:%l: characters %c-%n : Warning : %m,' . + \ '%E%f:%l: characters %c-%n : %m' let loclist = SyntasticMake({ \ 'makeprg': makeprg, diff --git a/sources_non_forked/syntastic/syntax_checkers/javascript/flow.vim b/sources_non_forked/syntastic/syntax_checkers/javascript/flow.vim index 02826548..456db2b2 100644 --- a/sources_non_forked/syntastic/syntax_checkers/javascript/flow.vim +++ b/sources_non_forked/syntastic/syntax_checkers/javascript/flow.vim @@ -25,7 +25,7 @@ function! SyntaxCheckers_javascript_flow_IsAvailable() dict if !executable(self.getExec()) return 0 endif - return syntastic#util#versionIsAtLeast(self.getVersion(self.getExecEscaped() . ' version'), [0, 18, 1]) + return syntastic#util#versionIsAtLeast(self.getVersion(self.getExecEscaped() . ' version'), [0, 34]) endfunction function! SyntaxCheckers_javascript_flow_GetLocList() dict @@ -34,8 +34,8 @@ function! SyntaxCheckers_javascript_flow_GetLocList() dict endif let makeprg = self.makeprgBuild({ - \ 'exe': self.getExecEscaped() . ' check', - \ 'args_after': '--show-all-errors --json' }) + \ 'exe': self.getExecEscaped() . ' status', + \ 'args_after': '--quiet --show-all-errors --json' }) let errorformat = \ '%f:%l:%c:%n: %m,' . diff --git a/sources_non_forked/syntastic/syntax_checkers/vala/valac.vim b/sources_non_forked/syntastic/syntax_checkers/vala/valac.vim index a60c2497..8b11d456 100644 --- a/sources_non_forked/syntastic/syntax_checkers/vala/valac.vim +++ b/sources_non_forked/syntastic/syntax_checkers/vala/valac.vim @@ -24,9 +24,12 @@ function! SyntaxCheckers_vala_valac_GetHighlightRegex(pos) " {{{1 endfunction " }}}1 function! SyntaxCheckers_vala_valac_GetLocList() dict " {{{1 - let vala_pkg_args = join(map(s:GetValaModules(), '"--pkg ".v:val'), ' ') - let vala_vapi_args = join(map(s:GetValaVapiDirs(), '"--vapidir ".v:val'), ' ') - let makeprg = self.makeprgBuild({ 'args': '-C ' . vala_pkg_args . ' ' . vala_vapi_args }) + let buf = bufnr('') + let makeprg = self.makeprgBuild({ + \ 'args': '-C ' . + \ s:GetValaOpts(buf, 'modules', 'modules', '--pkg') . ' ' . + \ s:GetValaOpts(buf, 'vapi_dirs', 'vapidirs', '--vapidir'), + \ }) let errorformat = \ '%A%f:%l.%c-%\d%\+.%\d%\+: %t%[a-z]%\+: %m,'. @@ -40,38 +43,27 @@ endfunction " }}}1 " Utilities {{{1 -function! s:GetValaModules() " {{{2 - if exists('g:syntastic_vala_modules') || exists('b:syntastic_vala_modules') - let modules = syntastic#util#var('vala_modules') - if type(modules) == type('') - return split(modules, '\m\s\+') - elseif type(modules) == type([]) - return copy(modules) +function! s:GetValaOpts(buf, name, comment, cmd) " {{{2 + let var = syntastic#util#var('vala_' . a:name) + if type(var) == type([]) + let opts = map(copy(var), 'syntastic#util#shescape(v:val)') + elseif type(var) == type('') + if var !=# '' + let opts = split(var, '\s\+') else - echoerr 'syntastic_vala_modules must be either list or string: fallback to in file modules string' + let opts = [] + for line in filter(getbufline(a:buf, 1, 100), 'v:val =~# ' . string('\m^//\s\+' . a:comment . ':\s*')) + call extend(opts, split( matchstr(line, '\m^//\s\+' . a:comment . ':\s*\zs.*'), '\s\+' )) + endfor + + call map( filter(opts, 'v:val !=# ""'), 'syntastic#util#shescape(v:val)' ) endif + else + call syntastic#log#error('syntastic_vala_' . a:name . ' must be either a list, or a string') + return '' endif - let modules_line = search('^// modules: ', 'n') - let modules_str = getline(modules_line) - return split(strpart(modules_str, 12), '\m\s\+') -endfunction " }}}2 - -function! s:GetValaVapiDirs() " {{{2 - if exists('g:syntastic_vala_vapi_dirs') || exists('b:syntastic_vala_vapi_dirs') - let vapi_dirs = syntastic#util#var('vala_vapi_dirs') - if type(vapi_dirs) == type('') - return split(vapi_dirs, '\m\s\+') - elseif type(vapi_dirs) == type([]) - return copy(vapi_dirs) - else - echoerr 'syntastic_vala_vapi_dirs must be either a list, or a string: fallback to in-file modules string' - endif - endif - - let vapi_line = search('^//\s*vapidirs:\s*','n') - let vapi_str = getline(vapi_line) - return split( substitute( vapi_str, '\m^//\s*vapidirs:\s*', '', 'g' ), '\m\s\+' ) + return join(map(opts, string(a:cmd . ' ') . ' . v:val')) endfunction " }}}2 " }}}1 diff --git a/sources_non_forked/vim-coffee-script/after/indent/html.vim b/sources_non_forked/vim-coffee-script/after/indent/html.vim index 2fa86371..0823e689 100644 --- a/sources_non_forked/vim-coffee-script/after/indent/html.vim +++ b/sources_non_forked/vim-coffee-script/after/indent/html.vim @@ -18,7 +18,7 @@ setlocal indentexpr=GetCoffeeHtmlIndent(v:lnum) function! GetCoffeeHtmlIndent(curlinenum) " See if we're inside a coffeescript block. - let scriptlnum = searchpair('', 'bWn') let prevlnum = prevnonblank(a:curlinenum) diff --git a/sources_non_forked/vim-coffee-script/after/syntax/html.vim b/sources_non_forked/vim-coffee-script/after/syntax/html.vim index aa01e7e9..a78ba88d 100644 --- a/sources_non_forked/vim-coffee-script/after/syntax/html.vim +++ b/sources_non_forked/vim-coffee-script/after/syntax/html.vim @@ -9,7 +9,7 @@ endif " Syntax highlighting for text/coffeescript script tags syn include @htmlCoffeeScript syntax/coffee.vim -syn region coffeeScript start=##me=s-1 keepend \ contains=@htmlCoffeeScript,htmlScriptTag,@htmlPreproc \ containedin=htmlHead diff --git a/sources_non_forked/vim-coffee-script/test/test.html b/sources_non_forked/vim-coffee-script/test/test.html index 34791453..0da7b62d 100644 --- a/sources_non_forked/vim-coffee-script/test/test.html +++ b/sources_non_forked/vim-coffee-script/test/test.html @@ -4,4 +4,14 @@ def: 42 } + + diff --git a/sources_non_forked/vim-fugitive/plugin/fugitive.vim b/sources_non_forked/vim-fugitive/plugin/fugitive.vim index 576dda19..1185ff15 100644 --- a/sources_non_forked/vim-fugitive/plugin/fugitive.vim +++ b/sources_non_forked/vim-fugitive/plugin/fugitive.vim @@ -195,7 +195,7 @@ function! fugitive#detect(path) abort nnoremap y :call setreg(v:register, recall()) endif let buffer = fugitive#buffer() - if expand('%:p') =~# '//' + if expand('%:p') =~# '://' call buffer.setvar('&path', s:sub(buffer.getvar('&path'), '^\.%(,|$)', '')) endif if stridx(buffer.getvar('&tags'), escape(b:git_dir, ', ')) == -1 @@ -700,7 +700,11 @@ function! s:Git(bang, args) abort let args = matchstr(a:args,'\v\C.{-}%($|\\@` in mappings examples for consisten documentation across the README [gh-1192] +* All of files should be written in utf-8 if the file will be passed to external command. [gh-1184] + +BUG FIXES: + +* Honor `g:go_echo_command_info` when dispatching builds in neovim [gh-1176] +* Fix `:GoBuild` error in neovim due to invalid jobcontrol handler function signatures (`s:on_stdout`, `s:on_stderr`)[gh-1176] +* Update statusline before and after `go#jobcontrol#Spawn` command is executed [gh-1176] +* Correctly report the value of the 'g:go_guru_tags' variable [gh-1177] +* Ensure no trailing `:` exist in GOPATH detection if initial GOPATH is not set [gh-1194] + +## 1.11 - (January 9, 2017) + +FEATURES: + +* Travis test integration has been added. Now any file that is added as `_test.vim` will be automatically tested in for every Pull Request (just like how we add tests to Go with `_test.go`). Going forward this will tremendously increase the stability and decrease the maintaince burden of vim-go. [gh-1157] * Add new `g:go_updatetime` setting to change the default updatetime (which was hardcoded previously) [gh-1055] * Add new `g:go_template_use_pkg` setting to enable to use cwd as package name instead of basic template file [gh-1124] @@ -9,6 +35,8 @@ IMPROVEMENTS: * Add `statusline` support for `:GoMetaLinter` [gh-1120] * Quickfix and Location lists contain now a descriptive title (requires at least Vim `7.4.2200`)[gh-1004] +* Check `go env GOPATH` as well for `:GoInstallBinaries` as Go has now a default path for GOPATH ("~/go")starting with 1.8 [gh-1152] +* `:GoDocBrowser` now also works on import paths [gh-1174] BUG FIXES: @@ -24,6 +52,22 @@ BUG FIXES: * Fix referencing a non defined variable for async commands when bang (!) was used * Fix `:GoDef` failing for a modified buffer if `hidden` was not set [gh-1132] * Fix `:GoDefStack` to allow popping from jump list when buffer is modified [gh-1133] +* Improve internal defining of functions and referencing them for async operations [gh-1155] +* Fix `:GoMetaLinter` failing if `go_metalinter_command` is set. [gh-1160] +* Fix `:GoMetaLinter`'s `go_metalinter_deadline` setting for async mode [gh-1146] + +BACKWARDS INCOMPATIBILITIES: + +* The following syntax options are now disabled by default. If you're using them be sure to set them in your .vimrc [gh-1167] + +```viml +g:go_highlight_array_whitespace_error +g:go_highlight_chan_whitespace_error +g:go_highlight_extra_types +g:go_highlight_space_tab_error +g:go_highlight_trailing_whitespace_error +``` + ## 1.10 (November 24, 2016) diff --git a/sources_non_forked/vim-go/Makefile b/sources_non_forked/vim-go/Makefile new file mode 100644 index 00000000..20b296d7 --- /dev/null +++ b/sources_non_forked/vim-go/Makefile @@ -0,0 +1,7 @@ +all: test + +test: + @echo "==> Running tests" + @./scripts/test.sh + +.PHONY: all test diff --git a/sources_non_forked/vim-go/README.md b/sources_non_forked/vim-go/README.md index 504149b2..b5542fb5 100644 --- a/sources_non_forked/vim-go/README.md +++ b/sources_non_forked/vim-go/README.md @@ -1,4 +1,4 @@ -# vim-go +# vim-go [![Build Status](http://img.shields.io/travis/fatih/vim-go.svg?style=flat-square)](https://travis-ci.org/fatih/vim-go)

Vim-go logo @@ -137,43 +137,43 @@ current buffer. You can also open the definition/declaration, in a new vertical, horizontal, or tab, for the word under your cursor: ```vim -au FileType go nmap ds (go-def-split) -au FileType go nmap dv (go-def-vertical) -au FileType go nmap dt (go-def-tab) +au FileType go nmap ds (go-def-split) +au FileType go nmap dv (go-def-vertical) +au FileType go nmap dt (go-def-tab) ``` Open the relevant Godoc for the word under the cursor with `gd` or open it vertically with `gv` ```vim -au FileType go nmap gd (go-doc) -au FileType go nmap gv (go-doc-vertical) +au FileType go nmap gd (go-doc) +au FileType go nmap gv (go-doc-vertical) ``` Or open the Godoc in browser ```vim -au FileType go nmap gb (go-doc-browser) +au FileType go nmap gb (go-doc-browser) ``` Show a list of interfaces which is implemented by the type under your cursor with `s` ```vim -au FileType go nmap s (go-implements) +au FileType go nmap s (go-implements) ``` Show type info for the word under your cursor with `i` (useful if you have disabled auto showing type info via `g:go_auto_type_info`) ```vim -au FileType go nmap i (go-info) +au FileType go nmap i (go-info) ``` Rename the identifier under the cursor to a new name ```vim -au FileType go nmap e (go-rename) +au FileType go nmap e (go-rename) ``` More `` mappings can be seen with `:he go-mappings`. Also these are just @@ -245,8 +245,8 @@ Run `:GoRun` in a new tab, horizontal split or vertical split terminal ```vim au FileType go nmap rt (go-run-tab) -au FileType go nmap rs (go-run-split) -au FileType go nmap rv (go-run-vertical) +au FileType go nmap rs (go-run-split) +au FileType go nmap rv (go-run-vertical) ``` By default new terminals are opened in a vertical split. To change it @@ -288,6 +288,31 @@ information. It includes section](https://github.com/fatih/vim-go/wiki/FAQ-Troubleshooting), and many other [various pieces](https://github.com/fatih/vim-go/wiki) of information. +## Development & Testing + +vim-go supports now test files. Please check `autoload` folder for examples. If +you add a new feature be sure you also include the `_test.vim` file next to the +script. Test functions should be starting with `Test_`, example: + + +```viml +function Test_run_fmt() + call assert_equal(expected, actual) + ... +endfunction +``` + +You can locally test it by running: + +``` +make +``` + +This will run all tests and print either `PASS` or `FAIL` to indicate the final +status of all tests. + +Additionally, each new pull request will trigger a new Travis-ci job. + ## Donation People have asked for this for a long time, now you can be a fully supporter by diff --git a/sources_non_forked/vim-go/Rakefile b/sources_non_forked/vim-go/Rakefile deleted file mode 100644 index 64346ff0..00000000 --- a/sources_non_forked/vim-go/Rakefile +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env rake - -task :ci => [:dump, :test] - -task :dump do - sh 'vim --version' -end - -# Firstly, `bundle install; bundle install --deployment` -# Then, `rake test` -task :test do - sh 'bundle exec vim-flavor test' -end diff --git a/sources_non_forked/vim-go/autoload/go/asmfmt.vim b/sources_non_forked/vim-go/autoload/go/asmfmt.vim index 07779b57..cc8acd3b 100644 --- a/sources_non_forked/vim-go/autoload/go/asmfmt.vim +++ b/sources_non_forked/vim-go/autoload/go/asmfmt.vim @@ -25,7 +25,7 @@ function! go#asmfmt#Format() abort " Write the current buffer to a tempfile. let l:tmpname = tempname() - call writefile(getline(1, '$'), l:tmpname) + call writefile(go#util#GetLines(), l:tmpname) " Run asmfmt. let path = go#path#CheckBinPath("asmfmt") diff --git a/sources_non_forked/vim-go/autoload/go/cmd.vim b/sources_non_forked/vim-go/autoload/go/cmd.vim index e7a5daf7..fbc62823 100644 --- a/sources_non_forked/vim-go/autoload/go/cmd.vim +++ b/sources_non_forked/vim-go/autoload/go/cmd.vim @@ -32,8 +32,11 @@ function! go#cmd#Build(bang, ...) abort \}) return elseif has('nvim') + if get(g:, 'go_echo_command_info', 1) + call go#util#EchoProgress("building dispatched ...") + endif + " if we have nvim, call it asynchronously and return early ;) - call go#util#EchoProgress("building dispatched ...") call go#jobcontrol#Spawn(a:bang, "build", args) return endif @@ -419,7 +422,7 @@ function s:cmd_job(args) abort call go#statusline#Update(status_dir, status) endfunction - let a:args.error_info_cb = function('s:error_info_cb') + let a:args.error_info_cb = funcref('s:error_info_cb') let callbacks = go#job#Spawn(a:args) let start_options = { diff --git a/sources_non_forked/vim-go/autoload/go/complete.vim b/sources_non_forked/vim-go/autoload/go/complete.vim index 2663afbd..2bd4eae7 100644 --- a/sources_non_forked/vim-go/autoload/go/complete.vim +++ b/sources_non_forked/vim-go/autoload/go/complete.vim @@ -1,18 +1,8 @@ let s:sock_type = (has('win32') || has('win64')) ? 'tcp' : 'unix' function! s:gocodeCurrentBuffer() abort - let buf = getline(1, '$') - if &encoding != 'utf-8' - let buf = map(buf, 'iconv(v:val, &encoding, "utf-8")') - endif - if &l:fileformat == 'dos' - " XXX: line2byte() depend on 'fileformat' option. - " so if fileformat is 'dos', 'buf' must include '\r'. - let buf = map(buf, 'v:val."\r"') - endif let file = tempname() - call writefile(buf, file) - + call writefile(go#util#GetLines(), file) return file endfunction diff --git a/sources_non_forked/vim-go/autoload/go/coverage.vim b/sources_non_forked/vim-go/autoload/go/coverage.vim index 9b027861..56113b93 100644 --- a/sources_non_forked/vim-go/autoload/go/coverage.vim +++ b/sources_non_forked/vim-go/autoload/go/coverage.vim @@ -283,7 +283,7 @@ function s:coverage_job(args) call go#statusline#Update(status_dir, status) endfunction - let a:args.error_info_cb = function('s:error_info_cb') + let a:args.error_info_cb = funcref('s:error_info_cb') let callbacks = go#job#Spawn(a:args) let start_options = { diff --git a/sources_non_forked/vim-go/autoload/go/def.vim b/sources_non_forked/vim-go/autoload/go/def.vim index d3b51c26..cf7c5c4a 100644 --- a/sources_non_forked/vim-go/autoload/go/def.vim +++ b/sources_non_forked/vim-go/autoload/go/def.vim @@ -16,7 +16,7 @@ function! go#def#Jump(mode) abort if &modified " Write current unsaved buffer to a temp file and use the modified content let l:tmpname = tempname() - call writefile(getline(1, '$'), l:tmpname) + call writefile(go#util#GetLines(), l:tmpname) let fname = l:tmpname endif @@ -41,8 +41,7 @@ function! go#def#Jump(mode) abort let stdin_content = "" if &modified - let sep = go#util#LineEnding() - let content = join(getline(1, '$'), sep) + let content = join(go#util#GetLines(), "\n") let stdin_content = fname . "\n" . strlen(content) . "\n" . content call add(cmd, "-modified") endif @@ -87,7 +86,7 @@ function! go#def#Jump(mode) abort return endif - call s:jump_to_declaration(out, a:mode, bin_name) + call go#def#jump_to_declaration(out, a:mode, bin_name) let $GOPATH = old_gopath endfunction @@ -96,10 +95,10 @@ function! s:jump_to_declaration_cb(mode, bin_name, job, exit_status, data) abort return endif - call s:jump_to_declaration(a:data[0], a:mode, a:bin_name) + call go#def#jump_to_declaration(a:data[0], a:mode, a:bin_name) endfunction -function! s:jump_to_declaration(out, mode, bin_name) abort +function! go#def#jump_to_declaration(out, mode, bin_name) abort let final_out = a:out if a:bin_name == "godef" " append the type information to the same line so our we can parse it. @@ -299,7 +298,7 @@ function s:def_job(args) abort " do not print anything during async definition search&jump endfunction - let a:args.error_info_cb = function('s:error_info_cb') + let a:args.error_info_cb = funcref('s:error_info_cb') let callbacks = go#job#Spawn(a:args) let start_options = { diff --git a/sources_non_forked/vim-go/autoload/go/def_test.vim b/sources_non_forked/vim-go/autoload/go/def_test.vim new file mode 100644 index 00000000..a5ed24fe --- /dev/null +++ b/sources_non_forked/vim-go/autoload/go/def_test.vim @@ -0,0 +1,32 @@ +func Test_jump_to_declaration_guru() + let file_name = "test-fixtures/def/jump.go" + let lnum = 5 + let col = 6 + + let out = printf("%s:%d:%d: defined here as func main", file_name, lnum, col) + let bin_name = "guru" + + call go#def#jump_to_declaration(out, "", bin_name) + + call assert_equal(file_name, bufname("%")) + call assert_equal(lnum, getcurpos()[1]) + call assert_equal(col, getcurpos()[2]) +endfunc + +func Test_jump_to_declaration_godef() + let file_name = "test-fixtures/def/jump.go" + let lnum = 5 + let col = 6 + + " note that the output of godef has two lines + let out = printf("%s:%d:%d\ndefined here as func main", file_name, lnum, col) + let bin_name = "godef" + + call go#def#jump_to_declaration(out, "", bin_name) + + call assert_equal(file_name, bufname("%")) + call assert_equal(lnum, getcurpos()[1]) + call assert_equal(col, getcurpos()[2]) +endfunc + +" vim: sw=2 ts=2 et diff --git a/sources_non_forked/vim-go/autoload/go/doc.vim b/sources_non_forked/vim-go/autoload/go/doc.vim index 3756167d..22ea8cc7 100644 --- a/sources_non_forked/vim-go/autoload/go/doc.vim +++ b/sources_non_forked/vim-go/autoload/go/doc.vim @@ -31,12 +31,11 @@ function! go#doc#OpenBrowser(...) abort let import = out["import"] let name = out["name"] - - " if import is empty, it means we selected a package name - if import ==# "" - let godoc_url = "https://godoc.org/" . name - else - let godoc_url = "https://godoc.org/" . import . "#" . name + let decl = out["decl"] + + let godoc_url = "https://godoc.org/" . import + if decl !~ "^package" + let godoc_url .= "#" . name endif echo godoc_url @@ -153,8 +152,7 @@ function! s:gogetdoc(json) abort " file size followed by newline " file contents let in = "" - let sep = go#util#LineEnding() - let content = join(getline(1, '$'), sep) + let content = join(go#util#GetLines(), "\n") let in = fname . "\n" . strlen(content) . "\n" . content let command .= " -modified" let out = go#util#System(command, in) diff --git a/sources_non_forked/vim-go/autoload/go/fmt.vim b/sources_non_forked/vim-go/autoload/go/fmt.vim index 391fca93..8a327d3b 100644 --- a/sources_non_forked/vim-go/autoload/go/fmt.vim +++ b/sources_non_forked/vim-go/autoload/go/fmt.vim @@ -2,26 +2,8 @@ " Use of this source code is governed by a BSD-style " license that can be found in the LICENSE file. " -" fmt.vim: Vim command to format Go files with gofmt. -" -" This filetype plugin add a new commands for go buffers: -" -" :Fmt -" -" Filter the current Go buffer through gofmt. -" It tries to preserve cursor position and avoids -" replacing the buffer with stderr output. -" -" Options: -" -" g:go_fmt_command [default="gofmt"] -" -" Flag naming the gofmt executable to use. -" -" g:go_fmt_autosave [default=1] -" -" Flag to auto call :Fmt when saved file -" +" fmt.vim: Vim command to format Go files with gofmt (and gofmt compatible +" toorls, such as goimports). if !exists("g:go_fmt_command") let g:go_fmt_command = "gofmt" @@ -67,6 +49,13 @@ function! go#fmt#Format(withGoimport) abort catch let l:curw = winsaveview() endtry + + " save our undo file to be restored after we are done. This is needed to + " prevent an additional undo jump due to BufWritePre auto command and also + " restore 'redo' history because it's getting being destroyed every + " BufWritePre + let tmpundofile = tempname() + exe 'wundo! ' . tmpundofile else " Save cursor position and many other things. let l:curw = winsaveview() @@ -74,135 +63,32 @@ function! go#fmt#Format(withGoimport) abort " Write current unsaved buffer to a temp file let l:tmpname = tempname() - call writefile(getline(1, '$'), l:tmpname) - - if g:go_fmt_experimental == 1 - " save our undo file to be restored after we are done. This is needed to - " prevent an additional undo jump due to BufWritePre auto command and also - " restore 'redo' history because it's getting being destroyed every - " BufWritePre - let tmpundofile = tempname() - exe 'wundo! ' . tmpundofile - endif - - " get the command first so we can test it - let bin_name = g:go_fmt_command - if a:withGoimport == 1 - let bin_name = g:go_goimports_bin - endif - - " check if the user has installed command binary. - " For example if it's goimports, let us check if it's installed, - " if not the user get's a warning via go#path#CheckBinPath() - let bin_path = go#path#CheckBinPath(bin_name) - if empty(bin_path) - return - endif - - if bin_name != "gofmt" - " change GOPATH too, so goimports can pick up the correct library - let old_gopath = $GOPATH - let $GOPATH = go#path#Detect() - endif - - " populate the final command with user based fmt options - let command = bin_path . ' -w ' - if a:withGoimport != 1 - let command = command . g:go_fmt_options - endif - - if bin_name == "goimports" - if !exists('b:goimports_vendor_compatible') - let out = go#util#System(bin_path . " --help") - if out !~ "-srcdir" - call go#util#EchoWarning(printf("vim-go: goimports (%s) does not support srcdir. Update with: :GoUpdateBinaries", bin_path)) - else - let b:goimports_vendor_compatible = 1 - endif - endif - - if exists('b:goimports_vendor_compatible') && b:goimports_vendor_compatible - let ssl_save = &shellslash - set noshellslash - let command = command . '-srcdir ' . shellescape(expand("%:p")) - let &shellslash = ssl_save - endif - endif - - " execute our command... + call writefile(go#util#GetLines(), l:tmpname) if go#util#IsWin() let l:tmpname = tr(l:tmpname, '\', '/') endif - let out = go#util#System(command . " " . l:tmpname) - if bin_name != "gofmt" - let $GOPATH = old_gopath + let bin_name = g:go_fmt_command + if a:withGoimport == 1 + let bin_name = g:go_goimports_bin endif - let l:listtype = "locationlist" - "if there is no error on the temp file replace the output with the current - "file (if this fails, we can always check the outputs first line with: - "splitted =~ 'package \w\+') + let out = go#fmt#run(bin_name, l:tmpname, expand('%')) if go#util#ShellError() == 0 - " remove undo point caused via BufWritePre - try | silent undojoin | catch | endtry - - " Replace current file with temp file, then reload buffer - let old_fileformat = &fileformat - if exists("*getfperm") - " save old file permissions - let original_fperm = getfperm(expand('%')) - endif - call rename(l:tmpname, expand('%')) - " restore old file permissions - if exists("*setfperm") && original_fperm != '' - call setfperm(expand('%'), original_fperm) - endif - silent edit! - let &fileformat = old_fileformat - let &syntax = &syntax - - " clean up previous location list, but only if it's due to fmt - if exists('b:got_fmt_error') && b:got_fmt_error - let b:got_fmt_error = 0 - call go#list#Clean(l:listtype) - call go#list#Window(l:listtype) - endif + call go#fmt#update_file(l:tmpname, expand('%')) elseif g:go_fmt_fail_silently == 0 - let splitted = split(out, '\n') - "otherwise get the errors and put them to location list - let errors = [] - for line in splitted - let tokens = matchlist(line, '^\(.\{-}\):\(\d\+\):\(\d\+\)\s*\(.*\)') - if !empty(tokens) - call add(errors, {"filename": @%, - \"lnum": tokens[2], - \"col": tokens[3], - \"text": tokens[4]}) - endif - endfor - if empty(errors) - % | " Couldn't detect gofmt error format, output errors - endif - if !empty(errors) - call go#list#Populate(l:listtype, errors, 'Format') - echohl Error | echomsg "Gofmt returned error" | echohl None - endif - - let b:got_fmt_error = 1 - call go#list#Window(l:listtype, len(errors)) - - " We didn't use the temp file, so clean up - call delete(l:tmpname) + let errors = s:parse_errors(out) + call s:show_errors(errors) endif + " We didn't use the temp file, so clean up + call delete(l:tmpname) + if g:go_fmt_experimental == 1 " restore our undo history silent! exe 'rundo ' . tmpundofile call delete(tmpundofile) - endif - if g:go_fmt_experimental == 1 " Restore our cursor/windows positions, folds, etc. if empty(l:curw) silent! loadview @@ -215,6 +101,134 @@ function! go#fmt#Format(withGoimport) abort endif endfunction +" update_file updates the target file with the given formatted source +function! go#fmt#update_file(source, target) + " remove undo point caused via BufWritePre + try | silent undojoin | catch | endtry + + let old_fileformat = &fileformat + if exists("*getfperm") + " save file permissions + let original_fperm = getfperm(a:target) + endif + + call rename(a:source, a:target) + + " restore file permissions + if exists("*setfperm") && original_fperm != '' + call setfperm(a:target , original_fperm) + endif + + " reload buffer to reflect latest changes + silent! edit! + + let &fileformat = old_fileformat + let &syntax = &syntax + + " clean up previous location list + let l:listtype = "locationlist" + call go#list#Clean(l:listtype) + call go#list#Window(l:listtype) +endfunction + +" run runs the gofmt/goimport command for the given source file and returns +" the the output of the executed command. Target is the real file to be +" formated. +function! go#fmt#run(bin_name, source, target) + let cmd = s:fmt_cmd(a:bin_name, a:source, a:target) + if cmd[0] == "goimports" + " change GOPATH too, so goimports can pick up the correct library + let old_gopath = $GOPATH + let $GOPATH = go#path#Detect() + endif + + let command = join(cmd, " ") + + " execute our command... + let out = go#util#System(command) + + if cmd[0] == "goimports" + let $GOPATH = old_gopath + endif + + return out +endfunction + +" fmt_cmd returns a dict that contains the command to execute gofmt (or +" goimports). args is dict with +function! s:fmt_cmd(bin_name, source, target) + " check if the user has installed command binary. + " For example if it's goimports, let us check if it's installed, + " if not the user get's a warning via go#path#CheckBinPath() + let bin_path = go#path#CheckBinPath(a:bin_name) + if empty(bin_path) + return + endif + + " start constructing the command + let cmd = [bin_path] + call add(cmd, "-w") + + if a:bin_name != "goimports" + call extend(cmd, split(g:go_fmt_options, " ")) + else + " lazy check if goimports support `-srcdir`. We should eventually remove + " this in the future + if !exists('b:goimports_vendor_compatible') + let out = go#util#System(bin_path . " --help") + if out !~ "-srcdir" + call go#util#EchoWarning(printf("vim-go: goimports (%s) does not support srcdir. Update with: :GoUpdateBinaries", bin_path)) + else + let b:goimports_vendor_compatible = 1 + endif + endif + + if exists('b:goimports_vendor_compatible') && b:goimports_vendor_compatible + let ssl_save = &shellslash + set noshellslash + call extend(cmd, ["-srcdir", shellescape(fnamemodify(a:target, ":p"))]) + let &shellslash = ssl_save + endif + endif + + call add(cmd, a:source) + return cmd +endfunction + +" parse_errors parses the given errors and returns a list of parsed errors +function! s:parse_errors(content) abort + let splitted = split(a:content, '\n') + + " list of errors to be put into location list + let errors = [] + for line in splitted + let tokens = matchlist(line, '^\(.\{-}\):\(\d\+\):\(\d\+\)\s*\(.*\)') + if !empty(tokens) + call add(errors,{ + \"lnum": tokens[2], + \"col": tokens[3], + \"text": tokens[4], + \ }) + endif + endfor + + return errors +endfunction + +" show_errors opens a location list and shows the given errors. If the given +" errors is empty, it closes the the location list +function! s:show_errors(errors) abort + let l:listtype = "locationlist" + if !empty(a:errors) + call go#list#Populate(l:listtype, a:errors, 'Format') + echohl Error | echomsg "Gofmt returned error" | echohl None + endif + + " this closes the window if there are no errors or it opens + " it if there is any + call go#list#Window(l:listtype, len(a:errors)) +endfunction + function! go#fmt#ToggleFmtAutoSave() abort if get(g:, "go_fmt_autosave", 1) let g:go_fmt_autosave = 0 @@ -225,4 +239,5 @@ function! go#fmt#ToggleFmtAutoSave() abort let g:go_fmt_autosave = 1 call go#util#EchoProgress("auto fmt enabled") endfunction + " vim: sw=2 ts=2 et diff --git a/sources_non_forked/vim-go/autoload/go/fmt_test.vim b/sources_non_forked/vim-go/autoload/go/fmt_test.vim new file mode 100644 index 00000000..0de2933c --- /dev/null +++ b/sources_non_forked/vim-go/autoload/go/fmt_test.vim @@ -0,0 +1,31 @@ +func Test_run_fmt() + let actual_file = tempname() + call writefile(readfile("test-fixtures/fmt/hello.go"), actual_file) + + let expected = join(readfile("test-fixtures/fmt/hello_golden.go"), "\n") + + " run our code + call go#fmt#run("gofmt", actual_file, "test-fixtures/fmt/hello.go") + + " this should now contain the formatted code + let actual = join(readfile(actual_file), "\n") + + call assert_equal(expected, actual) +endfunc + +func Test_update_file() + let expected = join(readfile("test-fixtures/fmt/hello_golden.go"), "\n") + let source_file = tempname() + call writefile(readfile("test-fixtures/fmt/hello_golden.go"), source_file) + + let target_file = tempname() + call writefile([""], target_file) + + " update_file now + call go#fmt#update_file(source_file, target_file) + + " this should now contain the formatted code + let actual = join(readfile(target_file), "\n") + + call assert_equal(expected, actual) +endfunc diff --git a/sources_non_forked/vim-go/autoload/go/guru.vim b/sources_non_forked/vim-go/autoload/go/guru.vim index 78cacc0b..206ca87b 100644 --- a/sources_non_forked/vim-go/autoload/go/guru.vim +++ b/sources_non_forked/vim-go/autoload/go/guru.vim @@ -1,6 +1,6 @@ " guru.vim -- Vim integration for the Go guru. -" guru_cmd returns a dict that contains the command to execute guru. option +" guru_cmd returns a dict that contains the command to execute guru. args " is dict with following options: " mode : guru mode, such as 'implements' " format : output format, either 'plain' or 'json' @@ -34,10 +34,8 @@ function! s:guru_cmd(args) range abort let cmd = [bin_path] let filename = fnamemodify(expand("%"), ':p:gs?\\?/?') - let stdin_content = "" if &modified - let sep = go#util#LineEnding() - let content = join(getline(1, '$'), sep ) + let content = join(go#util#GetLines(), "\n") let result.stdin_content = filename . "\n" . strlen(content) . "\n" . content call add(cmd, "-modified") endif @@ -127,7 +125,7 @@ function! s:sync_guru(args) abort " run, forrest run!!! let command = join(result.cmd, " ") - if &modified + if has_key(result, 'stdin_content') let out = go#util#System(command, result.stdin_content) else let out = go#util#System(command) @@ -198,10 +196,10 @@ function! s:async_guru(args) abort endfunction let start_options = { - \ 'close_cb': function("s:close_cb"), + \ 'close_cb': funcref("s:close_cb"), \ } - if &modified + if has_key(result, 'stdin_content') let l:tmpname = tempname() call writefile(split(result.stdin_content, "\n"), l:tmpname, "b") let l:start_options.in_io = "file" @@ -543,7 +541,7 @@ function! go#guru#ClearSameIds() abort endfor " remove the autocmds we defined - if exists("#BufWinEnter") + if exists("#BufWinEnter#") autocmd! BufWinEnter endif endfunction @@ -635,7 +633,7 @@ function! go#guru#Tags(...) abort if !exists('g:go_guru_tags') call go#util#EchoSuccess("guru tags is not set") else - call go#util#EchoSuccess("current guru tags: ". a:1) + call go#util#EchoSuccess("current guru tags: ". g:go_guru_tags) endif endfunction diff --git a/sources_non_forked/vim-go/autoload/go/jobcontrol.vim b/sources_non_forked/vim-go/autoload/go/jobcontrol.vim index 189ed5f4..d914cb8c 100644 --- a/sources_non_forked/vim-go/autoload/go/jobcontrol.vim +++ b/sources_non_forked/vim-go/autoload/go/jobcontrol.vim @@ -38,6 +38,16 @@ endfunction " GOPATH when g:go_autodetect_gopath is enabled. The job is started inside the " current files folder. function! s:spawn(bang, desc, args) abort + let status_type = a:args[0] + let status_dir = expand('%:p:h') + let started_at = reltime() + + call go#statusline#Update(status_dir, { + \ 'desc': "current status", + \ 'type': status_type, + \ 'state': "started", + \}) + let job = { \ 'desc': a:desc, \ 'bang': a:bang, @@ -49,6 +59,9 @@ function! s:spawn(bang, desc, args) abort \ 'on_stdout': function('s:on_stdout'), \ 'on_stderr': function('s:on_stderr'), \ 'on_exit' : function('s:on_exit'), + \ 'status_type' : status_type, + \ 'status_dir' : status_dir, + \ 'started_at' : started_at, \ } " modify GOPATH if needed @@ -91,6 +104,23 @@ endfunction " on_stderr handler. If there are no errors and a quickfix window is open, " it'll be closed. function! s:on_exit(job_id, exit_status, event) dict abort + let status = { + \ 'desc': 'last status', + \ 'type': self.status_type, + \ 'state': "success", + \ } + + if a:exit_status + let status.state = "failed" + endif + + let elapsed_time = reltimestr(reltime(self.started_at)) + " strip whitespace + let elapsed_time = substitute(elapsed_time, '^\s*\(.\{-}\)\s*$', '\1', '') + let status.state .= printf(" (%ss)", elapsed_time) + + call go#statusline#Update(self.status_dir, status) + let std_combined = self.stderr + self.stdout let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' @@ -105,14 +135,20 @@ function! s:on_exit(job_id, exit_status, event) dict abort call go#list#Window(l:listtype) let self.state = "SUCCESS" - call go#util#EchoSuccess("SUCCESS") + + if get(g:, 'go_echo_command_info', 1) + call go#util#EchoSuccess("[" . self.status_type . "] SUCCESS") + endif execute cd . fnameescape(dir) return endif let self.state = "FAILED" - call go#util#EchoError("FAILED") + + if get(g:, 'go_echo_command_info', 1) + call go#util#EchoError("[" . self.status_type . "] FAILED") + endif let errors = go#tool#ParseErrors(std_combined) let errors = go#tool#FilterValids(errors) @@ -148,13 +184,13 @@ endfunction " on_stdout is the stdout handler for jobstart(). It collects the output of " stderr and stores them to the jobs internal stdout list. -function! s:on_stdout(job_id, data) dict abort +function! s:on_stdout(job_id, data, event) dict abort call extend(self.stdout, a:data) endfunction " on_stderr is the stderr handler for jobstart(). It collects the output of " stderr and stores them to the jobs internal stderr list. -function! s:on_stderr(job_id, data) dict abort +function! s:on_stderr(job_id, data, event) dict abort call extend(self.stderr, a:data) endfunction diff --git a/sources_non_forked/vim-go/autoload/go/lint.vim b/sources_non_forked/vim-go/autoload/go/lint.vim index d81072a1..c62f2520 100644 --- a/sources_non_forked/vim-go/autoload/go/lint.vim +++ b/sources_non_forked/vim-go/autoload/go/lint.vim @@ -10,10 +10,6 @@ if !exists("g:go_metalinter_enabled") let g:go_metalinter_enabled = ['vet', 'golint', 'errcheck'] endif -if !exists("g:go_metalinter_deadline") - let g:go_metalinter_deadline = "5s" -endif - if !exists("g:go_golint_bin") let g:go_golint_bin = "golint" endif @@ -48,16 +44,33 @@ function! go#lint#Gometa(autosave, ...) abort let cmd += [expand('%:p:h')] else " the user wants something else, let us use it. - let cmd += [split(g:go_metalinter_command, " ")] + let cmd += split(g:go_metalinter_command, " ") endif + " gometalinter has a default deadline of 5 seconds. + " + " For async mode (s:lint_job), we want to override the default deadline only + " if we have a deadline configured. + " + " For sync mode (go#tool#ExecuteInDir), always explicitly pass the 5 seconds + " deadline if there is no other deadline configured. If a deadline is + " configured, then use it. + + " Call gometalinter asynchronously. if go#util#has_job() && has('lambda') + let deadline = get(g:, 'go_metalinter_deadline', 0) + if deadline != 0 + let cmd += ["--deadline=" . deadline] + endif + call s:lint_job({'cmd': cmd}) return endif - " we add deadline only for sync mode - let cmd += ["--deadline=" . g:go_metalinter_deadline] + " We're calling gometalinter synchronously. + + let cmd += ["--deadline=" . get(g:, 'go_metalinter_deadline', "5s")] + if a:autosave " include only messages for the active buffer let cmd += ["--include='^" . expand('%:p') . ".*$'"] @@ -283,8 +296,8 @@ function s:lint_job(args) endfunction let start_options = { - \ 'callback': function("s:callback"), - \ 'close_cb': function("s:close_cb"), + \ 'callback': funcref("s:callback"), + \ 'close_cb': funcref("s:close_cb"), \ } call job_start(a:args.cmd, start_options) diff --git a/sources_non_forked/vim-go/autoload/go/path.vim b/sources_non_forked/vim-go/autoload/go/path.vim index a9b74e97..740a2681 100644 --- a/sources_non_forked/vim-go/autoload/go/path.vim +++ b/sources_non_forked/vim-go/autoload/go/path.vim @@ -110,6 +110,9 @@ function! go#path#Detect() abort endif endif + " Fix up the case where initial $GOPATH is empty, + " and we end up with a trailing : + let gopath = substitute(gopath, ":$", "", "") return gopath endfunction diff --git a/sources_non_forked/vim-go/autoload/go/rename.vim b/sources_non_forked/vim-go/autoload/go/rename.vim index df8047e1..7d5579d2 100644 --- a/sources_non_forked/vim-go/autoload/go/rename.vim +++ b/sources_non_forked/vim-go/autoload/go/rename.vim @@ -85,8 +85,8 @@ function s:rename_job(args) endfunction let start_options = { - \ 'callback': function("s:callback"), - \ 'close_cb': function("s:close_cb"), + \ 'callback': funcref("s:callback"), + \ 'close_cb': funcref("s:close_cb"), \ } " modify GOPATH if needed diff --git a/sources_non_forked/vim-go/autoload/go/test-fixtures/def/jump.go b/sources_non_forked/vim-go/autoload/go/test-fixtures/def/jump.go new file mode 100644 index 00000000..50e8d8d3 --- /dev/null +++ b/sources_non_forked/vim-go/autoload/go/test-fixtures/def/jump.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Println("vim-go") +} diff --git a/sources_non_forked/vim-go/autoload/go/test-fixtures/fmt/hello.go b/sources_non_forked/vim-go/autoload/go/test-fixtures/fmt/hello.go new file mode 100644 index 00000000..3be42f6a --- /dev/null +++ b/sources_non_forked/vim-go/autoload/go/test-fixtures/fmt/hello.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + + func main() { +fmt.Println("vim-go") +} diff --git a/sources_non_forked/vim-go/autoload/go/test-fixtures/fmt/hello_golden.go b/sources_non_forked/vim-go/autoload/go/test-fixtures/fmt/hello_golden.go new file mode 100644 index 00000000..50e8d8d3 --- /dev/null +++ b/sources_non_forked/vim-go/autoload/go/test-fixtures/fmt/hello_golden.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Println("vim-go") +} diff --git a/sources_non_forked/vim-go/autoload/go/textobj.vim b/sources_non_forked/vim-go/autoload/go/textobj.vim index be0c7718..da0bb7e2 100644 --- a/sources_non_forked/vim-go/autoload/go/textobj.vim +++ b/sources_non_forked/vim-go/autoload/go/textobj.vim @@ -20,7 +20,7 @@ function! go#textobj#Function(mode) abort if &modified " Write current unsaved buffer to a temp file and use the modified content let l:tmpname = tempname() - call writefile(getline(1, '$'), l:tmpname) + call writefile(go#util#GetLines(), l:tmpname) let fname = l:tmpname endif @@ -107,7 +107,7 @@ function! go#textobj#FunctionJump(mode, direction) abort if &modified " Write current unsaved buffer to a temp file and use the modified content let l:tmpname = tempname() - call writefile(getline(1, '$'), l:tmpname) + call writefile(go#util#GetLines(), l:tmpname) let fname = l:tmpname endif diff --git a/sources_non_forked/vim-go/autoload/go/util.vim b/sources_non_forked/vim-go/autoload/go/util.vim index aaf7273d..65cf2750 100644 --- a/sources_non_forked/vim-go/autoload/go/util.vim +++ b/sources_non_forked/vim-go/autoload/go/util.vim @@ -305,4 +305,17 @@ function! go#util#EchoInfo(msg) redraw | echohl Debug | echom "vim-go: " . a:msg | echohl None endfunction +function! go#util#GetLines() + let buf = getline(1, '$') + if &encoding != 'utf-8' + let buf = map(buf, 'iconv(v:val, &encoding, "utf-8")') + endif + if &l:fileformat == 'dos' + " XXX: line2byte() depend on 'fileformat' option. + " so if fileformat is 'dos', 'buf' must include '\r'. + let buf = map(buf, 'v:val."\r"') + endif + return buf +endfunction + " vim: sw=2 ts=2 et diff --git a/sources_non_forked/vim-go/doc/vim-go.txt b/sources_non_forked/vim-go/doc/vim-go.txt index 87c59118..2d7a03b2 100644 --- a/sources_non_forked/vim-go/doc/vim-go.txt +++ b/sources_non_forked/vim-go/doc/vim-go.txt @@ -1382,8 +1382,7 @@ For example here is how to set each to 30. This option is Neovim only. Use it to change the behavior of the test commands. If set to 1 it opens the test commands inside a new terminal according to |'g:go_term_mode'|, otherwise it will run them in the background -just like `:GoBuild` and then display the status with -|go#jobcontrol#Statusline()|. By default it is disabled. +just like `:GoBuild`. By default it is disabled. > let g:go_term_enabled = 0 < diff --git a/sources_non_forked/vim-go/gosnippets/UltiSnips/go.snippets b/sources_non_forked/vim-go/gosnippets/UltiSnips/go.snippets index fcb82985..4a5b87f8 100644 --- a/sources_non_forked/vim-go/gosnippets/UltiSnips/go.snippets +++ b/sources_non_forked/vim-go/gosnippets/UltiSnips/go.snippets @@ -151,6 +151,14 @@ if err != nil { ${0} endsnippet +# error log snippet +snippet errl "Error with log.Fatal(err)" !b +if err != nil { + log.Fatal(err) +} +${0} +endsnippet + # error multiple return snippet errn, "Error return with two return values" !b if err != nil { diff --git a/sources_non_forked/vim-go/gosnippets/snippets/go.snip b/sources_non_forked/vim-go/gosnippets/snippets/go.snip index 942a82e0..2db20f57 100644 --- a/sources_non_forked/vim-go/gosnippets/snippets/go.snip +++ b/sources_non_forked/vim-go/gosnippets/snippets/go.snip @@ -132,6 +132,13 @@ abbr if err != nil { ... } t.Fatal(err) } +# error snippet in log.Fatal +snippet errl +abbr if err != nil { ... } + if err != nil { + log.Fatal(err) + } + # error snippet with two return values snippet errn, abbr if err != nil { return [...], err } diff --git a/sources_non_forked/vim-go/plugin/go.vim b/sources_non_forked/vim-go/plugin/go.vim index 3e2f6a1e..26547310 100644 --- a/sources_non_forked/vim-go/plugin/go.vim +++ b/sources_non_forked/vim-go/plugin/go.vim @@ -32,7 +32,7 @@ command! -nargs=? -complete=dir GoPath call go#path#GoPath() " target install directory. GoInstallBinaries doesn't install binaries if they " exist, to update current binaries pass 1 to the argument. function! s:GoInstallBinaries(updateBinaries) - if $GOPATH == "" + if $GOPATH == "" && go#util#gopath() == "" echohl Error echomsg "vim.go: $GOPATH is not set" echohl None diff --git a/sources_non_forked/vim-go/scripts/runtest.vim b/sources_non_forked/vim-go/scripts/runtest.vim new file mode 100644 index 00000000..a096036d --- /dev/null +++ b/sources_non_forked/vim-go/scripts/runtest.vim @@ -0,0 +1,81 @@ +let total_started = reltime() + +" add vim-go the only plugin inside the runtimepath +let git_root_path = system("git rev-parse --show-toplevel | tr -d '\\n'") +exe 'set rtp=' . git_root_path + +" source the passed test file +source % + +" cd into the folder of the test file +let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' +let dir = getcwd() +execute cd . expand('%:p:h') + +" initialize variables +let g:testname = expand('%') +let s:fail = 0 +let s:done = 0 +let s:logs = [] + +" get a list of all Test_ functions for the given file +set nomore +redir @q +silent function /^Test_ +redir END +let s:tests = split(substitute(@q, 'function \(\k*()\)', '\1', 'g')) + +" Iterate over all tests and execute them +for s:test in sort(s:tests) + let started = reltime() + + call add(s:logs, printf("=== RUN %s", s:test[:-3])) + exe 'call ' . s:test + + let elapsed_time = reltimestr(reltime(started)) + let elapsed_time = substitute(elapsed_time, '^\s*\(.\{-}\)\s*$', '\1', '') + + let s:done += 1 + + if len(v:errors) > 0 + let s:fail += 1 + call add(s:logs, printf("--- FAIL: %s (%ss)", s:test[:-3], elapsed_time)) + call extend(s:logs, map(v:errors, '" ". v:val')) + + " reset so we can capture failures of next test + let v:errors = [] + else + call add(s:logs, printf("--- PASS: %s (%ss)", s:test[:-3], elapsed_time)) + endif +endfor + +" pop out into the scripts folder +execute cd . fnameescape(dir) + +" create an empty fail to indicate that the test failed +if s:fail > 0 + split FAILED + write +endif + +let total_elapsed_time = reltimestr(reltime(total_started)) +let total_elapsed_time = substitute(total_elapsed_time, '^\s*\(.\{-}\)\s*$', '\1', '') + +let message = 'Executed ' . s:done . (s:done > 1 ? ' tests' : ' test') . '. Total test time: '. total_elapsed_time .'s' +call add(s:logs, "") +call add(s:logs, message) + +" store all error messages from within vim into test.log +redir > test.log +silent messages +redir END + +" also store all internal messages from s:logs: as well +split test.log +call append(line('$'), '') +call append(line('$'), 'From ' . g:testname . ':') +call append(line('$'), s:logs) +write + +" bye, bye! +qall! diff --git a/sources_non_forked/vim-go/scripts/test.sh b/sources_non_forked/vim-go/scripts/test.sh index d8a5b895..cda33504 100644 --- a/sources_non_forked/vim-go/scripts/test.sh +++ b/sources_non_forked/vim-go/scripts/test.sh @@ -1,77 +1,29 @@ -#!/bin/bash -e -# -# Copyright 2012 The Go Authors. All rights reserved. -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file. -# -# Tests for import.vim. +#!/bin/bash + +set -e cd $(dirname $0) -cat > base.go <&1 -n "$1: " - vim -e -s -u /dev/null -U /dev/null --noplugin -c "source import.vim" \ - -c "$1" -c 'wq! test.go' base.go - # ensure blank lines are treated correctly - if ! gofmt test.go | cmp test.go -; then - echo 2>&1 "gofmt conflict" - gofmt test.go | diff -u test.go - | sed "s/^/ /" 2>&1 - fail=1 - return - fi - if ! [[ $(cat test.go) =~ $2 ]]; then - echo 2>&1 "$2 did not match" - cat test.go | sed "s/^/ /" 2>&1 - fail=1 - return - fi - echo 2>&1 "ok" -} - -# Tests for Import - -test_one "Import baz" '"baz".*"bytes"' -test_one "Import io/ioutil" '"io".*"io/ioutil".*"net"' -test_one "Import myc" '"io".*"myc".*"net"' # prefix of a site prefix -test_one "Import nat" '"io".*"nat".*"net"' -test_one "Import net/http" '"net".*"net/http".*"mycorp/foo"' -test_one "Import zoo" '"net".*"zoo".*"mycorp/foo"' -test_one "Import mycorp/bar" '"net".*"mycorp/bar".*"mycorp/foo"' -test_one "Import mycorp/goo" '"net".*"mycorp/foo".*"mycorp/goo"' - -# Tests for Drop - -cat > base.go <&1 "FAIL" exit 1 fi diff --git a/sources_non_forked/vim-go/syntax/go.vim b/sources_non_forked/vim-go/syntax/go.vim index 9b23eb6c..8d7560f9 100644 --- a/sources_non_forked/vim-go/syntax/go.vim +++ b/sources_non_forked/vim-go/syntax/go.vim @@ -10,9 +10,7 @@ " let OPTION_NAME = 0 " in your ~/.vimrc file to disable particular options. You can also write: " let OPTION_NAME = 1 -" to enable particular options. -" At present, all options default to on, except highlight of: -" functions, methods, structs, operators, build constraints and interfaces. +" to enable particular options. At present, all options default to off: " " - go_highlight_array_whitespace_error " Highlights white space after "[]". @@ -36,23 +34,23 @@ if exists("b:current_syntax") endif if !exists("g:go_highlight_array_whitespace_error") - let g:go_highlight_array_whitespace_error = 1 + let g:go_highlight_array_whitespace_error = 0 endif if !exists("g:go_highlight_chan_whitespace_error") - let g:go_highlight_chan_whitespace_error = 1 + let g:go_highlight_chan_whitespace_error = 0 endif if !exists("g:go_highlight_extra_types") - let g:go_highlight_extra_types = 1 + let g:go_highlight_extra_types = 0 endif if !exists("g:go_highlight_space_tab_error") - let g:go_highlight_space_tab_error = 1 + let g:go_highlight_space_tab_error = 0 endif if !exists("g:go_highlight_trailing_whitespace_error") - let g:go_highlight_trailing_whitespace_error = 1 + let g:go_highlight_trailing_whitespace_error = 0 endif if !exists("g:go_highlight_operators") diff --git a/sources_non_forked/vim-go/t/coverlay.vim b/sources_non_forked/vim-go/t/coverlay.vim deleted file mode 100644 index 9d60c21d..00000000 --- a/sources_non_forked/vim-go/t/coverlay.vim +++ /dev/null @@ -1,191 +0,0 @@ -" to execute, `rake test` on parent dir - -describe 'go#coverage#Buffer' - before - new - let g:curdir = expand(':p:h') . '/' - let g:srcpath = 't/fixtures/src/' - let g:sample = 'pkg1/sample.go' - let g:sampleabs = g:curdir . g:srcpath . 'pkg1/sample.go' - let g:samplecover = g:curdir . g:srcpath . 'pkg1/sample.out' - let g:go_gopath = g:curdir . 't/fixtures' - execute "badd " . g:srcpath . g:sample - execute "buffer " . bufnr("$") - end - after - execute "bprev" - execute "bdelete " . g:srcpath . g:sample - close! - end - - it 'puts match to the list' - call go#coverage#Buffer(0) - Expect len(go#coverlay#matches()) == 5 - call go#coverlay#Clearlay() - Expect len(go#coverlay#matches()) == 0 - - call go#coverage#Buffer(0) - Expect len(go#coverlay#matches()) == 5 - call go#coverlay#Clearlay() - Expect len(go#coverlay#matches()) == 0 - - call go#coverage#Buffer(0) - Expect len(go#coverlay#matches()) == 5 - call go#coverage#Buffer(0) - Expect len(go#coverlay#matches()) == 5 - call go#coverlay#Clearlay() - Expect len(go#coverlay#matches()) == 0 - end -end - -describe 'go#coverage#Buffer fail' - before - new - let g:curdir = expand(':p:h') . '/' - let g:srcpath = 't/fixtures/src/' - let g:sample = 'failtest/sample.go' - let g:sampletest = 'failtest/sample_test.go' - let g:sampleabs = g:curdir . g:srcpath . 'failtest/sample.go' - let g:go_gopath = g:curdir . 't/fixtures' - execute "badd " . g:srcpath . g:sample - execute "buffer " . bufnr("$") - end - after - execute "bprev" - execute "bdelete " . g:srcpath . g:sampletest - execute "bdelete " . g:srcpath . g:sample - end - - it 'does nothing if test fail' - call go#coverage#Buffer(0) - Expect len(go#coverlay#matches()) == 0 - Expect len(getqflist()) == 1 - end -end - -describe 'go#coverage#Buffer build fail' - before - new - let g:curdir = expand(':p:h') . '/' - let g:srcpath = 't/fixtures/src/' - let g:sample = 'buildfail/sample.go' - let g:sampleabs = g:curdir . g:srcpath . 'buildfail/sample.go' - let g:go_gopath = g:curdir . 't/fixtures' - execute "badd " . g:srcpath . g:sample - execute "buffer " . bufnr("$") - end - after - execute "bprev" - execute "bdelete " . g:srcpath . g:sample - end - - it 'does nothing if test fail' - call go#coverage#Buffer(0) - Expect len(go#coverlay#matches()) == 0 - end -end - -describe 'go#coverage#Buffer build test fail' - before - new - let g:curdir = expand(':p:h') . '/' - let g:srcpath = 't/fixtures/src/' - let g:sample = 'buildtestfail/sample.go' - let g:sampleabs = g:curdir . g:srcpath . 'buildtestfail/sample.go' - let g:go_gopath = g:curdir . 't/fixtures' - execute "badd " . g:srcpath . g:sample - execute "buffer " . bufnr("$") - end - after - execute "bprev" - execute "bdelete " . g:srcpath . g:sample - end - - it 'does nothing if test fail' - call go#coverage#Buffer(0) - Expect len(go#coverlay#matches()) == 0 - end -end - -describe 'go#coverlay#findbufnr' - before - new - let g:curdir = expand(':p:h') . '/' - let g:srcpath = 't/fixtures/src/' - let g:sample = 'pkg1/sample.go' - let g:sample2 = 'pkg2/sample.go' - let g:sampleabs = g:curdir . g:srcpath . 'pkg1/sample.go' - let g:sampleabs2 = g:curdir . g:srcpath . 'pkg2/sample.go' - let g:go_gopath = g:curdir . 't/fixtures' - execute "badd " . g:srcpath . g:sample - execute "badd " . g:srcpath . g:sample2 - end - after - execute "bdelete " . g:srcpath . g:sample2 - execute "bdelete " . g:srcpath . g:sample - close! - end - - it 'returns BUFNR if FILE is opened at BUFNR' - Expect go#coverlay#findbufnr('_' . g:sampleabs) == bufnr(g:sampleabs) - Expect go#coverlay#findbufnr(g:sample) == bufnr(g:sampleabs) - - Expect go#coverlay#findbufnr('_' . g:sampleabs2) == bufnr(g:sampleabs2) - Expect go#coverlay#findbufnr(g:sample2) == bufnr(g:sampleabs2) - end - - it 'returns -1 if FILE is not exists' - Expect go#coverlay#findbufnr('pkg1/NOTEXISTS.go') == -1 - Expect go#coverlay#findbufnr('_' . g:curdir . g:srcpath . 'pkg1/NOTEXISTS.go') == -1 - end -end - -describe 'go#coverlay#isopenedon' - before - new - let g:curdir = expand(':p:h') . '/' - let g:srcpath = 't/fixtures/src/' - let g:sample = 'pkg1/sample.go' - let g:sampleabs = g:curdir . g:srcpath . 'pkg1/sample.go' - let g:go_gopath = g:curdir . 't/fixtures' - execute "badd " . g:srcpath . g:sample - end - after - execute "bdelete " . g:srcpath . g:sample - close! - end - - it 'returns 1 if FILE is opened at BUFNR' - Expect go#coverlay#isopenedon('_' . g:sampleabs, bufnr(g:sampleabs)) == 1 - Expect go#coverlay#isopenedon(g:sample, bufnr(g:sampleabs)) == 1 - end - - it 'returns 0 if FILE is not opened at BUFNR' - Expect go#coverlay#isopenedon('_' . g:sampleabs, 42) == 0 - Expect go#coverlay#isopenedon(g:sample, 42) == 0 - end - - it 'returns 0 if FILE is not exists' - Expect go#coverlay#isopenedon('_' . g:curdir . g:srcpath . 'pkg1/NOTEXISTS', bufnr(g:sampleabs)) == 0 - Expect go#coverlay#isopenedon('pkg1/NOTEXISTS.go', bufnr(g:sampleabs)) == 0 - end -end - - - -describe 'go#coverlay#parsegocoverline' - it 'parses a go cover output line and returns as dict' - let d = {'file': 'f',"startline": "1", "startcol": "2", "endline": "3", "endcol": "4", "numstmt": "5", "cnt": "6"} - " file:startline.col,endline.col numstmt count - Expect go#coverlay#parsegocoverline("f:1.2,3.4 5 6") == d - end -end - -describe 'go#coverlay#genmatch' - it 'generate mark pattern from cover data' - let d = {'file': 'f',"startline": "1", "startcol": "2", "endline": "3", "endcol": "4", "numstmt": "5", "cnt": "6"} - Expect go#coverlay#genmatch(d) == {'group': 'covered', "pattern": '\%>1l\_^\s\+\%<3l\|\%1l\_^\s\+\|\%3l\_^\s\+\(\}$\)\@!', "priority": 6} - let d = {'file': 'f',"startline": "1", "startcol": "2", "endline": "3", "endcol": "4", "numstmt": "5", "cnt": "0"} - Expect go#coverlay#genmatch(d) == {'group': 'uncover', "pattern": '\%>1l\_^\s\+\%<3l\|\%1l\_^\s\+\|\%3l\_^\s\+\(\}$\)\@!', "priority": 5} - end -end diff --git a/sources_non_forked/vim-go/t/fixtures/src/buildfail/sample.go b/sources_non_forked/vim-go/t/fixtures/src/buildfail/sample.go deleted file mode 100644 index 45fc006a..00000000 --- a/sources_non_forked/vim-go/t/fixtures/src/buildfail/sample.go +++ /dev/null @@ -1,13 +0,0 @@ -// set gopath before -//go:generate go test --coverprofile=sample.out -// go1.5.3 example output: -// GOPATH=`pwd`/fixtures go test --coverprofile=log.out buildfail -// # buildfail -// /tmp/go-build264733986/buildfail/_test/_obj_test/sample.go:7: undefined: IT_SHOULD_BE_BUILD_FAILED -// /tmp/go-build264733986/buildfail/_test/_obj_test/sample.go:8: missing return at end of function -// FAIL buildfail [build failed] -package pkg - -func Sample() int { - IT_SHOULD_BE_BUILD_FAILED -} diff --git a/sources_non_forked/vim-go/t/fixtures/src/buildfail/sample_test.go b/sources_non_forked/vim-go/t/fixtures/src/buildfail/sample_test.go deleted file mode 100644 index 2356d3ed..00000000 --- a/sources_non_forked/vim-go/t/fixtures/src/buildfail/sample_test.go +++ /dev/null @@ -1,7 +0,0 @@ -package pkg - -import "testing" - -func TestSample(t *testing.T) { - Sample() -} diff --git a/sources_non_forked/vim-go/t/fixtures/src/buildtestfail/sample.go b/sources_non_forked/vim-go/t/fixtures/src/buildtestfail/sample.go deleted file mode 100644 index 792f1234..00000000 --- a/sources_non_forked/vim-go/t/fixtures/src/buildtestfail/sample.go +++ /dev/null @@ -1,7 +0,0 @@ -// set gopath before -//go:generate go test --coverprofile=sample.out -package pkg - -func Sample() int { - return 1 -} diff --git a/sources_non_forked/vim-go/t/fixtures/src/buildtestfail/sample_test.go b/sources_non_forked/vim-go/t/fixtures/src/buildtestfail/sample_test.go deleted file mode 100644 index 17c4d463..00000000 --- a/sources_non_forked/vim-go/t/fixtures/src/buildtestfail/sample_test.go +++ /dev/null @@ -1,15 +0,0 @@ -// go1.5.3 example output: -// GOPATH=`pwd`/fixtures go test --coverprofile=log.out buildtestfail -// # buildtestfail -// fixtures/src/buildtestfail/sample_test.go:14: undefined: IT_SHOULD_BE_BUILD_FAILED -// FAIL buildtestfail [build failed] -// echo $? -// 2 - -package pkg - -import "testing" - -func TestSample(t *testing.T) { - IT_SHOULD_BE_BUILD_FAILED -} diff --git a/sources_non_forked/vim-go/t/fixtures/src/failtest/sample.go b/sources_non_forked/vim-go/t/fixtures/src/failtest/sample.go deleted file mode 100644 index 5859e926..00000000 --- a/sources_non_forked/vim-go/t/fixtures/src/failtest/sample.go +++ /dev/null @@ -1,12 +0,0 @@ -// set gopath before -//go:generate go test --coverprofile=sample.out -package pkg - -func Sample() int { - if false { - return 0 - } else if false { - return 0 - } - return 1 -} diff --git a/sources_non_forked/vim-go/t/fixtures/src/failtest/sample_test.go b/sources_non_forked/vim-go/t/fixtures/src/failtest/sample_test.go deleted file mode 100644 index 7f1ade0d..00000000 --- a/sources_non_forked/vim-go/t/fixtures/src/failtest/sample_test.go +++ /dev/null @@ -1,8 +0,0 @@ -package pkg - -import "testing" - -func TestSample(t *testing.T) { - Sample() - t.Fatal("itwillfail") -} diff --git a/sources_non_forked/vim-go/t/fixtures/src/parsefail/sample.go b/sources_non_forked/vim-go/t/fixtures/src/parsefail/sample.go deleted file mode 100644 index e9f3faa9..00000000 --- a/sources_non_forked/vim-go/t/fixtures/src/parsefail/sample.go +++ /dev/null @@ -1,14 +0,0 @@ -// set gopath before -//go:generate go test --coverprofile=sample.out -// go1.5.3 example output: -// GOPATH=`pwd`/fixtures go test --coverprofile=log.out parsefail -// # cover parsefail -// 2016/01/17 23:59:08 cover: /home/sey/vimfiles/_vim/bundle/vim-go-coverlay/t/fixtures/src/parsefail/sample.go: /home/sey/vimfiles/_vim/bundle/vim-go-coverlay/t/fixtures/src/parsefail/sample.go:10:1: expected declaration, found 'IDENT' PARSEFAIL -// FAIL parsefail [build failed] -// echo $? -// 2 -package pkg - -PARSEFAIL Sample() int { - return 0 -} diff --git a/sources_non_forked/vim-go/t/fixtures/src/parsefail/sample_test.go b/sources_non_forked/vim-go/t/fixtures/src/parsefail/sample_test.go deleted file mode 100644 index 2356d3ed..00000000 --- a/sources_non_forked/vim-go/t/fixtures/src/parsefail/sample_test.go +++ /dev/null @@ -1,7 +0,0 @@ -package pkg - -import "testing" - -func TestSample(t *testing.T) { - Sample() -} diff --git a/sources_non_forked/vim-go/t/fixtures/src/pkg1/sample.go b/sources_non_forked/vim-go/t/fixtures/src/pkg1/sample.go deleted file mode 100644 index 6ce94b39..00000000 --- a/sources_non_forked/vim-go/t/fixtures/src/pkg1/sample.go +++ /dev/null @@ -1,12 +0,0 @@ -// set gopath before -//go:generate go test --coverprofile=sample.out -package pkg1 - -func Sample() int { - if false { - return 0 - } else if false { - return 0 - } - return 1 -} diff --git a/sources_non_forked/vim-go/t/fixtures/src/pkg1/sample.out b/sources_non_forked/vim-go/t/fixtures/src/pkg1/sample.out deleted file mode 100644 index 909a63f1..00000000 --- a/sources_non_forked/vim-go/t/fixtures/src/pkg1/sample.out +++ /dev/null @@ -1,6 +0,0 @@ -mode: set -pkg1/sample.go:5.19,6.11 1 1 -pkg1/sample.go:11.2,11.10 1 1 -pkg1/sample.go:6.11,8.3 1 0 -pkg1/sample.go:8.3,8.18 1 1 -pkg1/sample.go:8.18,10.3 1 0 diff --git a/sources_non_forked/vim-go/t/fixtures/src/pkg1/sample_test.go b/sources_non_forked/vim-go/t/fixtures/src/pkg1/sample_test.go deleted file mode 100644 index e39d7ba8..00000000 --- a/sources_non_forked/vim-go/t/fixtures/src/pkg1/sample_test.go +++ /dev/null @@ -1,7 +0,0 @@ -package pkg1 - -import "testing" - -func TestSample(t *testing.T) { - Sample() -} diff --git a/sources_non_forked/vim-pug/README.markdown b/sources_non_forked/vim-pug/README.markdown index c41f9ddd..7665388f 100644 --- a/sources_non_forked/vim-pug/README.markdown +++ b/sources_non_forked/vim-pug/README.markdown @@ -2,6 +2,8 @@ Vim syntax highlighting for Pug (formerly Jade) templates. +For best results consider using this with an (improved) HTML5 syntax plugin. + Installation ------------ diff --git a/sources_non_forked/vim-pug/syntax/pug.vim b/sources_non_forked/vim-pug/syntax/pug.vim index 09e6b9b9..2d80f471 100644 --- a/sources_non_forked/vim-pug/syntax/pug.vim +++ b/sources_non_forked/vim-pug/syntax/pug.vim @@ -36,8 +36,9 @@ syntax keyword pugCommentTodo contained TODO FIXME XXX TBD syn match pugComment '\(\s\+\|^\)\/\/.*$' contains=pugCommentTodo syn region pugCommentBlock start="\z(\s\+\|^\)\/\/.*$" end="^\%(\z1\s\|\s*$\)\@!" contains=pugCommentTodo keepend syn region pugHtmlConditionalComment start="" contains=pugCommentTodo -syn region pugAttributes matchgroup=pugAttributesDelimiter start="(" end=")" contained contains=@htmlJavascript,pugHtmlArg,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@pugComponent -syn match pugClassChar "\." contained nextgroup=pugClass +syn region pugAngular2 start="(" end=")" contains=htmlEvent +syn region pugAttributes matchgroup=pugAttributesDelimiter start="(" end=")" contained contains=@htmlJavascript,pugHtmlArg,pugAngular2,htmlArg,htmlEvent,htmlCssDefinition nextgroup=@pugComponent +syn match pugClassChar "\." containedin=htmlTagName nextgroup=pugClass syn match pugBlockExpansionChar ":\s\+" contained nextgroup=pugTag,pugClassChar,pugIdChar syn match pugIdChar "#[[{]\@!" contained nextgroup=pugId syn match pugClass "\%(\w\|-\)\+" contained nextgroup=@pugComponent diff --git a/sources_non_forked/vim-snippets/README.md b/sources_non_forked/vim-snippets/README.md index d4e83c33..5567c5d9 100644 --- a/sources_non_forked/vim-snippets/README.md +++ b/sources_non_forked/vim-snippets/README.md @@ -131,14 +131,14 @@ Don't add useless placeholder default texts like: ``` if (${1:condition}){ - ${2:some code here} + ${0:some code here} } ``` instead use: ``` if (${1}){ - ${2} + ${0:${VISUAL}} } ``` @@ -148,6 +148,8 @@ get vim-dev plugin which has function completion Thus for conditions (while, if ..) and block bodies just use ${N} - Thanks +When the snippet can be used to wrap existing code leverage `${VISUAL}` + Open questions: What about one line if ee then .. else .. vs if \n .. then \n ... \n else \n .. ? Which additional policies to add? diff --git a/sources_non_forked/vim-snippets/UltiSnips/all.snippets b/sources_non_forked/vim-snippets/UltiSnips/all.snippets index 215487ec..49a9c80e 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/all.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/all.snippets @@ -77,23 +77,23 @@ endsnippet # DATES # ######### snippet date "YYYY-MM-DD" w -`date +%Y-%m-%d` +`!v strftime("%F")` endsnippet snippet ddate "Month DD, YYYY" w -`date +%B\ %d,\ %Y` +`!v strftime("%b %d, %Y")` endsnippet snippet diso "ISO format datetime" w -`date +%Y-%m-%dT%H:%M:%S%:z` +`!v strftime("%F %H:%M:%S%z")` endsnippet snippet time "hh:mm" w -`date +%H:%M` +`!v strftime("%H:%M")` endsnippet snippet datetime "YYYY-MM-DD hh:mm" w -`date +%Y-%m-%d\ %H:%M` +`!v strftime("%Y-%m-%d %H:%M")` endsnippet # vim:ft=snippets: diff --git a/sources_non_forked/vim-snippets/UltiSnips/c.snippets b/sources_non_forked/vim-snippets/UltiSnips/c.snippets index c9894649..6851a272 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/c.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/c.snippets @@ -5,7 +5,7 @@ priority -50 snippet def "#define ..." -#define ${1} +#define $1 endsnippet snippet #ifndef "#ifndef ... #define ... #endif" @@ -16,7 +16,7 @@ endsnippet snippet #if "#if #endif" b #if ${1:0} -${VISUAL}${0} +${VISUAL}$0 #endif endsnippet @@ -32,20 +32,20 @@ endsnippet snippet main "main() (main)" int main(int argc, char *argv[]) { - ${VISUAL}${0} + ${VISUAL}$0 return 0; } endsnippet snippet for "for loop (for)" for (${2:i} = 0; $2 < ${1:count}; ${3:++$2}) { - ${VISUAL}${0} + ${VISUAL}$0 } endsnippet snippet fori "for int loop (fori)" for (${4:int} ${2:i} = 0; $2 < ${1:count}; ${3:++$2}) { - ${VISUAL}${0} + ${VISUAL}$0 } endsnippet @@ -60,7 +60,7 @@ else: snip.rv = snip.c`} #define $1 -${VISUAL}${0} +${VISUAL}$0 #endif /* end of include guard: $1 */ endsnippet @@ -71,7 +71,7 @@ endsnippet snippet eli "else if .. (eli)" else if (${1:/* condition */}) { - ${VISUAL}${0} + ${VISUAL}$0 } endsnippet @@ -86,14 +86,14 @@ struct ${1:`!p snip.rv = (snip.basename or "name") + "_t"`} { endsnippet snippet fun "function" b -${1:void} ${2:function_name}(${3}) +${1:void} ${2:function_name}($3) { - ${VISUAL}${0} + ${VISUAL}$0 } endsnippet snippet fund "function declaration" b -${1:void} ${2:function_name}(${3}); +${1:void} ${2:function_name}($3); endsnippet # vim:ft=snippets: diff --git a/sources_non_forked/vim-snippets/UltiSnips/coffee-react.snippets b/sources_non_forked/vim-snippets/UltiSnips/coffee-react.snippets index 4cdb40f8..3090c571 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/coffee-react.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/coffee-react.snippets @@ -12,7 +12,7 @@ snippet createClass "React define Class" b ${1:classname}Class = React.createClass displayName: "$1" render: -> - ${2} + $2 $1 = React.createFactory($1) endsnippet @@ -23,58 +23,58 @@ endsnippet snippet propType "React propType (key/value)" b ${1:myVar}: React.PropTypes.${2:type}${3:.isRequired} -${4} +$4 endsnippet snippet setState "React setState" b @setState ${1:myvar}: ${2:myvalue} - ${3} + $3 endsnippet snippet getInitialState "React define getInitialState" b getInitialState: -> ${1:myvar}: ${2:myvalue} - ${3} + $3 endsnippet snippet getDefaultProps "React define getDefaultProps" b getDefaultProps: -> ${1:myvar}: ${2:myvalue} - ${3} + $3 endsnippet snippet componentWillMount "React define componentWillMount" b componentWillMount: -> - ${1} + $1 endsnippet snippet componentDidMount "React define componentDidMount" b componentDidMount: -> - ${1} + $1 endsnippet snippet componentWillReceiveProps "React define componentWillReceiveProps" b componentWillReceiveProps: (nextProps) -> - ${1} + $1 endsnippet snippet shouldComponentUpdate "React define shouldComponentUpdate" b shouldComponentUpdate: (nextProps, nextState) -> - ${1} + $1 endsnippet snippet componentWillUpdate "React define componentWillUpdate" b componentWillUpdate: (nextProps, nextState) -> - ${1} + $1 endsnippet snippet componentDidUpdate "React define componentDidUpdate" b componentDidUpdate: (prevProps, prevState) -> - ${1} + $1 endsnippet snippet componentWillUnmount "React define componentWillUnmount" b componentWillUnmount: -> - ${1} + $1 endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/cpp.snippets b/sources_non_forked/vim-snippets/UltiSnips/cpp.snippets index f7c2bd83..c83ec605 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/cpp.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/cpp.snippets @@ -27,7 +27,7 @@ endsnippet snippet ns "namespace .. (namespace)" namespace${1/.+/ /m}${1:`!p snip.rv = snip.basename or "name"`} { - ${VISUAL}${0} + ${VISUAL}$0 }${1/.+/ \/* /m}$1${1/.+/ *\/ /m} endsnippet @@ -61,7 +61,7 @@ snippet cla "An entire .h generator" b class ${1:`!v substitute(substitute(vim_snippets#Filename('$1','ClassName'),'^.','\u&',''), '_\(\w\)', '\u\1', 'g')`} { private: - ${3} + $3 public: $1(); diff --git a/sources_non_forked/vim-snippets/UltiSnips/crystal.snippets b/sources_non_forked/vim-snippets/UltiSnips/crystal.snippets new file mode 100644 index 00000000..cab946f4 --- /dev/null +++ b/sources_non_forked/vim-snippets/UltiSnips/crystal.snippets @@ -0,0 +1,13 @@ +priority -50 + +snippet "\b(de)?f" "def ..." r +def ${1:method_name}${2:(${3:*args})} + $0 +end +endsnippet + +snippet "\b(pde)?f" "private def ..." r +private def ${1:method_name}${2:(${3:*args})} + $0 +end +endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/cs.snippets b/sources_non_forked/vim-snippets/UltiSnips/cs.snippets index aca245e5..89b61ca0 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/cs.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/cs.snippets @@ -259,7 +259,7 @@ finally endsnippet snippet throw "throw" -throw new ${1}Exception("${2}"); +throw new $1Exception("$2"); endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/css.snippets b/sources_non_forked/vim-snippets/UltiSnips/css.snippets index ff265093..f5ccd2ff 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/css.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/css.snippets @@ -1,11 +1,5 @@ priority -50 -snippet . "selector { }" -$1 { - $0 -} -endsnippet - snippet p "padding" padding: ${1:0};$0 endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/d.snippets b/sources_non_forked/vim-snippets/UltiSnips/d.snippets index 9ce27513..a9d89b84 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/d.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/d.snippets @@ -23,7 +23,7 @@ mixin ${1:/*mixed_in*/} ${2:/*name*/}; endsnippet snippet new "new (new)" -new ${1}(${2}); +new $1($2); endsnippet snippet scpn "@safe const pure nothrow (scpn)" @@ -98,7 +98,7 @@ endsnippet snippet enf "enforce (enf)" b enforce(${1:/*condition*/}, - new ${2}Exception(${3:/*args*/})); + new $2Exception(${3:/*args*/})); endsnippet # Branches @@ -106,14 +106,14 @@ endsnippet snippet if "if .. (if)" if(${1:/*condition*/}) { - ${VISUAL}${0} + ${VISUAL}$0 } endsnippet snippet ife "if .. else (ife)" b if(${1:/*condition*/}) { - ${2} + $2 } else { @@ -124,14 +124,14 @@ endsnippet snippet el "else (el)" b else { - ${VISUAL}${1} + ${VISUAL}$1 } endsnippet snippet elif "else if (elif)" b else if(${1:/*condition*/}) { - ${VISUAL}${0} + ${VISUAL}$0 } endsnippet @@ -139,10 +139,10 @@ snippet sw "switch (sw)" switch(${1:/*var*/}) { case ${2:/*value*/}: - ${3} + $3 break; case ${4:/*value*/}: - ${5} + $5 break; ${7:/*more cases*/} default: @@ -154,10 +154,10 @@ snippet fsw "final switch (fsw)" final switch(${1:/*var*/}) { case ${2:/*value*/}: - ${3} + $3 break; case ${4:/*value*/}: - ${5} + $5 break; ${7:/*more cases*/} } @@ -165,7 +165,7 @@ endsnippet snippet case "case (case)" b case ${1:/*value*/}: - ${2} + $2 break; endsnippet @@ -178,42 +178,42 @@ endsnippet snippet do "do while (do)" b do { - ${VISUAL}${2} + ${VISUAL}$2 } while(${1:/*condition*/}); endsnippet snippet wh "while (wh)" b while(${1:/*condition*/}) { - ${VISUAL}${2} + ${VISUAL}$2 } endsnippet snippet for "for (for)" b for (${4:size_t} ${2:i} = 0; $2 < ${1:count}; ${3:++$2}) { - ${VISUAL}${0} + ${VISUAL}$0 } endsnippet snippet forever "forever (forever)" b for(;;) { - ${VISUAL}${0} + ${VISUAL}$0 } endsnippet snippet fore "foreach (fore)" foreach(${1:/*elem*/}; ${2:/*range*/}) { - ${VISUAL}${3} + ${VISUAL}$3 } endsnippet snippet forif "foreach if (forif)" b foreach(${1:/*elem*/}; ${2:/*range*/}) if(${3:/*condition*/}) { - ${VISUAL}${4} + ${VISUAL}$4 } endsnippet @@ -222,7 +222,7 @@ snippet in "in contract (in)" b in { assert(${1:/*condition*/}, "${2:error message}"); - ${3} + $3 } body endsnippet @@ -231,7 +231,7 @@ snippet out "out contract (out)" b out${1:(result)} { assert(${2:/*condition*/}, "${3:error message}"); - ${4} + $4 } body endsnippet @@ -240,7 +240,7 @@ snippet inv "invariant (inv)" b invariant() { assert(${1:/*condition*/}, "${2:error message}"); - ${3} + $3 } endsnippet @@ -249,21 +249,21 @@ endsnippet snippet fun "function definition (fun)" ${1:void} ${2:/*function name*/}(${3:/*args*/}) ${4:@safe pure nothrow} { - ${VISUAL}${5} + ${VISUAL}$5 } endsnippet snippet void "void function definition (void)" void ${1:/*function name*/}(${2:/*args*/}) ${3:@safe pure nothrow} { - ${VISUAL}${4} + ${VISUAL}$4 } endsnippet snippet this "ctor (this)" w this(${1:/*args*/}) { - ${VISUAL}${2} + ${VISUAL}$2 } endsnippet @@ -295,16 +295,16 @@ endsnippet snippet scope "scope (scope)" b scope(${1:exit}) { - ${VISUAL}${2} + ${VISUAL}$2 } endsnippet # With snippet with "with (with)" -with(${1}) +with($1) { - ${VISUAL}${2} + ${VISUAL}$2 } endsnippet @@ -315,7 +315,7 @@ try { ${VISUAL}${1:/*code to try*/} } -catch(${2}Exception e) +catch($2Exception e) { ${3:/*handle exception*/} } @@ -326,7 +326,7 @@ try { ${VISUAL}${1:/*code to try*/} } -catch(${2}Exception e) +catch($2Exception e) { ${3:/*handle exception*/} } @@ -337,14 +337,14 @@ finally endsnippet snippet catch "catch (catch)" b -catch(${1}Exception e) +catch($1Exception e) { ${2:/*handle exception*/} } endsnippet snippet thr "throw (thr)" -throw new ${1}Exception("${2}"); +throw new $1Exception("$2"); endsnippet @@ -353,35 +353,35 @@ endsnippet snippet struct "struct (struct)" struct ${1:`!p snip.rv = (snip.basename or "name")`} { - ${2} + $2 } endsnippet snippet union "union (union)" union ${1:`!p snip.rv = (snip.basename or "name")`} { - ${2} + $2 } endsnippet snippet class "class (class)" class ${1:`!p snip.rv = (snip.basename or "name")`} { - ${2} + $2 } endsnippet snippet inter "interface (inter)" interface ${1:`!p snip.rv = (snip.basename or "name")`} { - ${2} + $2 } endsnippet snippet enum "enum (enum)" enum ${1:`!p snip.rv = (snip.basename or "name")`} { - ${2} + $2 } endsnippet @@ -390,7 +390,7 @@ endsnippet snippet exc "exception declaration (exc)" b /// ${3:/*documentation*/} -class ${1}Exception : ${2}Exception +class $1Exception : $2Exception { public this(string msg, string file = __FILE__, int line = __LINE__) { @@ -405,14 +405,14 @@ endsnippet snippet version "version (version)" b version(${1:/*version name*/}) { - ${VISUAL}${2} + ${VISUAL}$2 } endsnippet snippet debug "debug" b debug { - ${VISUAL}${1} + ${VISUAL}$1 } endsnippet @@ -422,7 +422,7 @@ endsnippet snippet temp "template (temp)" b template ${2:/*name*/}(${1:/*args*/}) { - ${3} + $3 } endsnippet @@ -440,7 +440,7 @@ endsnippet snippet unittest "unittest (unittest)" b unittest { - ${1} + $1 } endsnippet @@ -450,21 +450,21 @@ endsnippet snippet opDis "opDispatch (opDis)" b ${1:/*return type*/} opDispatch(string s)() { - ${2}; + $2; } endsnippet snippet op= "opAssign (op=)" b -void opAssign(${1} rhs) ${2:@safe pure nothrow} +void opAssign($1 rhs) ${2:@safe pure nothrow} { - ${2} + $2 } endsnippet snippet opCmp "opCmp (opCmp)" b -int opCmp(${1} rhs) @safe const pure nothrow +int opCmp($1 rhs) @safe const pure nothrow { - ${2} + $2 } endsnippet @@ -484,7 +484,7 @@ endsnippet snippet toString "toString (toString)" b string toString() @safe const pure nothrow { - ${1} + $1 } endsnippet @@ -493,7 +493,7 @@ endsnippet snippet todo "TODO (todo)" -// TODO: ${1} +// TODO: $1 endsnippet @@ -509,16 +509,16 @@ snippet fdoc "function ddoc block (fdoc)" b /// ${1:description} /// /// ${2:Params: ${3:param} = ${4:param description} -/// ${5}} +/// $5} /// /// ${6:Returns: ${7:return value}} /// -/// ${8:Throws: ${9}Exception ${10}} +/// ${8:Throws: $9Exception $10} endsnippet snippet Par "Params (Par)" Params: ${1:param} = ${2:param description} -/// ${3} +/// $3 endsnippet snippet Ret "Returns (Ret)" @@ -526,7 +526,7 @@ Returns: ${1:return value/s} endsnippet snippet Thr "Throws (Thr)" -Throws: ${1}Exception ${2} +Throws: $1Exception $2 endsnippet snippet Example "Examples (Example)" @@ -556,7 +556,7 @@ snippet gpl "GPL (gpl)" b // // Copyright (C) ${1:Author}, `!v strftime("%Y")` -${2} +$2 endsnippet snippet boost "Boost (boost)" b @@ -565,7 +565,7 @@ snippet boost "Boost (boost)" b // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -${2} +$2 endsnippet @@ -577,8 +577,8 @@ snippet module "New module (module)" b // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -module ${2}.`!v vim_snippets#Filename('$1', 'name')`; +module $2.`!v vim_snippets#Filename('$1', 'name')`; -${3} +$3 endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/django.snippets b/sources_non_forked/vim-snippets/UltiSnips/django.snippets index 0ba6c9d5..8f836288 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/django.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/django.snippets @@ -124,7 +124,7 @@ endsnippet snippet model "Model" b class ${1:MODELNAME}(models.Model): - ${0} + $0 class Meta: verbose_name = "$1" verbose_name_plural = "$1s" @@ -275,19 +275,19 @@ endsnippet # VIEWS SNIPPETS snippet adminview "Model Admin View" b -class ${1}Admin(admin.ModelAdmin): +class $1Admin(admin.ModelAdmin): ''' - Admin View for ${1} + Admin View for $1 ''' - list_display = ('${2}',) - list_filter = ('${3}',) + list_display = ('$2',) + list_filter = ('$3',) inlines = [ - ${4}Inline, + $4Inline, ] - raw_id_fields = ('${5}',) - readonly_fields = ('${6}',) - search_fields = ['${7}'] -admin.site.register(${1}, ${1}Admin) + raw_id_fields = ('$5',) + readonly_fields = ('$6',) + search_fields = ['$7'] +admin.site.register($1, $1Admin) endsnippet snippet createview "Generic Create View" b @@ -315,27 +315,27 @@ class ${1:MODEL_NAME}ListView(ListView): endsnippet snippet stackedinline "Stacked Inline" b -class ${1}Inline(admin.StackedInline): +class $1Inline(admin.StackedInline): ''' - Stacked Inline View for ${1} + Stacked Inline View for $1 ''' - model = ${2:${1}} + model = ${2:$1} min_num = ${3:3} max_num = ${4:20} extra = ${5:1} - raw_id_fields = (${6},) + raw_id_fields = ($6,) endsnippet snippet tabularinline "Tabular Inline" b -class ${1}Inline(admin.TabularInline): +class $1Inline(admin.TabularInline): ''' - Tabular Inline View for ${1} + Tabular Inline View for $1 ''' - model = ${2:${1}} + model = ${2:$1} min_num = ${3:3} max_num = ${4:20} extra = ${5:1} - raw_id_fields = (${6},) + raw_id_fields = ($6,) endsnippet snippet templateview "Generic Template View" b diff --git a/sources_non_forked/vim-snippets/UltiSnips/eruby.snippets b/sources_non_forked/vim-snippets/UltiSnips/eruby.snippets index fe38c2fc..ef93be44 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/eruby.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/eruby.snippets @@ -27,12 +27,12 @@ def textmate_var(var, snip): endglobal -snippet % "<% ${0} %>" i -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`${0}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_INLINE', snip)` +snippet % "<% $0 %>" i +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_INLINE', snip)`$0`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_INLINE', snip)` endsnippet -snippet = "<%= ${0} %>" i -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`${0}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +snippet = "<%= $0 %>" i +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`$0`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` endsnippet ########################################################################### @@ -150,11 +150,11 @@ snippet licai "link_to (controller, action, id)" w endsnippet snippet linpp "link_to (nested path plural)" w -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:"${2:link text...}"}, ${3:${10:parent}_${11:child}_path(${12:@}${13:${10}})}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:"${2:link text...}"}, ${3:${10:parent}_${11:child}_path(${12:@}${13:$10})}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` endsnippet snippet linp "link_to (nested path)" w -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:"${2:link text...}"}, ${3:${12:parent}_${13:child}_path(${14:@}${15:${12}}, ${16:@}${17:${13}})}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:"${2:link text...}"}, ${3:${12:parent}_${13:child}_path(${14:@}${15:$12}, ${16:@}${17:$13})}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` endsnippet snippet lipp "link_to (path plural)" w @@ -162,7 +162,7 @@ snippet lipp "link_to (path plural)" w endsnippet snippet lip "link_to (path)" w -`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:"${2:link text...}"}, ${3:${12:model}_path(${13:@}${14:${12}})}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` +`!p textmate_var('TM_RAILS_TEMPLATE_START_RUBY_EXPR', snip)`link_to ${1:"${2:link text...}"}, ${3:${12:model}_path(${13:@}${14:$12})}`!p textmate_var('TM_RAILS_TEMPLATE_END_RUBY_EXPR', snip)` endsnippet snippet lim "link_to model" w diff --git a/sources_non_forked/vim-snippets/UltiSnips/go.snippets b/sources_non_forked/vim-snippets/UltiSnips/go.snippets index b6891ff0..35cf9091 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/go.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/go.snippets @@ -53,7 +53,7 @@ endsnippet snippet switch "Switch statement" b switch ${1:expression}${1/(.+)/ /}{ -case${0} +case$0 } endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/html.snippets b/sources_non_forked/vim-snippets/UltiSnips/html.snippets index 026985cb..6d98cb1c 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/html.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/html.snippets @@ -12,33 +12,6 @@ def x(snip): snip.rv = "" endglobal -############ -# Doctypes # -############ -snippet doctype "DocType XHTML 1.0 Strict" b - - -endsnippet - -snippet doctype "DocType XHTML 1.0 Transitional" b - - -endsnippet - -snippet doctype "DocType XHTML 1.1" b - - -endsnippet - -snippet doctype "HTML - 4.0 Transitional (doctype)" b - - -endsnippet - snippet doctype "HTML - 5.0 (doctype)" b @@ -83,45 +56,6 @@ snippet left "Left (left)" ← endsnippet -snippet option "Option (option)" -⌥ -endsnippet - -####################### -# Conditional inserts # -####################### -snippet ! "IE Conditional Comment: Internet Explorer 5_0 only" -$0 -endsnippet - -snippet ! "IE Conditional Comment: Internet Explorer 5_5 only" -$0 -endsnippet - -snippet ! "IE Conditional Comment: Internet Explorer 5_x" -$0 -endsnippet - -snippet ! "IE Conditional Comment: Internet Explorer 6 and below" -$0 -endsnippet - -snippet ! "IE Conditional Comment: Internet Explorer 6 only" -$0 -endsnippet - -snippet ! "IE Conditional Comment: Internet Explorer 7+" -$0 -endsnippet - -snippet ! "IE Conditional Comment: Internet Explorer" -$0 -endsnippet - -snippet ! "IE Conditional Comment: NOT Internet Explorer" -${1: IE Conditional Comment: NOT Internet Explorer }$0 -endsnippet - ############# # HTML TAGS # ############# @@ -129,12 +63,12 @@ snippet input "Input with Label" w endsnippet -snippet input "XHTML " w +snippet input "HTML " w endsnippet -snippet opt "Option" w +snippet option "Option" w ${3:$2} endsnippet @@ -145,15 +79,15 @@ snippet select "Select Box" w endsnippet -snippet textarea "XHTML endsnippet -snippet mailto "XHTML " w +snippet mailto "HTML " w ${3:email me} endsnippet -snippet base "XHTML " w +snippet base "HTML " w endsnippet @@ -229,12 +163,12 @@ snippet meta "XHTML " w endsnippet -snippet scriptsrc "XHTML +snippet scriptsrc "HTML endsnippet -snippet script "XHTML endsnippet @@ -304,20 +238,6 @@ snippet fieldset "Fieldset" w endsnippet -snippet movie "Embed QT movie (movie)" b - - - - - - -endsnippet - snippet viewport "Responsive viewport meta" w endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/html_minimal.snippets b/sources_non_forked/vim-snippets/UltiSnips/html_minimal.snippets index e7ca5e06..5fb75223 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/html_minimal.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/html_minimal.snippets @@ -4,24 +4,24 @@ priority -50 snippet id -id="${1}"${2} +id="$1"$2 endsnippet snippet idn -id="${1}" name="${2:$1}" +id="$1" name="${2:$1}" endsnippet snippet label_and_input - -${8} + +$8 endsnippet snippet input -${7} +$7 endsnippet snippet submit -${7} +$7 endsnippet snippet textarea diff --git a/sources_non_forked/vim-snippets/UltiSnips/htmldjango.snippets b/sources_non_forked/vim-snippets/UltiSnips/htmldjango.snippets index 37fa85fd..2ef004e2 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/htmldjango.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/htmldjango.snippets @@ -4,30 +4,30 @@ extends html # Generic Tags snippet % "" bi -{% ${1} %}${2} +{% $1 %}$2 endsnippet snippet %% "" bi {% ${1:tag_name} %} - ${2} + $2 {% end$1 %} endsnippet snippet { "" bi -{{ ${1} }}${2} +{{ $1 }}$2 endsnippet # Template Tags snippet autoescape "" bi {% autoescape ${1:off} %} - ${2} + $2 {% endautoescape %} endsnippet snippet block "" bi -{% block ${1} %} - ${2} +{% block $1 %} + $2 {% endblock $1 %} endsnippet @@ -37,12 +37,12 @@ endsnippet snippet comment "" bi {% comment %} - ${1} + $1 {% endcomment %} endsnippet snippet cycle "" bi -{% cycle ${1:val1} ${2:val2} ${3:as ${4}} %} +{% cycle ${1:val1} ${2:val2} ${3:as $4} %} endsnippet snippet debug "" bi @@ -54,76 +54,76 @@ snippet extends "" bi endsnippet snippet filter "" bi -{% filter ${1} %} - ${2} +{% filter $1 %} + $2 {% endfilter %} endsnippet snippet firstof "" bi -{% firstof ${1} %} +{% firstof $1 %} endsnippet snippet for "" bi -{% for ${1} in ${2} %} - ${3} +{% for $1 in $2 %} + $3 {% endfor %} endsnippet snippet empty "" bi {% empty %} - ${1} + $1 endsnippet snippet if "" bi -{% if ${1} %} - ${2} +{% if $1 %} + $2 {% endif %} endsnippet snippet iif "" bi -{% if ${1} %}${2}{% endif %} +{% if $1 %}$2{% endif %} endsnippet snippet ielse "" bi -{% else %}${1} +{% else %}$1 endsnippet snippet else "" bi {% else %} - ${1} + $1 endsnippet snippet ielif "" bi -{% elif %}${1} +{% elif %}$1 endsnippet snippet elif "" bi {% elif %} - ${1} + $1 endsnippet snippet ifchanged "" bi -{% ifchanged %}${1}{% endifchanged %} +{% ifchanged %}$1{% endifchanged %} endsnippet snippet ifequal "" bi -{% ifequal ${1} ${2} %} - ${3} +{% ifequal $1 $2 %} + $3 {% endifequal %} endsnippet snippet ifnotequal "" bi -{% ifnotequal ${1} ${2} %} - ${3} +{% ifnotequal $1 $2 %} + $3 {% endifnotequal %} endsnippet snippet include "" bi -{% include "${1}" %} +{% include "$1" %} endsnippet snippet load "" bi -{% load ${1} %} +{% load $1 %} endsnippet snippet now "" bi @@ -131,15 +131,15 @@ snippet now "" bi endsnippet snippet regroup "" bi -{% regroup ${1} by ${2} as ${3} %} +{% regroup $1 by $2 as $3 %} endsnippet snippet spaceless "" bi -{% spaceless %}${1}{% endspaceless %} +{% spaceless %}$1{% endspaceless %} endsnippet snippet ssi "" bi -{% ssi ${1} %} +{% ssi $1 %} endsnippet snippet trans "" bi @@ -147,7 +147,7 @@ snippet trans "" bi endsnippet snippet url "" bi -{% url ${1} as ${2} %} +{% url $1 as $2 %} endsnippet snippet widthratio "" bi @@ -155,7 +155,7 @@ snippet widthratio "" bi endsnippet snippet with "" bi -{% with ${1} as ${2} %} +{% with $1 as $2 %} ${VISUAL} {% endwith %} endsnippet @@ -197,7 +197,7 @@ snippet blocktrans "" bi endsnippet snippet lorem "" bi -{% lorem ${1} %} +{% lorem $1 %} endsnippet # Template Filters @@ -209,91 +209,91 @@ endsnippet # Note: Template tags that take no arguments are not implemented. snippet add "" bi -add:"${1}" +add:"$1" endsnippet snippet center "" bi -center:"${1}" +center:"$1" endsnippet snippet cut "" bi -cut:"${1}" +cut:"$1" endsnippet snippet date "" bi -date:"${1}" +date:"$1" endsnippet snippet default "" bi -default:"${1}" +default:"$1" endsnippet snippet defaultifnone "" bi -default_if_none:"${1}" +default_if_none:"$1" endsnippet snippet dictsort "" bi -dictsort:"${1}" +dictsort:"$1" endsnippet snippet dictsortrev "" bi -dictsortreversed:"${1}" +dictsortreversed:"$1" endsnippet snippet divisibleby "" bi -divisibleby:"${1}" +divisibleby:"$1" endsnippet snippet floatformat "" bi -floatformat:"${1}" +floatformat:"$1" endsnippet snippet getdigit "" bi -get_digit:"${1}" +get_digit:"$1" endsnippet snippet join "" bi -join:"${1}" +join:"$1" endsnippet snippet lengthis "" bi -length_is:"${1}" +length_is:"$1" endsnippet snippet pluralize "" bi -pluralize:"${1}" +pluralize:"$1" endsnippet snippet removetags "" bi -removetags:"${1}" +removetags:"$1" endsnippet snippet slice "" bi -slice:"${1}" +slice:"$1" endsnippet snippet stringformat "" bi -stringformat:"${1}" +stringformat:"$1" endsnippet snippet time "" bi -time:"${1}" +time:"$1" endsnippet snippet truncatewords "" bi -truncatewords:${1} +truncatewords:$1 endsnippet snippet truncatewordshtml "" bi -truncatewords_html:${1} +truncatewords_html:$1 endsnippet snippet urlizetrunc "" bi -urlizetrunc:${1} +urlizetrunc:$1 endsnippet snippet wordwrap "" bi -wordwrap:${1} +wordwrap:$1 endsnippet # vim:ft=snippets: diff --git a/sources_non_forked/vim-snippets/UltiSnips/java.snippets b/sources_non_forked/vim-snippets/UltiSnips/java.snippets index 54d026df..55883a36 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/java.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/java.snippets @@ -48,7 +48,7 @@ $0 endsnippet snippet /o|v/ "new Object or variable" br -${1:Object} ${2:var} = new $1(${3}); +${1:Object} ${2:var} = new $1($3); endsnippet snippet f "field" b @@ -310,13 +310,13 @@ try { endsnippet snippet mt "method throws" b -${1:private} ${2:void} ${3:method}(${4}) ${5:throws $6 }{ +${1:private} ${2:void} ${3:method}($4) ${5:throws $6 }{ $0 } endsnippet snippet m "method" b -${1:private} ${2:void} ${3:method}(${4}) { +${1:private} ${2:void} ${3:method}($4) { $0 } endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/javascript-angular.snippets b/sources_non_forked/vim-snippets/UltiSnips/javascript-angular.snippets index 91b59316..c231ece1 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/javascript-angular.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/javascript-angular.snippets @@ -19,7 +19,7 @@ config(function($1) { endsnippet snippet acont "angular controller" i -controller('${1:name}', [${2}function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) { +controller('${1:name}', [$2function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) { $0 }]); endsnippet @@ -31,29 +31,29 @@ controller('${1:name}', [${2:'$scope', }function(${2/('|")([A-Z_$]+)?\1?((, ?)$) endsnippet snippet adir "angular directive" i -directive('${1}', [${2}function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) { +directive('$1', [$2function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) { return { restrict: '${3:EA}', link: function(scope, element, attrs) { - ${0} + $0 } }; }]); endsnippet snippet adirs "angular directive with scope" i -directive('${1}', [${2:'$scope', }function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) { +directive('$1', [${2:'$scope', }function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) { return { restrict: '${3:EA}', link: function(scope, element, attrs) { - ${0} + $0 } }; }]); endsnippet snippet afact "angular factory" i -factory('${1:name}', [${2}function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) { +factory('${1:name}', [$2function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) { $0 }]); endsnippet @@ -65,7 +65,7 @@ factory('${1:name}', [${2:'$scope', }function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$ endsnippet snippet aserv "angular service" i -service('${1:name}', [${2}function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) { +service('${1:name}', [$2function(${2/('|")([A-Z_$]+)?\1?((, ?)$)?/$2(?3::$4)/ig}) { $0 }]); endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/javascript-node.snippets b/sources_non_forked/vim-snippets/UltiSnips/javascript-node.snippets index 7a14deeb..e4a64e95 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/javascript-node.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/javascript-node.snippets @@ -5,48 +5,48 @@ snippet #! "shebang" endsnippet snippet vreq "assign a CommonJS-style module to a var" -var ${0:${1/(.+\/)*(\w+)(-|\b|$)(\..+$)?/\u$2/g}} = require('${1}'); +var ${0:${1/(.+\/)*(\w+)(-|\b|$)(\..+$)?/\u$2/g}} = require('$1'); endsnippet snippet ex "module.exports" -module.exports = ${1}; +module.exports = $1; endsnippet snippet hcs "http.createServer" -http.createServer(${1}).listen(${2}); +http.createServer($1).listen($2); endsnippet snippet ncs "net.createServer" net.createServer(function(${1:socket}){ - ${1}.on('data', function(${3:data}){ - ${4} + $1.on('data', function(${3:data}){ + $4 }); - ${1}.on('end', function(){ - ${5} + $1.on('end', function(){ + $5 }); }).listen(${6:8124}); endsnippet snippet pipe "pipe" -pipe(${1:stream})${2} +pipe(${1:stream})$2 endsnippet # Express snippets snippet eget "express GET" -${1:app}.get('${2}', ${3}); +${1:app}.get('$2', $3); endsnippet snippet epost "express POST" -${1:app}.post('${2}', ${3}); +${1:app}.post('$2', $3); endsnippet snippet eput "express PUT" -${1:app}.put('${2}', ${3}); +${1:app}.put('$2', $3); endsnippet snippet edelete "express DELETE" -${1:app}.delete('${2}', ${3}); +${1:app}.delete('$2', $3); endsnippet # process snippets diff --git a/sources_non_forked/vim-snippets/UltiSnips/javascript-openui5.snippets b/sources_non_forked/vim-snippets/UltiSnips/javascript-openui5.snippets index 5553c79a..db4481cd 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/javascript-openui5.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/javascript-openui5.snippets @@ -1,80 +1,80 @@ snippet sapmlabel - var ${1} = new sap.m.Label({ - design : ${2}, - text : ${3}, - visible : ${4}, - textAlign : ${5}, - textDirection : ${6}, - width : ${7}, - required : ${7} + var $1 = new sap.m.Label({ + design : $2, + text : $3, + visible : $4, + textAlign : $5, + textDirection : $6, + width : $7, + required : $7 }); snippet sapmtext - var ${1} = new sap.m.Text({ - text :${2}, - textDirection :${3}, - visible :${4}, - wrapping : ${5}, - textAlign : ${6}, - width :${7}, - maxLines :${8} + var $1 = new sap.m.Text({ + text :$2, + textDirection :$3, + visible :$4, + wrapping : $5, + textAlign : $6, + width :$7, + maxLines :$8 }); snippet sapmbutton - var ${1} = new sap.m.Button({ - text : ${2}, - type : ${3}, - width : ${4}, - enabled :${5}, - visible :${6}, - icon : ${7}, - iconFirst : ${8}, - activeIcon :${9}, - iconDensityAware : ${10}, + var $1 = new sap.m.Button({ + text : $2, + type : $3, + width : $4, + enabled :$5, + visible :$6, + icon : $7, + iconFirst : $8, + activeIcon :$9, + iconDensityAware : $10, }); snippet sapmflexbox - var ${1} = new sap.m.FlexBox({ - visible : ${2}, - height : ${3}, - width : ${4}, - displayInline :${5}, - direction :${6}, - fitContainer : ${7}, - renderType : ${8}, - justifyContent :${9}, - alignItems : ${10}, + var $1 = new sap.m.FlexBox({ + visible : $2, + height : $3, + width : $4, + displayInline :$5, + direction :$6, + fitContainer : $7, + renderType : $8, + justifyContent :$9, + alignItems : $10, items:[] }); snippet sapmhbox - var ${1} = new sap.m.HBox({ - visible : ${2}, - height : ${3}, - width : ${4}, - displayInline :${5}, - direction :${6}, - fitContainer : ${7}, - renderType : ${8}, - justifyContent :${9}, - alignItems : ${10}, + var $1 = new sap.m.HBox({ + visible : $2, + height : $3, + width : $4, + displayInline :$5, + direction :$6, + fitContainer : $7, + renderType : $8, + justifyContent :$9, + alignItems : $10, items:[] }); snippet sapmvbox - var ${1} = new sap.m.VBox({ - visible : ${2}, - height : ${3}, - width : ${4}, - displayInline :${5}, - direction :${6}, - fitContainer : ${7}, - renderType : ${8}, - justifyContent :${9}, - alignItems : ${10}, + var $1 = new sap.m.VBox({ + visible : $2, + height : $3, + width : $4, + displayInline :$5, + direction :$6, + fitContainer : $7, + renderType : $8, + justifyContent :$9, + alignItems : $10, items:[] }); snippet sapcomponent - sap.ui.controller("${1}", { + sap.ui.controller("$1", { onInit: function(){ }, onAfterRendering: function() { @@ -86,120 +86,120 @@ snippet sapcomponent }); snippet sapminput - var ${1} = new sap.m.Input({ - value :${2}, - width : ${3}, - enabled :${4}, - visible :${5}, - valueState :${6}, - name : ${7}, - placeholder : ${8}, - editable : ${9}, - type : ${10}, - maxLength :${11}, - valueStateText :${12}, - showValueStateMessage :${13}, - dateFormat :${14}, - showValueHelp :${15}, - showSuggestion :${16}, - valueHelpOnly :${17}, - filterSuggests :${18}, - maxSuggestionWidth :${19}, - startSuggestion : ${20}, - showTableSuggestionValueHelp : ${21}, - description : ${22}, - fieldWidth : ${23}, - valueLiveUpdate :${24}, - suggestionItems :[${25}], - suggestionColumns : [${26}], - suggestionRows : [${27}], - liveChange : ${28}, - valueHelpRequest :${29}, - suggest : ${30}, - suggestionItemSelected : ${31} + var $1 = new sap.m.Input({ + value :$2, + width : $3, + enabled :$4, + visible :$5, + valueState :$6, + name : $7, + placeholder : $8, + editable : $9, + type : $10, + maxLength :$11, + valueStateText :$12, + showValueStateMessage :$13, + dateFormat :$14, + showValueHelp :$15, + showSuggestion :$16, + valueHelpOnly :$17, + filterSuggests :$18, + maxSuggestionWidth :$19, + startSuggestion : $20, + showTableSuggestionValueHelp : $21, + description : $22, + fieldWidth : $23, + valueLiveUpdate :$24, + suggestionItems :[$25], + suggestionColumns : [$26], + suggestionRows : [$27], + liveChange : $28, + valueHelpRequest :$29, + suggest : $30, + suggestionItemSelected : $31 }); snippet _sthis var _self = this; snippet sapmresponsivepopup - var ${1} = new sap.m.ResponsivePopover({ - placement :${2} ,//sap.m.PlacementType (default: sap.m.PlacementType.Right) - showHeader :${3} ,//boolean (default: true) - title : ${4},//string - icon :${5} ,//sap.ui.core.URI - modal :${6} ,// boolean - offsetX :${7}, //int - offsetY :${8}, //int - contentWidth : ${9},//sap.ui.core.CSSSize - contentHeight :${10}, //sap.ui.core.CSSSize - horizontalScrolling :${11}, //boolean - verticalScrolling :${12}, //boolean - showCloseButton :${13}, //boolean (default: true) + var $1 = new sap.m.ResponsivePopover({ + placement :$2 ,//sap.m.PlacementType (default: sap.m.PlacementType.Right) + showHeader :$3 ,//boolean (default: true) + title : $4,//string + icon :$5 ,//sap.ui.core.URI + modal :$6 ,// boolean + offsetX :$7, //int + offsetY :$8, //int + contentWidth : $9,//sap.ui.core.CSSSize + contentHeight :$10, //sap.ui.core.CSSSize + horizontalScrolling :$11, //boolean + verticalScrolling :$12, //boolean + showCloseButton :$13, //boolean (default: true) //Aggregations - content :${14}, //sap.ui.core.Control[] - customHeader :${15}, //sap.m.IBar - subHeader : ${16}, //sap.m.IBar - beginButton :${17}, //sap.m.Button - endButton : ${18}, //sap.m.Button + content :$14, //sap.ui.core.Control[] + customHeader :$15, //sap.m.IBar + subHeader : $16, //sap.m.IBar + beginButton :$17, //sap.m.Button + endButton : $18, //sap.m.Button //Associations - initialFocus : ${19}, //string | sap.ui.core.Control + initialFocus : $19, //string | sap.ui.core.Control //Events - beforeOpen :${20}, //fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject] - afterOpen : ${21}, //fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject] - beforeClose : ${22}, //fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject] - afterClose : ${23} //fnList + beforeOpen :$20, //fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject] + afterOpen : $21, //fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject] + beforeClose : $22, //fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject] + afterClose : $23 //fnList }); snippet sapicon - var ${1} = new sap.ui.core.Icon({ - src :${2} , //sap.ui.core.URI - size :${3} , //sap.ui.core.CSSSize - color :${4} , //sap.ui.core.CSSColor - hoverColor : ${5} , // sap.ui.core.CSSColor - activeColor :${6} , //sap.ui.core.CSSColor - width :${7} , //sap.ui.core.CSSSize - height : ${8} ,//sap.ui.core.CSSSize - backgroundColor :${8} , //sap.ui.core.CSSColor - hoverBackgroundColor :${9} , //sap.ui.core.CSSColor - activeBackgroundColor :${10} , //sap.ui.core.CSSColor - visible :${11} , //boolean (default: true) - decorative : ${12} ,//boolean (default: true) + var $1 = new sap.ui.core.Icon({ + src :$2 , //sap.ui.core.URI + size :$3 , //sap.ui.core.CSSSize + color :$4 , //sap.ui.core.CSSColor + hoverColor : $5 , // sap.ui.core.CSSColor + activeColor :$6 , //sap.ui.core.CSSColor + width :$7 , //sap.ui.core.CSSSize + height : $8 ,//sap.ui.core.CSSSize + backgroundColor :$8 , //sap.ui.core.CSSColor + hoverBackgroundColor :$9 , //sap.ui.core.CSSColor + activeBackgroundColor :$10 , //sap.ui.core.CSSColor + visible :$11 , //boolean (default: true) + decorative : $12 ,//boolean (default: true) }); snippet extendVerticalL - sap.ui.layout.VerticalLayout.extend("${1}", { + sap.ui.layout.VerticalLayout.extend("$1", { metadata: { properties: { - ${2} + $2 }, aggregations: { - ${3} + $3 }, events: { - ${4} + $4 } }, init: function(){ - ${5} + $5 }, - renderer: "${6}" + renderer: "$6" }); snippet extendHorizontalL - sap.ui.layout.HorizontalLayout.extend("${1}", { + sap.ui.layout.HorizontalLayout.extend("$1", { metadata: { properties: { - ${2} + $2 }, aggregations: { - ${3} + $3 }, events: { - ${4} + $4 } }, init: function(){ - ${5} + $5 }, - renderer: "${6}" + renderer: "$6" }); diff --git a/sources_non_forked/vim-snippets/UltiSnips/javascript.snippets b/sources_non_forked/vim-snippets/UltiSnips/javascript.snippets index 8821c5ca..29bf9ed1 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/javascript.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/javascript.snippets @@ -34,18 +34,6 @@ ${1:class_name}.prototype.${2:method_name} = function(${3:first_argument}) { endsnippet -snippet for "for (...) {...} (counting up)" b -for (var ${1:i} = 0, ${2:len} = ${3:Things.length}; $1 < $2; $1++) { - ${VISUAL}$0 -} -endsnippet - -snippet ford "for (...) {...} (counting down, faster)" b -for (var ${2:i} = ${1:Things.length} - 1; $2 >= 0; $2--) { - ${VISUAL}$0 -} -endsnippet - snippet fun "function (fun)" w function ${1:function_name}(${2:argument}) { ${VISUAL}$0 @@ -53,7 +41,7 @@ function ${1:function_name}(${2:argument}) { endsnippet snippet vf "Function assigned to var" -${1:var }${2:function_name} = function $2(${3}) { +${1:var }${2:function_name} = function $2($3) { ${VISUAL}$0 }; endsnippet @@ -84,78 +72,4 @@ for (${1:prop} in ${2:obj}){ } endsnippet -# Snippets for Console Debug Output - -snippet ca "console.assert" b -console.assert(${1:assertion}, ${2:"${3:message}"}); -endsnippet - -snippet cclear "console.clear" b -console.clear(); -endsnippet - -snippet cdir "console.dir" b -console.dir(${1:object}); -endsnippet - -snippet cdirx "console.dirxml" b -console.dirxml(${1:object}); -endsnippet - -snippet ce "console.error" b -console.error(${1:"${2:value}"}); -endsnippet - -snippet cgroup "console.group" b -console.group("${1:label}"); -${VISUAL}$0 -console.groupEnd(); -endsnippet - -snippet cgroupc "console.groupCollapsed" b -console.groupCollapsed("${1:label}"); -${VISUAL}$0 -console.groupEnd(); -endsnippet - -snippet ci "console.info" b -console.info(${1:"${2:value}"}); -endsnippet - -snippet cl "console.log" b -console.log(${1:"${2:value}"}); -endsnippet - -snippet cd "console.debug" b -console.debug(${1:"${2:value}"}); -endsnippet - -snippet cprof "console.profile" b -console.profile("${1:label}"); -${VISUAL}$0 -console.profileEnd(); -endsnippet - -snippet ctable "console.table" b -console.table(${1:"${2:value}"}); -endsnippet - -snippet ctime "console.time" b -console.time("${1:label}"); -${VISUAL}$0 -console.timeEnd("$1"); -endsnippet - -snippet ctimestamp "console.timeStamp" b -console.timeStamp("${1:label}"); -endsnippet - -snippet ctrace "console.trace" b -console.trace(); -endsnippet - -snippet cw "console.warn" b -console.warn(${1:"${2:value}"}); -endsnippet - # vim:ft=snippets: diff --git a/sources_non_forked/vim-snippets/UltiSnips/php-laravel.snippets b/sources_non_forked/vim-snippets/UltiSnips/php-laravel.snippets index de244736..903d8586 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/php-laravel.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/php-laravel.snippets @@ -53,9 +53,9 @@ use Illuminate\Support\ServiceProvider; class ${2:`!v expand('%:t:r')`} extends ServiceProvider { public function register() { - $this->app->bind('${4}Service', function ($app) { - return new ${5}( - $app->make('Repositories\\${6}Interface') + $this->app->bind('$4Service', function ($app) { + return new $5( + $app->make('Repositories\\$6Interface') ); }); } @@ -121,7 +121,7 @@ class ${2:`!v expand('%:t:r')`} extends \Eloquent { public $timestamps = ${5:false}; - protected $hidden = [${6}]; + protected $hidden = [$6]; protected $guarded = [${7:'id'}]; } @@ -208,10 +208,10 @@ snippet l_r "Laravel Repository" b * \date `!v strftime('%d-%m-%y')` */ -namespace ${1:Repositories\\${2}}; +namespace ${1:Repositories\\$2}; -class ${3:`!v expand('%:t:r')`} extends \\${6} implements ${4:$3RepositoryInterface} { - ${7} +class ${3:`!v expand('%:t:r')`} extends \\$6 implements ${4:$3RepositoryInterface} { + $7 } endsnippet @@ -227,7 +227,7 @@ snippet l_s "Laravel Service" b * \date `!v strftime('%d-%m-%y')` */ -namespace Services\\${1}; +namespace Services\\$1; use ${3:Repositories\\${4:Interface}}; @@ -265,6 +265,6 @@ class ${2:`!v expand('%:t:r')`} extends Facade { * * \return string */ - protected static function getFacadeAccessor() { return '${4:${3}Service}'; } + protected static function getFacadeAccessor() { return '${4:$3Service}'; } } endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/php-phpspec.snippets b/sources_non_forked/vim-snippets/UltiSnips/php-phpspec.snippets index 08d84a05..a0acfc3a 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/php-phpspec.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/php-phpspec.snippets @@ -23,15 +23,15 @@ class `!p snip.rv = re.match(r'.*(?=\.)', fn).group() ` extends ObjectBehavior { - function it_${1}() + function it_$1() { - $0 + ${0:${VISUAL}} } } endsnippet snippet it "function it_does_something() { ... }" -function it_${1}() +function it_$1() { ${0:${VISUAL}} } @@ -53,7 +53,7 @@ endsnippet # Object construction snippet cw "$this->beConstructedWith($arg)" -$this->beConstructedWith(${1}); +$this->beConstructedWith($1); endsnippet snippet ct "$this->beConstructedThrough($methodName, [$arg])" @@ -112,44 +112,44 @@ endsnippet # Type matchers snippet stype "$this->shouldHaveType('Type')" -$this->shouldHaveType(${1}); +$this->shouldHaveType($1); endsnippet snippet sntype "$this->shouldNotHaveType('Type')" -$this->shouldNotHaveType(${1}); +$this->shouldNotHaveType($1); endsnippet snippet srinstance "$this->shouldReturnAnInstanceOf('Type')" -$this->shouldReturnAnInstanceOf(${1}); +$this->shouldReturnAnInstanceOf($1); endsnippet snippet snrinstance "$this->shouldNotReturnAnInstanceOf('Type')" -$this->shouldNotReturnAnInstanceOf(${1}); +$this->shouldNotReturnAnInstanceOf($1); endsnippet snippet sbinstance "$this->shouldBeAnInstanceOf('Type')" -$this->shouldBeAnInstanceOf(${1}); +$this->shouldBeAnInstanceOf($1); endsnippet snippet snbinstance "$this->shouldNotBeAnInstanceOf('Type')" -$this->shouldNotBeAnInstanceOf(${1}); +$this->shouldNotBeAnInstanceOf($1); endsnippet snippet simplement "$this->shouldImplement('Type')" -$this->shouldImplement(${1}); +$this->shouldImplement($1); endsnippet snippet snimplement "$this->shouldNotImplement('Type')" -$this->shouldNotImplement(${1}); +$this->shouldNotImplement($1); endsnippet # Object state matchers snippet sbstate "$this->shouldBeXYZ()" -$this->shouldBe${1}(); +$this->shouldBe$1(); endsnippet snippet snbstate "$this->shouldNotBeXYZ()" -$this->shouldNotBe${1}(); +$this->shouldNotBe$1(); endsnippet # Count matchers diff --git a/sources_non_forked/vim-snippets/UltiSnips/php-symfony2.snippets b/sources_non_forked/vim-snippets/UltiSnips/php-symfony2.snippets index 9bca168c..7e3d5804 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/php-symfony2.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/php-symfony2.snippets @@ -67,25 +67,25 @@ endsnippet snippet act "Symfony2 action" b /** - * @Route("${3}", name="${4}") + * @Route("$3", name="$4") * @Method({${5:"POST"}}) * @Template() */ -public function ${1}Action(${2}) +public function $1Action($2) { - ${6} + $6 } endsnippet snippet actt "Symfony2 action and template" b /** - * @Route("${3}", name="${4}") + * @Route("$3", name="$4") * @Method({${5:"GET"}}) * @Template() */ -public function ${1}Action(${2}) +public function $1Action($2) { - ${6} + $6 return []; }`!p relpath = os.path.relpath(path)` @@ -116,8 +116,8 @@ snip.rv = re.match(r'.*(?=\.)', fn).group() { protected function configure() { - $this->setName('${1}') - ->setDescription('${2}') + $this->setName('$1') + ->setDescription('$2') ->setDefinition([ new InputArgument('', InputArgument::REQUIRED, ''), new InputOption('', null, InputOption::VALUE_NONE, ''), @@ -186,14 +186,14 @@ snip.rv = re.match(r'.*(?=\.)', fn).group() /** * {@inheritDoc} */ - public function transform(${1}) + public function transform($1) { } /** * {@inheritDoc} */ - public function reverseTransform(${2}) + public function reverseTransform($2) { } } @@ -279,7 +279,7 @@ snip.rv = re.match(r'.*(?=\.)', fn).group() */ public function getName() { - return '${1}'; + return '$1'; } } endsnippet @@ -307,54 +307,54 @@ snip.rv = re.match(r'.*(?=\.)', fn).group() endsnippet snippet redir "Symfony2 redirect" b -$this->redirect($this->generateUrl('${1}', ${2})); +$this->redirect($this->generateUrl('$1', $2)); endsnippet snippet usecontroller "Symfony2 use Symfony\..\Controller" b -use Symfony\Bundle\FrameworkBundle\Controller\Controller;${1} +use Symfony\Bundle\FrameworkBundle\Controller\Controller;$1 endsnippet snippet usereauest "Symfony2 use Symfony\..\Request" b -use Symfony\Component\HttpFoundation\Request;${1} +use Symfony\Component\HttpFoundation\Request;$1 endsnippet snippet useroute "Symfony2 use Sensio\..\Route" b -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;${1} +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;$1 endsnippet snippet useresponse "Symfony2 use Symfony\..\Response" b -use Symfony\Component\HttpFoundation\Response;${1} +use Symfony\Component\HttpFoundation\Response;$1 endsnippet snippet usefile "Symfony2 use Symfony\..\File" b -use Symfony\Component\HttpFoundation\File\UploadedFile;${1} +use Symfony\Component\HttpFoundation\File\UploadedFile;$1 endsnippet snippet useassert "Symfony2 use Symfony\..\Constraints as Assert" b -use Symfony\Component\Validator\Constraints as Assert;${1} +use Symfony\Component\Validator\Constraints as Assert;$1 endsnippet snippet usetemplate "Symfony2 use Sensio\..\Template" b -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;${1} +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;$1 endsnippet snippet usecache "Symfony2 use Sensio\..\Cache" b -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;${1} +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;$1 endsnippet snippet usemethod "Symfony2 use Sensio\..\Method" b -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;${1} +use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;$1 endsnippet snippet usearray "Symfony2 use Doctrine\..\ArrayCollection" b -use Doctrine\Common\Collections\ArrayCollection;${1} +use Doctrine\Common\Collections\ArrayCollection;$1 endsnippet snippet useorm "Symfony2 use Doctrine\..\Mapping as ORM" b -use Doctrine\ORM\Mapping as ORM;${1} +use Doctrine\ORM\Mapping as ORM;$1 endsnippet snippet usesecure "Symfony2 use JMS\..\Secure" b -use JMS\SecurityExtraBundle\Annotation\Secure;${1} +use JMS\SecurityExtraBundle\Annotation\Secure;$1 endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/php.snippets b/sources_non_forked/vim-snippets/UltiSnips/php.snippets index c7344a59..dde0def9 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/php.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/php.snippets @@ -250,7 +250,7 @@ class `!p snip.rv = re.match(r'.*(?=\.)', fn).group() ` extends \PHPUnit_Framework_TestCase { - public function test${1}() + public function test$1() { ${0:${VISUAL}} } diff --git a/sources_non_forked/vim-snippets/UltiSnips/proto.snippets b/sources_non_forked/vim-snippets/UltiSnips/proto.snippets index 923be578..11e90107 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/proto.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/proto.snippets @@ -32,17 +32,17 @@ endsnippet snippet reqf "Required field" b // ${4:TODO(`whoami`): Describe this field.} -optional ${1}`!p snip.rv = complete(t[1], FIELD_TYPES)` ${2:name} = ${3:1}; // Required +optional $1`!p snip.rv = complete(t[1], FIELD_TYPES)` ${2:name} = ${3:1}; // Required endsnippet snippet optf "Optional field" b // ${4:TODO(`whoami`): Describe this field.} -optional ${1}`!p snip.rv = complete(t[1], FIELD_TYPES)` ${2:name} = ${3:1}; +optional $1`!p snip.rv = complete(t[1], FIELD_TYPES)` ${2:name} = ${3:1}; endsnippet snippet repf "Repeated field" b // ${4:TODO(`whoami`): Describe this field.} -repeated ${1}`!p snip.rv = complete(t[1], FIELD_TYPES)` ${2:name} = ${3:1}; +repeated $1`!p snip.rv = complete(t[1], FIELD_TYPES)` ${2:name} = ${3:1}; endsnippet snippet enum "Enumeration" b diff --git a/sources_non_forked/vim-snippets/UltiSnips/puppet.snippets b/sources_non_forked/vim-snippets/UltiSnips/puppet.snippets index 1b2cfc57..7b39094c 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/puppet.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/puppet.snippets @@ -133,103 +133,103 @@ endsnippet ######################################################################## snippet alert "Alert Function" b -alert("${1:message}")${0} +alert("${1:message}")$0 endsnippet snippet crit "Crit Function" b -crit("${1:message}")${0} +crit("${1:message}")$0 endsnippet snippet debug "Debug Function" b -debug("${1:message}")${0} +debug("${1:message}")$0 endsnippet snippet defined "Defined Function" b -defined(${1:Resource}["${2:name}"])${0} +defined(${1:Resource}["${2:name}"])$0 endsnippet snippet emerg "Emerg Function" b -emerg("${1:message}")${0} +emerg("${1:message}")$0 endsnippet snippet extlookup "Simple Extlookup" b -$${1:Variable} = extlookup("${2:Lookup}")${0} +$${1:Variable} = extlookup("${2:Lookup}")$0 endsnippet snippet extlookup "Extlookup with defaults" b -$${1:Variable} = extlookup("${2:Lookup}", ${3:Default})${0} +$${1:Variable} = extlookup("${2:Lookup}", ${3:Default})$0 endsnippet snippet extlookup "Extlookup with defaults and custom data file" b -$${1:Variable} = extlookup("${2:Lookup}", ${3:Default}, ${4:Data Source})${0} +$${1:Variable} = extlookup("${2:Lookup}", ${3:Default}, ${4:Data Source})$0 endsnippet snippet fail "Fail Function" b -fail("${1:message}")${0} +fail("${1:message}")$0 endsnippet snippet hiera "Hiera Function" b -$${1:Variable} = hiera("${2:Lookup}")${0} +$${1:Variable} = hiera("${2:Lookup}")$0 endsnippet snippet hiera "Hiera with defaults" b -$${1:Variable} = hiera("${2:Lookup}", ${3:Default})${0} +$${1:Variable} = hiera("${2:Lookup}", ${3:Default})$0 endsnippet snippet hiera "Hiera with defaults and override" b -$${1:Variable} = hiera("${2:Lookup}", ${3:Default}, ${4:Override})${0} +$${1:Variable} = hiera("${2:Lookup}", ${3:Default}, ${4:Override})$0 endsnippet snippet hiera_hash "Hiera Hash Function" b -$${1:Variable} = hiera_hash("${2:Lookup}")${0} +$${1:Variable} = hiera_hash("${2:Lookup}")$0 endsnippet snippet hiera_hash "Hiera Hash with defaults" b -$${1:Variable} = hiera_hash("${2:Lookup}", ${3:Default})${0} +$${1:Variable} = hiera_hash("${2:Lookup}", ${3:Default})$0 endsnippet snippet hiera_hash "Hiera Hash with defaults and override" b -$${1:Variable} = hiera_hash("${2:Lookup}", ${3:Default}, ${4:Override})${0} +$${1:Variable} = hiera_hash("${2:Lookup}", ${3:Default}, ${4:Override})$0 endsnippet snippet hiera_include "Hiera Include Function" b -hiera_include("${1:Lookup}")${0} +hiera_include("${1:Lookup}")$0 endsnippet snippet include "Include Function" b -include ${1:classname}${0} +include ${1:classname}$0 endsnippet snippet info "Info Function" b -info("${1:message}")${0} +info("${1:message}")$0 endsnippet snippet inline_template "Inline Template Function" b -inline_template("<%= ${1:template} %>")${0} +inline_template("<%= ${1:template} %>")$0 endsnippet snippet notice "Notice Function" b -notice("${1:message}")${0} +notice("${1:message}")$0 endsnippet snippet realize "Realize Function" b -realize(${1:Resource}["${2:name}"])${0} +realize(${1:Resource}["${2:name}"])$0 endsnippet snippet regsubst "Regsubst Function" b -regsubst($${1:Target}, '${2:regexp}', '${3:replacement}')${0} +regsubst($${1:Target}, '${2:regexp}', '${3:replacement}')$0 endsnippet snippet split "Split Function" b -$${1:Variable} = split($${1:Target}, '${2:regexp}')${0} +$${1:Variable} = split($${1:Target}, '${2:regexp}')$0 endsnippet snippet versioncmp "Version Compare Function" b -$${1:Variable} = versioncmp('${1:version}', '${2:version}')${0} +$${1:Variable} = versioncmp('${1:version}', '${2:version}')$0 endsnippet snippet warning "Warning Function" b -warning("${1:message}")${0} +warning("${1:message}")$0 endsnippet # vim:ft=snippets: diff --git a/sources_non_forked/vim-snippets/UltiSnips/python.snippets b/sources_non_forked/vim-snippets/UltiSnips/python.snippets index 5d8e2641..686226e7 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/python.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/python.snippets @@ -19,7 +19,7 @@ endsnippet snippet with "with" b with ${1:expr}`!p snip.rv = " as " if t[2] else ""`${2:var}: ${3:${VISUAL:pass}} -${0} +$0 endsnippet snippet for "for loop" b diff --git a/sources_non_forked/vim-snippets/UltiSnips/r.snippets b/sources_non_forked/vim-snippets/UltiSnips/r.snippets index 02c4c259..44624b3b 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/r.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/r.snippets @@ -24,11 +24,11 @@ setwd("${1:`!p snip.rv = os.getcwd()`}") endsnippet snippet as "Apply type on variable" w -as.$1`!p snip.rv = complete(t[1], FIELD_TYPES)`(${2}${VISUAL}) +as.$1`!p snip.rv = complete(t[1], FIELD_TYPES)`($2${VISUAL}) endsnippet snippet is "Test type on variable" w -is.$1`!p snip.rv = complete(t[1], FIELD_TYPES)`(${2}${VISUAL}) +is.$1`!p snip.rv = complete(t[1], FIELD_TYPES)`($2${VISUAL}) endsnippet snippet dl "Download and install a package" b @@ -50,51 +50,51 @@ source('${0:file}') endsnippet snippet if "If statement" -if (${1}) { - ${0} +if ($1) { + $0 } endsnippet snippet eif "Else-If statement" -else if (${1}) { - ${0} +else if ($1) { + $0 } endsnippet snippet el "Else statement" else { - ${0} + $0 } endsnippet snippet ife "if .. else" -if (${1}) { - ${2} +if ($1) { + $2 } else { - ${3} + $3 } endsnippet snippet wh "while loop" -while(${1}) { - ${2} +while($1) { + $2 } endsnippet snippet for "for loop" for (${1:item} in ${2:list}) { - ${3} + $3 } endsnippet snippet fun "Function definition" -${1:name} <- function (${2}) { - ${0} +${1:name} <- function ($2) { + $0 } endsnippet snippet ret "Return call" -return(${0}) +return($0) endsnippet snippet df "Data frame" diff --git a/sources_non_forked/vim-snippets/UltiSnips/rails.snippets b/sources_non_forked/vim-snippets/UltiSnips/rails.snippets index e7b2757b..9aefe667 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/rails.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/rails.snippets @@ -22,7 +22,7 @@ class ${1:Model}Controller < ApplicationController $0 private - def find_${2} + def find_$2 @$2 = ${3:$1}.find(params[:id]) if params[:id] end end @@ -253,7 +253,7 @@ after_validation_on_update $0 endsnippet snippet asg "assert(var = assigns(:var))" -assert(${1:var} = assigns(:${1}), "Cannot find @${1}") +assert(${1:var} = assigns(:$1), "Cannot find @$1") $0 endsnippet @@ -270,11 +270,11 @@ end endsnippet snippet artnpp "assert_redirected_to (nested path plural)" -assert_redirected_to ${10:${2:parent}_${3:child}_path(${4:@}${5:${2}})} +assert_redirected_to ${10:${2:parent}_${3:child}_path(${4:@}${5:$2})} endsnippet snippet artnp "assert_redirected_to (nested path)" -assert_redirected_to ${2:${12:parent}_${13:child}_path(${14:@}${15:${12}}, ${16:@}${17:${13}})} +assert_redirected_to ${2:${12:parent}_${13:child}_path(${14:@}${15:$12}, ${16:@}${17:$13})} endsnippet snippet artpp "assert_redirected_to (path plural)" @@ -282,7 +282,7 @@ assert_redirected_to ${10:${2:model}s_path} endsnippet snippet artp "assert_redirected_to (path)" -assert_redirected_to ${2:${12:model}_path(${13:@}${14:${12}})} +assert_redirected_to ${2:${12:model}_path(${13:@}${14:$12})} endsnippet snippet asrj "assert_rjs" @@ -324,7 +324,7 @@ before_validation_on_update endsnippet snippet bt "belongs_to (bt)" -belongs_to :${1:object}${2:, :class_name => "${3:${1/[[:alpha:]]+|(_)/(?1::\u$0)/g}}", :foreign_key => "${4:${1}_id}"} +belongs_to :${1:object}${2:, :class_name => "${3:${1/[[:alpha:]]+|(_)/(?1::\u$0)/g}}", :foreign_key => "${4:$1_id}"} endsnippet snippet crw "cattr_accessor" @@ -358,7 +358,7 @@ endsnippet snippet deftg "def get request" def test_should_get_${1:action} ${2:@${3:model} = ${4:$3s}(:${5:fixture_name}) - }get :${1}${6:, :id => @$3.to_param} + }get :$1${6:, :id => @$3.to_param} assert_response :success $0 end @@ -367,7 +367,7 @@ endsnippet snippet deftp "def post request" def test_should_post_${1:action} ${3:@$2 = ${4:$2s}(:${5:fixture_name}) - }post :${1}${6:, :id => @$2.to_param}, :${2:model} => { $0 } + }post :$1${6:, :id => @$2.to_param}, :${2:model} => { $0 } assert_response :redirect end @@ -400,23 +400,23 @@ end endsnippet snippet habtm "has_and_belongs_to_many (habtm)" -has_and_belongs_to_many :${1:object}${2:, :join_table => "${3:table_name}", :foreign_key => "${4:${1}_id}"} +has_and_belongs_to_many :${1:object}${2:, :join_table => "${3:table_name}", :foreign_key => "${4:$1_id}"} endsnippet snippet hm "has_many (hm)" -has_many :${1:object}s${2:, :class_name => "${1}", :foreign_key => "${4:reference}_id"} +has_many :${1:object}s${2:, :class_name => "$1", :foreign_key => "${4:reference}_id"} endsnippet snippet hmt "has_many (through)" -has_many :${1:objects}, :through => :${2:join_association}${3:, :source => :${4:${2}_table_foreign_key_to_${1}_table}} +has_many :${1:objects}, :through => :${2:join_association}${3:, :source => :${4:$2_table_foreign_key_to_$1_table}} endsnippet snippet hmd "has_many :dependent => :destroy" -has_many :${1:object}s${2:, :class_name => "${1}", :foreign_key => "${4:reference}_id"}, :dependent => :destroy$0 +has_many :${1:object}s${2:, :class_name => "$1", :foreign_key => "${4:reference}_id"}, :dependent => :destroy$0 endsnippet snippet ho "has_one (ho)" -has_one :${1:object}${2:, :class_name => "${3:${1/[[:alpha:]]+|(_)/(?1::\u$0)/g}}", :foreign_key => "${4:${1}_id}"} +has_one :${1:object}${2:, :class_name => "${3:${1/[[:alpha:]]+|(_)/(?1::\u$0)/g}}", :foreign_key => "${4:$1_id}"} endsnippet snippet logd "logger.debug" @@ -514,11 +514,11 @@ redirect_to :controller => "${1:items}", :action => "${2:show}", :id => ${0:@ite endsnippet snippet renpp "redirect_to (nested path plural)" -redirect_to(${2:${10:parent}_${11:child}_path(${12:@}${13:${10}})}) +redirect_to(${2:${10:parent}_${11:child}_path(${12:@}${13:$10})}) endsnippet snippet renp "redirect_to (nested path)" -redirect_to(${2:${12:parent}_${13:child}_path(${14:@}${15:${12}}, ${16:@}${17:${13}})}) +redirect_to(${2:${12:parent}_${13:child}_path(${14:@}${15:$12}, ${16:@}${17:$13})}) endsnippet snippet repp "redirect_to (path plural)" @@ -526,7 +526,7 @@ redirect_to(${2:${10:model}s_path}) endsnippet snippet rep "redirect_to (path)" -redirect_to(${2:${12:model}_path(${13:@}${14:${12}})}) +redirect_to(${2:${12:model}_path(${13:@}${14:$12})}) endsnippet snippet reb "redirect_to :back" @@ -882,12 +882,12 @@ end endsnippet snippet trans "Translation snippet" -I18n.t('`!v substitute(substitute(substitute(@%, substitute(getcwd() . "/", "\/", "\\\\/", "g"), "", ""), "\\(\\.\\(html\\|js\\)\\.\\(haml\\|erb\\)\\|\\(_controller\\)\\?\\.rb\\)$", "", ""), "/", ".", "g")`.${2:${1/[^\w]/_/g}}${3}', :default => "${1:some_text}"${4})${5:$0} +I18n.t('`!v substitute(substitute(substitute(@%, substitute(getcwd() . "/", "\/", "\\\\/", "g"), "", ""), "\\(\\.\\(html\\|js\\)\\.\\(haml\\|erb\\)\\|\\(_controller\\)\\?\\.rb\\)$", "", ""), "/", ".", "g")`.${2:${1/[^\w]/_/g}}$3', :default => "${1:some_text}"$4)${5:$0} endsnippet snippet route_spec it 'routes to #${1:action}' do - ${2:get}('/${3:url}').should route_to('`!v substitute(expand('%:t:r'), '_routing_spec$', '', '')`#$1'${4:, ${5:params}})${6} + ${2:get}('/${3:url}').should route_to('`!v substitute(expand('%:t:r'), '_routing_spec$', '', '')`#$1'${4:, ${5:params}})$6 end endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/rst.snippets b/sources_non_forked/vim-snippets/UltiSnips/rst.snippets index 0596eee1..9a2b4c0c 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/rst.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/rst.snippets @@ -28,7 +28,7 @@ SPECIFIC_ADMONITIONS = ["attention", "caution", "danger", #http://docutils.sourceforge.net/docs/ref/rst/directives.html DIRECTIVES = ['topic','sidebar','math','epigraph', 'parsed-literal','code','highlights', - 'pull-quote','compound','container', + 'pull-quote','compound','container','table','csv-table', 'list-table','class','sectnum', 'role','default-role','unicode', 'raw'] @@ -238,6 +238,7 @@ if di == 'im': if di == 'fi': content=""" :alt: {0} + {0}""".format(real_name) ` ..`!p snip.rv = " %s" % link if link else ""` $1`!p @@ -281,6 +282,23 @@ snippet ro "Text Roles" w path))`:\`$2\`\ endsnippet +snippet eu "Embedded URI" i +`!p +if has_cjk(vim.current.line): + snip.rv = "\ "`\`${1:${VISUAL:Text}} <${2:URI}>\`_`!p +if has_cjk(vim.current.line): + snip.rv ="\ " +else: + snip.rv = "" +`$0 +endsnippet + +snippet fnt "Footnote or Citation" i +[${1:Label}]_ $0 + +.. [$1] ${2:Reference} +endsnippet + ############ # Sphinx # ############ diff --git a/sources_non_forked/vim-snippets/UltiSnips/rust.snippets b/sources_non_forked/vim-snippets/UltiSnips/rust.snippets index 40e76055..482f78e4 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/rust.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/rust.snippets @@ -5,22 +5,22 @@ priority -50 snippet let "let variable declaration" b -let ${1:name}${2:: ${3:type}} = ${4}; +let ${1:name}${2:: ${3:type}} = $4; endsnippet snippet letm "let mut variable declaration" b -let mut ${1:name}${2:: ${3:type}} = ${4}; +let mut ${1:name}${2:: ${3:type}} = $4; endsnippet snippet fn "A function, optionally with arguments and return type." -fn ${1:function_name}(${2})${3/..*/ -> /}${3} { - ${VISUAL}${0} +fn ${1:function_name}($2)${3/..*/ -> /}$3 { + ${VISUAL}$0 } endsnippet snippet pfn "A public function, optionally with arguments and return type." -pub fn ${1:function_name}(${2})${3/..*/ -> /}${3} { - ${VISUAL}${0} +pub fn ${1:function_name}($2)${3/..*/ -> /}$3 { + ${VISUAL}$0 } endsnippet @@ -29,44 +29,44 @@ ${1:a}: ${2:T}${3:, arg} endsnippet snippet || "Closure, anonymous function (inline)" i -${1:move }|${2}| { $3 } +${1:move }|$2| { $3 } endsnippet snippet |} "Closure, anonymous function (block)" i -${1:move }|${2}| { +${1:move }|$2| { $3 } endsnippet snippet pri "print!(..)" b -print!("${1}"${2/..*/, /}${2}); +print!("$1"${2/..*/, /}$2); endsnippet snippet pln "println!(..)" b -println!("${1}"${2/..*/, /}${2}); +println!("$1"${2/..*/, /}$2); endsnippet snippet fmt "format!(..)" -format!("${1}"${2/..*/, /}${2}); +format!("$1"${2/..*/, /}$2); endsnippet snippet macro "macro_rules!" b macro_rules! ${1:name} { (${2:matcher}) => ( - ${3} + $3 ) } endsnippet snippet mod "A module" b mod ${1:`!p snip.rv = snip.basename.lower() or "name"`} { - ${VISUAL}${0} + ${VISUAL}$0 } endsnippet snippet for "for .. in .." b -for ${1:i} in ${2} { - ${VISUAL}${0} +for ${1:i} in $2 { + ${VISUAL}$0 } endsnippet @@ -76,19 +76,19 @@ endsnippet snippet st "Struct" b struct ${1:`!p snip.rv = snip.basename.title() or "Name"`} { - ${VISUAL}${0} + ${VISUAL}$0 } endsnippet # TODO: fancy dynamic field mirroring like Python slotclass snippet stn "Struct with new constructor." b pub struct ${1:`!p snip.rv = snip.basename.title() or "Name"`} { - fd${0} + fd$0 } impl $1 { - pub fn new(${2}) -> $1 { - $1 { ${3} } + pub fn new($2) -> $1 { + $1 { $3 } } } endsnippet @@ -99,7 +99,7 @@ endsnippet snippet impl "Struct/Trait implementation" b impl ${1:Type/Trait}${2: for ${3:Type}} { - ${0} + $0 } endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/supercollider.snippets b/sources_non_forked/vim-snippets/UltiSnips/supercollider.snippets index b8538aa9..3fe8e53f 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/supercollider.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/supercollider.snippets @@ -5,6 +5,6 @@ for (${1:1}, ${2:10}) {${3: |i}|} endsnippet snippet sdef SynthDef(\\${1:synthName}, {${2: |${3:x}|} - ${0} + $0 }).add; endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/tcl.snippets b/sources_non_forked/vim-snippets/UltiSnips/tcl.snippets index 65849157..739098be 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/tcl.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/tcl.snippets @@ -5,21 +5,21 @@ priority -50 ########################################################################### snippet for "for... (for)" b for {${1:set i 0}} {${2:\$i < \$n}} {${3:incr i}} { - ${4} + $4 } endsnippet snippet foreach "foreach... (foreach)" foreach ${1:var} ${2:\$list} { - ${3} + $3 } endsnippet snippet if "if... (if)" b if {${1:condition}} { - ${2} + $2 } endsnippet @@ -27,7 +27,7 @@ endsnippet snippet proc "proc... (proc)" b proc ${1:name} {${2:args}} \ { - ${3} + $3 } endsnippet @@ -35,16 +35,16 @@ endsnippet snippet switch "switch... (switch)" b switch ${1:-exact} -- ${2:\$var} { ${3:match} { - ${4} + $4 } - default {${5}} + default {$5} } endsnippet snippet while "while... (while)" b while {${1:condition}} { - ${2} + $2 } endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/tex.snippets b/sources_non_forked/vim-snippets/UltiSnips/tex.snippets index f43de5ee..9957b3f7 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/tex.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/tex.snippets @@ -53,7 +53,7 @@ snippet desc "Description" b endsnippet snippet it "Individual item" b -\item ${1} +\item $1 $0 endsnippet @@ -61,54 +61,54 @@ snippet part "Part" b \part{${1:part name}} \label{prt:${2:${1/(\w+)|\W+/(?1:\L$0\E:_)/ga}}} -${0} +$0 endsnippet snippet cha "Chapter" b \chapter{${1:chapter name}} \label{cha:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} -${0} +$0 endsnippet snippet sec "Section" b \section{${1:section name}} \label{sec:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} -${0} +$0 endsnippet snippet sub "Subsection" b \subsection{${1:subsection name}} \label{sub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} -${0} +$0 endsnippet snippet ssub "Subsubsection" b \subsubsection{${1:subsubsection name}} \label{ssub:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} -${0} +$0 endsnippet snippet par "Paragraph" b \paragraph{${1:paragraph name}} \label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} -${0} +$0 endsnippet snippet subp "Subparagraph" b \subparagraph{${1:subparagraph name}} \label{par:${2:${1/\\\w+\{(.*?)\}|\\(.)|(\w+)|([^\w\\]+)/(?4:_:\L$1$2$3\E)/ga}}} -${0} +$0 endsnippet snippet ni "Non-indented paragraph" b \noindent -${0} +$0 endsnippet snippet pac "Package" b diff --git a/sources_non_forked/vim-snippets/UltiSnips/vim.snippets b/sources_non_forked/vim-snippets/UltiSnips/vim.snippets index dbb2396d..65a18973 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/vim.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/vim.snippets @@ -13,11 +13,11 @@ snippet guard "script reload guard" b if exists('${1:did_`!p snip.rv = snip.fn.replace('.','_')`}') || &cp${2: || version < 700} finish endif -let $1 = 1${3} +let $1 = 1$3 endsnippet snippet f "function" b -fun ${1:function_name}(${2}) +fun ${1:function_name}($2) ${3:" code} endf endsnippet diff --git a/sources_non_forked/vim-snippets/snippets/actionscript.snippets b/sources_non_forked/vim-snippets/snippets/actionscript.snippets index b7aa7cb3..5d744390 100644 --- a/sources_non_forked/vim-snippets/snippets/actionscript.snippets +++ b/sources_non_forked/vim-snippets/snippets/actionscript.snippets @@ -96,7 +96,7 @@ snippet interface } snippet try try { - ${1} + ${1:${VISUAL}} } catch (error:ErrorType) { ${2} } finally { @@ -115,11 +115,11 @@ snippet forr # If Condition snippet if if (${1:/* condition */}) { - ${0} + ${0:${VISUAL}} } snippet el else { - ${0} + ${0:${VISUAL}} } # Ternary conditional snippet t diff --git a/sources_non_forked/vim-snippets/snippets/ada.snippets b/sources_non_forked/vim-snippets/snippets/ada.snippets index 1039946f..c0ed2801 100644 --- a/sources_non_forked/vim-snippets/snippets/ada.snippets +++ b/sources_non_forked/vim-snippets/snippets/ada.snippets @@ -90,19 +90,19 @@ snippet fors for some snippet if if if ${1} then - ${0} + ${0:${VISUAL}} end if; snippet ife if ... else if ${1} then - ${2} + ${2:${VISUAL}} else ${0} end if; snippet el else else - ${0} + ${0:${VISUAL}} snippet eif elsif elsif ${1} then @@ -110,13 +110,13 @@ snippet eif elsif snippet wh while while ${1} loop - ${0} + ${0:${VISUAL}} end loop; snippet nwh named while ${1}: while ${2} loop - ${0} + ${0:${VISUAL}} end loop $1; snippet for for diff --git a/sources_non_forked/vim-snippets/snippets/apache.snippets b/sources_non_forked/vim-snippets/snippets/apache.snippets index db3256e9..de5672c2 100644 --- a/sources_non_forked/vim-snippets/snippets/apache.snippets +++ b/sources_non_forked/vim-snippets/snippets/apache.snippets @@ -9,22 +9,22 @@ snippet dir # snippet filesmatch - ${0} + ${0:${VISUAL}} # snippet ifmodule - ${0} + ${0:${VISUAL}} # snippet limitexcept - ${0} + ${0:${VISUAL}} # snippet proxy - ${0} + ${0:${VISUAL}} # snippet virtualhost diff --git a/sources_non_forked/vim-snippets/snippets/arduino.snippets b/sources_non_forked/vim-snippets/snippets/arduino.snippets index 6f7f4137..a2732a5e 100644 --- a/sources_non_forked/vim-snippets/snippets/arduino.snippets +++ b/sources_non_forked/vim-snippets/snippets/arduino.snippets @@ -20,7 +20,7 @@ snippet def # if snippet if if (${1:/* condition */}) { - ${2} + ${0:${VISUAL}} } # else snippet el diff --git a/sources_non_forked/vim-snippets/snippets/awk.snippets b/sources_non_forked/vim-snippets/snippets/awk.snippets index 32e56f2f..5c94734a 100644 --- a/sources_non_forked/vim-snippets/snippets/awk.snippets +++ b/sources_non_forked/vim-snippets/snippets/awk.snippets @@ -43,12 +43,12 @@ snippet ign IGNORECASE snippet if if {...} if (${1}) { - ${0} + ${0:${VISUAL}} } snippet ife if ... else ... if (${1}) { - ${2} + ${2:${VISUAL}} } else { ${0} } diff --git a/sources_non_forked/vim-snippets/snippets/c.snippets b/sources_non_forked/vim-snippets/snippets/c.snippets index 524b5b86..ea744d54 100644 --- a/sources_non_forked/vim-snippets/snippets/c.snippets +++ b/sources_non_forked/vim-snippets/snippets/c.snippets @@ -37,7 +37,7 @@ snippet ifdef # if snippet #if #if ${1:FOO} - ${0} + ${0:${VISUAL}} #endif # header include guard snippet once @@ -53,23 +53,23 @@ snippet once # if snippet if if (${1:true}) { - ${0} + ${0:${VISUAL}} } snippet ife if (${1:true}) { - ${2} + ${2:${VISUAL}} } else { ${0} } # else snippet el else { - ${0} + ${0:${VISUAL}} } # else if snippet elif else if (${1:true}) { - ${0} + ${0:${VISUAL}} } # ifi snippet ifi @@ -115,12 +115,12 @@ snippet forr # while snippet wh while (${1:/* condition */}) { - ${2} + ${0:${VISUAL}} } # do... while snippet do do { - ${2} + ${0:${VISUAL}} } while (${1:/* condition */}); ## ## Functions diff --git a/sources_non_forked/vim-snippets/snippets/coffee/coffee.snippets b/sources_non_forked/vim-snippets/snippets/coffee/coffee.snippets index bb964346..f23156cc 100644 --- a/sources_non_forked/vim-snippets/snippets/coffee/coffee.snippets +++ b/sources_non_forked/vim-snippets/snippets/coffee/coffee.snippets @@ -55,17 +55,17 @@ snippet cla class .. extends .. constructor: .. # If snippet if if ${1:condition} - ${0:# body...} + ${0:${VISUAL}} # If __ Else snippet ife if ${1:condition} - ${2:# body...} + ${2:${VISUAL}} else ${0:# body...} # Else if snippet eif else if ${1:condition} - ${0:# body...} + ${0:${VISUAL}} # Ternary If snippet ifte if ${1:condition} then ${2:value} else ${0:other} @@ -84,7 +84,7 @@ snippet log # Try __ Catch snippet try try - ${1} + ${1:${VISUAL}} catch ${2:error} ${0} # Require diff --git a/sources_non_forked/vim-snippets/snippets/crystal.snippets b/sources_non_forked/vim-snippets/snippets/crystal.snippets new file mode 100644 index 00000000..34d25406 --- /dev/null +++ b/sources_non_forked/vim-snippets/snippets/crystal.snippets @@ -0,0 +1,82 @@ +snippet req require + require "${1}" +snippet case + case ${1:object} + when ${2:condition} + ${0} + end +snippet when + when ${1:condition} + ${0} +snippet def + def ${1:method_name} + ${0} + end +snippet pdef + private def ${1:method_name} + ${0} + end +snippet if + if ${1:condition} + ${0:${VISUAL}} + end +snippet ife + if ${1:condition} + ${2:${VISUAL}} + else + ${0} + end +snippet wh + while ${1:condition} + ${0:${VISUAL}} + end +snippet cla class .. end + class ${1:`substitute(vim_snippets#Filename(), "\(_\|^\)\(.\)", "\u\2", "g")`} + ${0} + end +snippet mod class .. end + module ${1:`substitute(vim_snippets#Filename(), "\(_\|^\)\(.\)", "\u\2", "g")`} + ${0} + end +snippet r + getter ${0:name} +snippet r! + getter! ${0:name} +snippet r? + getter? ${0:name} +snippet w + setter ${0:name} +snippet w! + setter! ${0:name} +snippet w? + setter? ${0:name} +snippet rw + property ${0:name} +snippet rw! + property! ${0:name} +snippet rw? + property? ${0:name} +snippet defs + def self.${1:class_method_name} + ${0} + end +snippet defi + def initialize(${1}) + ${0} + end +snippet do + do + ${0:${VISUAL}} + end +snippet dov + do |${1:v}| + ${2} + end +snippet desc + describe ${1:`substitute(substitute(vim_snippets#Filename(), "_spec$", "", ""), "\(_\|^\)\(.\)", "\u\2", "g")`} do + ${0} + end +snippet it + it "${1}" do + ${0} + end diff --git a/sources_non_forked/vim-snippets/snippets/cs.snippets b/sources_non_forked/vim-snippets/snippets/cs.snippets index 40e9c8f9..391984bb 100644 --- a/sources_non_forked/vim-snippets/snippets/cs.snippets +++ b/sources_non_forked/vim-snippets/snippets/cs.snippets @@ -76,15 +76,15 @@ snippet svm # if condition snippet if if (${1:true}) { - ${0} + ${0:${VISUAL}} } snippet el else { - ${0} + ${0:${VISUAL}} } snippet ifs if (${1}) - ${0} + ${0:${VISUAL}} # ternary conditional snippet t ${1} ? ${2} : ${0} @@ -93,12 +93,12 @@ snippet ? # do while loop snippet do do { - ${0} + ${0:${VISUAL}} } while (${1:true}); # while loop snippet wh while (${1:true}) { - ${0} + ${0:${VISUAL}} } # for loop snippet for @@ -451,14 +451,14 @@ snippet switch # try snippet try try { - ${0} + ${0:${VISUAL}} } catch (${1:System.Exception}) { throw; } snippet tryf try { - ${0} + ${0:${VISUAL}} } finally { ${1} diff --git a/sources_non_forked/vim-snippets/snippets/css.snippets b/sources_non_forked/vim-snippets/snippets/css.snippets index c4a74dec..08b6cdf3 100644 --- a/sources_non_forked/vim-snippets/snippets/css.snippets +++ b/sources_non_forked/vim-snippets/snippets/css.snippets @@ -1,8 +1,8 @@ -snippet . +snippet . "selector { }" ${1} { - ${0} + ${0:${VISUAL}} } -snippet ! +snippet ! "!important" !important snippet bdi:m+ -moz-border-image: url(${1}) ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${0:stretch}; @@ -31,9 +31,9 @@ snippet @f } snippet @i @import url(${0}); -snippet @m +snippet @m "@media mediatype { }" @media ${1:print} { - ${0} + ${0:${VISUAL}} } snippet bg+ background: #${1:FFF} url(${2}) ${3:0} ${4:0} ${0:no-repeat}; diff --git a/sources_non_forked/vim-snippets/snippets/d.snippets b/sources_non_forked/vim-snippets/snippets/d.snippets index 216a4d89..e32a2998 100644 --- a/sources_non_forked/vim-snippets/snippets/d.snippets +++ b/sources_non_forked/vim-snippets/snippets/d.snippets @@ -88,13 +88,13 @@ snippet fsw } snippet try try { - ${1} + ${1:${VISUAL}} } catch(${2:Exception} ${3:e}) { ${4} } snippet tcf try { - ${0} + ${0:${VISUAL}} } catch(${1:Exception} ${2:e}) { ${3} } finally { @@ -102,7 +102,7 @@ snippet tcf } snippet wh while(${1:cond}) { - ${0} + ${0:${VISUAL}} } snippet dowh do { diff --git a/sources_non_forked/vim-snippets/snippets/dart.snippets b/sources_non_forked/vim-snippets/snippets/dart.snippets index 0093f2bf..78625c6c 100644 --- a/sources_non_forked/vim-snippets/snippets/dart.snippets +++ b/sources_non_forked/vim-snippets/snippets/dart.snippets @@ -71,12 +71,12 @@ snippet as assert(${0:/* condition */}); snippet try try { - ${0} + ${0:${VISUAL}} } catch (${1:Exception e}) { } snippet tryf try { - ${0} + ${0:${VISUAL}} } catch (${1:Exception e}) { } finally { } diff --git a/sources_non_forked/vim-snippets/snippets/eelixir.snippets b/sources_non_forked/vim-snippets/snippets/eelixir.snippets index 3d6e33d4..6286cee4 100644 --- a/sources_non_forked/vim-snippets/snippets/eelixir.snippets +++ b/sources_non_forked/vim-snippets/snippets/eelixir.snippets @@ -12,11 +12,11 @@ snippet for <% end %> snippet if <%= if ${1} do %> - ${0} + ${0:${VISUAL}} <% end %> snippet ife <%= if ${1} do %> - ${2} + ${2:${VISUAL}} <%= else %> ${0} <% end %> diff --git a/sources_non_forked/vim-snippets/snippets/elixir.snippets b/sources_non_forked/vim-snippets/snippets/elixir.snippets index 058f986c..ccc5fb73 100644 --- a/sources_non_forked/vim-snippets/snippets/elixir.snippets +++ b/sources_non_forked/vim-snippets/snippets/elixir.snippets @@ -1,16 +1,16 @@ snippet do do - ${0} + ${0:${VISUAL}} end snippet if if .. do .. end if ${1} do - ${0} + ${0:${VISUAL}} end snippet if: if .. do: .. if ${1:condition}, do: ${0} snippet ife if .. do .. else .. end if ${1:condition} do - ${2} + ${2:${VISUAL}} else ${0} end @@ -18,13 +18,13 @@ snippet ife: if .. do: .. else: if ${1:condition}, do: ${2}, else: ${0} snippet unless unless .. do .. end unless ${1} do - ${0} + ${0:${VISUAL}} end snippet unless: unless .. do: .. unless ${1:condition}, do: ${0} snippet unlesse unless .. do .. else .. end unless ${1:condition} do - ${2} + ${2:${VISUAL}} else ${0} end @@ -33,7 +33,7 @@ snippet unlesse: unless .. do: .. else: snippet cond cond do ${1} -> - ${0} + ${0:${VISUAL}} end snippet case case ${1} do @@ -143,7 +143,7 @@ snippet exunit end snippet try try .. rescue .. end try do - ${1} + ${1:${VISUAL}} rescue ${2} -> ${0} end diff --git a/sources_non_forked/vim-snippets/snippets/elm.snippets b/sources_non_forked/vim-snippets/snippets/elm.snippets index 6a15c83a..7898d5f3 100644 --- a/sources_non_forked/vim-snippets/snippets/elm.snippets +++ b/sources_non_forked/vim-snippets/snippets/elm.snippets @@ -39,7 +39,7 @@ snippet let ${0} snippet if if ${1} then - ${2} + ${2:${VISUAL}} else ${0} snippet ty diff --git a/sources_non_forked/vim-snippets/snippets/erlang.snippets b/sources_non_forked/vim-snippets/snippets/erlang.snippets index 5440d7c4..bd379f3d 100644 --- a/sources_non_forked/vim-snippets/snippets/erlang.snippets +++ b/sources_non_forked/vim-snippets/snippets/erlang.snippets @@ -46,7 +46,7 @@ snippet fun # try...catch snippet try try - ${1} + ${1:${VISUAL}} catch ${2:_:_} -> ${0:got_some_exception} end diff --git a/sources_non_forked/vim-snippets/snippets/eruby.snippets b/sources_non_forked/vim-snippets/snippets/eruby.snippets index 64f79ef3..b8879c5c 100644 --- a/sources_non_forked/vim-snippets/snippets/eruby.snippets +++ b/sources_non_forked/vim-snippets/snippets/eruby.snippets @@ -120,7 +120,7 @@ snippet sslt <%= stylesheet_link_tag "${0}" %> snippet if <% if ${1} %> - ${0} + ${0:${VISUAL}} <% end %> snippet ife <% if ${1} %> diff --git a/sources_non_forked/vim-snippets/snippets/go.snippets b/sources_non_forked/vim-snippets/snippets/go.snippets index b2bdc9e0..05d80c9b 100644 --- a/sources_non_forked/vim-snippets/snippets/go.snippets +++ b/sources_non_forked/vim-snippets/snippets/go.snippets @@ -30,7 +30,7 @@ snippet ch # case snippet cs case ${1:value}: - ${0} + ${0:${VISUAL}} # const snippet c const ${1:NAME} = ${0:0} @@ -50,7 +50,7 @@ snippet df snippet dfr defer func() { if err := recover(); err != nil { - ${0} + ${0:${VISUAL}} } }() # int @@ -72,18 +72,18 @@ snippet inf # if condition snippet if if ${1:/* condition */} { - ${2} + ${2:${VISUAL}} } snippet ife if ${1:/* condition */} { - ${2} + ${2:${VISUAL}} } else { ${0} } # else snippet snippet el else { - ${1} + ${0:${VISUAL}} } # error snippet snippet ir @@ -106,28 +106,20 @@ snippet f3 # float64 snippet f6 float64 -# if else -snippet ie - if ${1:/* condition */} { - ${2} - } else { - ${3} - } - ${0} # for int loop snippet for for ${1}{ - ${0} + ${0:${VISUAL}} } # for int loop snippet fori for ${2:i} := 0; $2 < ${1:count}; $2${3:++} { - ${0} + ${0:${VISUAL}} } # for range loop snippet forr for ${1:e} := range ${2:collection} { - ${0} + ${0:${VISUAL}} } # function simple snippet fun @@ -225,9 +217,8 @@ snippet ga }(${0}) snippet test test function func Test${1:name}(t *testing.T) { - ${2} + ${0:${VISUAL}} } - ${0} snippet bench benchmark function func Benchmark${1:name}(b *testing.B) { for i := 0; i < b.N; i++ { diff --git a/sources_non_forked/vim-snippets/snippets/haml.snippets b/sources_non_forked/vim-snippets/snippets/haml.snippets index 09217c6c..b8a74e27 100644 --- a/sources_non_forked/vim-snippets/snippets/haml.snippets +++ b/sources_non_forked/vim-snippets/snippets/haml.snippets @@ -27,11 +27,11 @@ snippet mts = mail_to ${1:email_address}, ${2:name}, :subject => ${3}, :body => ${4} snippet ife - if ${1:condition} - ${2} + ${2:${VISUAL}} - else ${0} snippet ifp - if ${1:condition}.presence? - ${0} + ${0:${VISUAL}} snippet ntc = number_to_currency(${1}) diff --git a/sources_non_forked/vim-snippets/snippets/handlebars.snippets b/sources_non_forked/vim-snippets/snippets/handlebars.snippets index d1ab0f03..401dfbdd 100644 --- a/sources_non_forked/vim-snippets/snippets/handlebars.snippets +++ b/sources_non_forked/vim-snippets/snippets/handlebars.snippets @@ -1,14 +1,14 @@ snippet if # {{#if value}} ... {{/if}} {{#if ${1:value}}} - ${0} + ${0:${VISUAL}} {{/if}} snippet ifn # {{#unless value}} ... {{/unless}} {{#unless ${1:value}}} - ${0} + ${0:${VISUAL}} {{/unless}} snippet ife # {{#if value}} ... {{else}} .. {{/if}} {{#if ${1:value}}} - ${2} + ${2:${VISUAL}} {{else}} ${3} {{/if}} diff --git a/sources_non_forked/vim-snippets/snippets/html.snippets b/sources_non_forked/vim-snippets/snippets/html.snippets index 85d0e526..e91b0716 100644 --- a/sources_non_forked/vim-snippets/snippets/html.snippets +++ b/sources_non_forked/vim-snippets/snippets/html.snippets @@ -733,7 +733,7 @@ snippet samp ${0} snippet script - snippet scripts @@ -743,7 +743,7 @@ snippet scriptt ${0} snippet scriptsrc - + snippet section

${0} diff --git a/sources_non_forked/vim-snippets/snippets/htmltornado.snippets b/sources_non_forked/vim-snippets/snippets/htmltornado.snippets index 46f5dab4..1620e11d 100644 --- a/sources_non_forked/vim-snippets/snippets/htmltornado.snippets +++ b/sources_non_forked/vim-snippets/snippets/htmltornado.snippets @@ -43,7 +43,7 @@ snippet set {% set ${1:x} = ${0:y} %} snippet try {% try %} - ${1} + ${1:${VISUAL}} {% except %} ${2} {% finallly %} diff --git a/sources_non_forked/vim-snippets/snippets/java.snippets b/sources_non_forked/vim-snippets/snippets/java.snippets index 39cc850a..66821c16 100644 --- a/sources_non_forked/vim-snippets/snippets/java.snippets +++ b/sources_non_forked/vim-snippets/snippets/java.snippets @@ -163,12 +163,12 @@ snippet ths throws ${0} snippet try try { - ${0} + ${0:${VISUAL}} } catch(${1:Exception} ${2:e}) { } snippet tryf try { - ${0} + ${0:${VISUAL}} } catch(${1:Exception} ${2:e}) { } finally { } diff --git a/sources_non_forked/vim-snippets/snippets/javascript-mocha.snippets b/sources_non_forked/vim-snippets/snippets/javascript-mocha.snippets index cabfd401..eb5c381d 100644 --- a/sources_non_forked/vim-snippets/snippets/javascript-mocha.snippets +++ b/sources_non_forked/vim-snippets/snippets/javascript-mocha.snippets @@ -1,18 +1,34 @@ -snippet des "Describe" b +snippet des "describe('thing', () => { ... })" b describe('${1:}', () => { - ${0} + ${0:${VISUAL}} }); -snippet it "it" b +snippet it "it('should do', () => { ... })" b it('${1:}', () => { - ${0} + ${0:${VISUAL}} }); -snippet xit "xit" b +snippet xit "xit('should do', () => { ... })" b xit('${1:}', () => { - ${0} + ${0:${VISUAL}} }); -snippet exp "expect" b +snippet bef "before(() => { ... })" b + before(() => { + ${0:${VISUAL}} + }); +snippet befe "beforeEach(() => { ... })" b + beforeEach(() => { + ${0:${VISUAL}} + }); +snippet aft "after(() => { ... })" b + after(() => { + ${0:${VISUAL}} + }); +snippet afte "afterEach(() => { ... })" b + afterEach(() => { + ${0:${VISUAL}} + }); +snippet exp "expect(...)" b expect(${1:})${0}; -snippet expe "expect" b +snippet expe "expect(...).to.equal(...)" b expect(${1:}).to.equal(${0}); -snippet expd "expect" b +snippet expd "expect(...).to.deep.equal(...)" b expect(${1:}).to.deep.equal(${0}); diff --git a/sources_non_forked/vim-snippets/snippets/javascript.es6.react.snippets b/sources_non_forked/vim-snippets/snippets/javascript.es6.react.snippets index 0762eb6b..2894ac5d 100644 --- a/sources_non_forked/vim-snippets/snippets/javascript.es6.react.snippets +++ b/sources_non_forked/vim-snippets/snippets/javascript.es6.react.snippets @@ -61,7 +61,7 @@ snippet rdp # Lifecycle Methods snippet rcdm componentDidMount() { - ${0} + ${0:${VISUAL}} } # State diff --git a/sources_non_forked/vim-snippets/snippets/javascript/javascript.es6.snippets b/sources_non_forked/vim-snippets/snippets/javascript/javascript.es6.snippets index a1adedef..7e885e6e 100644 --- a/sources_non_forked/vim-snippets/snippets/javascript/javascript.es6.snippets +++ b/sources_non_forked/vim-snippets/snippets/javascript/javascript.es6.snippets @@ -10,16 +10,16 @@ snippet imm "import { member } from 'xyz'" import { ${1} } from '${2}'; snippet cla class ${1} { - ${0} + ${0:${VISUAL}} } snippet clax class ${1} extends ${2} { - ${0} + ${0:${VISUAL}} } snippet clac class ${1} { constructor(${2}) { - ${0} + ${0:${VISUAL}} } } snippet foro "for (const prop of object}) { ... }" @@ -29,23 +29,23 @@ snippet foro "for (const prop of object}) { ... }" # Generator snippet fun* function* ${1:function_name}(${2}) { - ${0} + ${0:${VISUAL}} } snippet c=> const ${1:function_name} = (${2}) => { - ${0} + ${0:${VISUAL}} } snippet caf const ${1:function_name} = (${2}) => { - ${0} + ${0:${VISUAL}} } snippet => (${1}) => { - ${0} + ${0:${VISUAL}} } snippet af (${1}) => { - ${0} + ${0:${VISUAL}} } snippet sym const ${1} = Symbol('${0}'); diff --git a/sources_non_forked/vim-snippets/snippets/javascript/javascript.snippets b/sources_non_forked/vim-snippets/snippets/javascript/javascript.snippets index 0ac0bfb4..df0669bd 100644 --- a/sources_non_forked/vim-snippets/snippets/javascript/javascript.snippets +++ b/sources_non_forked/vim-snippets/snippets/javascript/javascript.snippets @@ -2,37 +2,37 @@ # prototype snippet proto ${1:class_name}.prototype.${2:method_name} = function(${3}) { - ${0} + ${0:${VISUAL}} }; # Function snippet fun function ${1:function_name}(${2}) { - ${0} + ${0:${VISUAL}} } # Anonymous Function snippet f "" w function(${1}) { - ${0} + ${0:${VISUAL}} } # Anonymous Function assigned to variable snippet vaf var ${1:function_name} = function(${2}) { - ${0} + ${0:${VISUAL}} }; # Function assigned to variable snippet vf var ${1:function_name} = function $1(${2}) { - ${0} + ${0:${VISUAL}} }; # Immediate function snippet (f (function(${1}) { - ${0} + ${0:${VISUAL}} }(${2})); # Minify safe iife snippet ;fe ;(function(${1}) { - ${0} + ${0:${VISUAL}} }(${2})) # self-defining function snippet sdf @@ -40,21 +40,21 @@ snippet sdf ${3} $1 = function ($2) { - ${0} + ${0:${VISUAL}} }; }; # Flow control # if -snippet if +snippet if "if (condition) { ... }" if (${1:true}) { - ${0} + ${0:${VISUAL}} } # if ... else -snippet ife +snippet ife "if (condition) { ... } else { ... }" if (${1:true}) { - ${2} + ${0:${VISUAL}} } else { - ${0} + ${2} } # tertiary conditional snippet ter @@ -69,25 +69,21 @@ snippet switch default: ${2} } -# case -snippet case +snippet case "case 'xyz': ... break" case '${1:case}': - ${2} + ${0:${VISUAL}} break; - ${0} -# try -snippet try +snippet try "try { ... } catch(e) { ... }" try { - ${1} - } catch (${2:e}) { - ${0:/* handle error */} + ${0:${VISUAL}} + } catch (${1:e}) { + ${2:/* handle error */} } -# try finally -snippet tryf +snippet tryf "try { ... } catch(e) { ... } finally { ... }" try { - ${1} - } catch (${2:e}) { - ${0:/* handle error */} + ${0:${VISUAL}} + } catch (${1:e}) { + ${2:/* handle error */} } finally { ${3:/* be executed regardless of the try / catch result*/} } @@ -97,25 +93,21 @@ snippet terr # return snippet ret return ${0:result}; -# for loop -snippet for - for (var ${2:i} = 0, l = ${1:arr}.length; $2 < l; $2++) { - var ${3:v} = $1[$2];${0:} +snippet for "for (...) {...}" + for (var ${1:i} = 0, ${2:len} = ${3:Things.length}; $1 < $2; $1++) { + ${0:${VISUAL}} } -# Reversed for loop -snippet forr - for (var ${2:i} = ${1:arr}.length - 1; $2 >= 0; $2--) { - var ${3:v} = $1[$2];${0:} +snippet forr "reversed for (...) {...}" + for (var ${2:i} = ${1:Things.length} - 1; $2 >= 0; $2--) { + ${0:${VISUAL}} } -# While loop -snippet wh +snippet wh "(condition) { ... }" while (${1:/* condition */}) { - ${0} + ${0:${VISUAL}} } -# Do while loop -snippet do +snippet do "do { ... } while (condition)" do { - ${0} + ${0:${VISUAL}} } while (${1:/* condition */}); # For in loop snippet fori @@ -126,7 +118,7 @@ snippet fori # Object Method snippet :f ${1:method_name}: function (${2:attribute}) { - ${3} + ${0:${VISUAL}} }, # hasOwnProperty snippet has @@ -240,33 +232,46 @@ snippet qsa # Debugging snippet de debugger; -# console.log -snippet cl +snippet cl "console.log" console.log(${0}); -# console.debug -snippet cd +snippet cd "console.debug" console.debug(${0}); -# console.error -snippet ce +snippet ce "console.error" console.error(${0}); -# console.warn -snippet cw +snippet cw "console.warn" console.warn(${0}); -# console.info -snippet ci +snippet ci "console.info" console.info(${0}); -# console.trace -snippet ct +snippet ct "console.trace" console.trace(${0:label}); -# console.time -snippet ctime - console.time(${0:label}); -# console.assert -snippet ca +snippet ctime "console.time ... console.timeEnd" + console.time("${1:label}"); + ${0:${VISUAL}} + console.timeEnd("$1"); +snippet ctimestamp "console.timeStamp" + console.timeStamp("${1:label}"); +snippet ca "console.assert" console.assert(${1:expression}, ${0:obj}); -# console.dir -snippet cdir +snippet cclear "console.clear" + console.clear(); +snippet cdir "console.dir" console.dir(${0:obj}); +snippet cdirx "console.dirxml" + console.dirxml(${1:object}); +snippet cgroup "console.group" + console.group("${1:label}"); + ${0:${VISUAL}} + console.groupEnd(); +snippet cgroupc "console.groupCollapsed" + console.groupCollapsed("${1:label}"); + ${0:${VISUAL}} + console.groupEnd(); +snippet cprof "console.profile" + console.profile("${1:label}"); + ${0:${VISUAL}} + console.profileEnd(); +snippet ctable "console.table" + console.table(${1:"${2:value}"}); # Misc # 'use strict'; snippet us diff --git a/sources_non_forked/vim-snippets/snippets/julia.snippets b/sources_non_forked/vim-snippets/snippets/julia.snippets index 1876ed84..490d050d 100644 --- a/sources_non_forked/vim-snippets/snippets/julia.snippets +++ b/sources_non_forked/vim-snippets/snippets/julia.snippets @@ -75,7 +75,7 @@ snippet tern ternary operator # Exceptions snippet try try catch try - ${1} + ${1:${VISUAL}} catch ${2} ${0} end diff --git a/sources_non_forked/vim-snippets/snippets/ls.snippets b/sources_non_forked/vim-snippets/snippets/ls.snippets index 909b35ee..7c924e64 100644 --- a/sources_non_forked/vim-snippets/snippets/ls.snippets +++ b/sources_non_forked/vim-snippets/snippets/ls.snippets @@ -93,7 +93,7 @@ snippet str # Try __ Catch snippet try try - ${1} + ${1:${VISUAL}} catch ${2:error} ${3} # Require diff --git a/sources_non_forked/vim-snippets/snippets/make.snippets b/sources_non_forked/vim-snippets/snippets/make.snippets index 332d6fc9..9104804d 100644 --- a/sources_non_forked/vim-snippets/snippets/make.snippets +++ b/sources_non_forked/vim-snippets/snippets/make.snippets @@ -27,24 +27,24 @@ snippet print # ifeq snippet if ifeq (${1:cond0}, ${2:cond1}) - ${0} + ${0:${VISUAL}} endif # ifeq ... else ... endif snippet ife ifeq (${1:cond0}, ${2:cond1}) - ${3} + ${3:${VISUAL}} else ${0} endif # else ... snippet el else - ${0} + ${0:${VISUAL}} # .DEFAULT_GOAL := target snippet default .DEFAULT_GOAL := ${1} # help target for self-documented Makefile snippet help help: ## Prints help for targets with comments - @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $\$1, $\$2}' + @cat $(MAKEFILE_LIST) | grep -E '^[a-zA-Z_-]+:.*?## .*$$' | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $\$1, $\$2}' ${0} diff --git a/sources_non_forked/vim-snippets/snippets/mako.snippets b/sources_non_forked/vim-snippets/snippets/mako.snippets index 2264eac6..659caf77 100644 --- a/sources_non_forked/vim-snippets/snippets/mako.snippets +++ b/sources_non_forked/vim-snippets/snippets/mako.snippets @@ -30,7 +30,7 @@ snippet ife if/else % endif snippet try % try: - ${1:} + ${1:${VISUAL}} % except${2:}: ${0:pass} % endtry diff --git a/sources_non_forked/vim-snippets/snippets/mustache.snippets b/sources_non_forked/vim-snippets/snippets/mustache.snippets index ad8723ed..cf589406 100644 --- a/sources_non_forked/vim-snippets/snippets/mustache.snippets +++ b/sources_non_forked/vim-snippets/snippets/mustache.snippets @@ -1,14 +1,14 @@ snippet if # {{#value}} ... {{/value}} {{#${1:value}}} - ${0} + ${0:${VISUAL}} {{/$1}} snippet ifn # {{^value}} ... {{/value}} {{^${1:value}}} - ${0} + ${0:${VISUAL}} {{/$1}} snippet ife # {{#value}} ... {{/value}} {{^value}} ... {{/value}} {{#${1:value}}} - ${2} + ${2:${VISUAL}} {{/$1}} {{^$1}} ${3} diff --git a/sources_non_forked/vim-snippets/snippets/php.snippets b/sources_non_forked/vim-snippets/snippets/php.snippets index 2d9f5152..52572da9 100644 --- a/sources_non_forked/vim-snippets/snippets/php.snippets +++ b/sources_non_forked/vim-snippets/snippets/php.snippets @@ -1,7 +1,7 @@ snippet snippet ?f - ${0} + ${0:${VISUAL}} snippet ?i - ${0} + ${0:${VISUAL}} snippet ns namespace ${1:Foo\Bar\Baz}; - ${0} + + ${0:${VISUAL}} snippet c class ${1:`vim_snippets#Filename()`} { - ${0} + ${0:${VISUAL}} } snippet i interface ${1:`vim_snippets#Filename()`} { - ${0} + ${0:${VISUAL}} } snippet t. $this-> snippet f function ${1}(${3}) { - ${0} + ${0:${VISUAL}} } # method snippet m ${1:protected} function ${2:foo}() { - ${0} + ${0:${VISUAL}} } snippet sm "PHP Class Setter" /** @@ -158,7 +159,7 @@ snippet doc_c */ ${1:}class ${2:} { - ${0} + ${0:${VISUAL}} } // END $1class $2 # Constant Definition - post doc snippet doc_dp @@ -232,7 +233,7 @@ snippet interface */ interface ${1:`vim_snippets#Filename()`} { - ${0} + ${0:${VISUAL}} } # Trait snippet trait @@ -244,7 +245,7 @@ snippet trait */ trait ${1:`vim_snippets#Filename()`} { - ${0} + ${0:${VISUAL}} } # class ... snippet class @@ -267,7 +268,7 @@ snippet nc ${2:abstract }class ${3:`vim_snippets#Filename()`} { - ${0} + ${0:${VISUAL}} } # define(...) snippet def "define('VARIABLE_NAME', 'definition')" @@ -277,45 +278,43 @@ snippet def? ${1}defined('${2}') snippet wh "while (condition) { ... }" while (${1:/* condition */}) { - ${0} + ${0:${VISUAL}} } snippet do "do { ... } while (condition)" do { - ${0} + ${0:${VISUAL}} } while (${1}); snippet if "if (condition) { ... }" if (${1}) { - ${0} + ${0:${VISUAL}} } snippet ifn "if (!condition) { ... }" if (!${1}) { - ${2} + ${0:${VISUAL}} } snippet ifil " ... " - ${0} + ${0:${VISUAL}} snippet ife "if (cond) { ... } else { ... }" if (${1}) { - ${2} + ${0:${VISUAL}} } else { - ${3} + ${2} } - ${0} snippet ifeil " ... ... " - ${2} + ${0:${VISUAL}} - ${3} + ${2} - ${0} snippet el "else { ... }" else { - ${0} + ${0:${VISUAL}} } snippet eif "elseif(condition) { ... }" elseif (${1}) { - ${0} + ${0:${VISUAL}} } snippet switch "switch($var) { case 'xyz': ... default: .... }" switch ($${1:variable}) { @@ -329,23 +328,23 @@ snippet switch "switch($var) { case 'xyz': ... default: .... }" } snippet case "case 'value': ... break" case '${1:value}': - ${2} + ${0:${VISUAL}} break; snippet for "for ($i = 0; $i < $count; $i++) { ... }" for ($${2:i} = 0; $$2 < ${1:count}; $$2${3:++}) { - ${0} + ${0:${VISUAL}} } snippet foreach "foreach ($var as $value) { .. }" foreach ($${1:variable} as $${2:value}) { - ${0} + ${0:${VISUAL}} } snippet foreachil " ... " - ${0} + ${0:${VISUAL}} snippet foreachk "foreach ($var as $key => $value) { .. }" foreach ($${1:variable} as $${2:key} => $${3:value}) { - ${0} + ${0:${VISUAL}} } snippet foreachkil " $value): ?> ... " $${3:value}): ?> @@ -355,7 +354,7 @@ snippet array "$... = ['' => ]" $${1:arrayName} = ['${2}' => ${3}]; snippet try "try { ... } catch (Exception $e) { ... }" try { - ${0} + ${0:${VISUAL}} } catch (${1:Exception} $e) { } # lambda with closure @@ -590,48 +589,70 @@ snippet CSVIterator } // end class # phpunit -snippet ase "$this->assertEquals()" - $this->assertEquals(${1:expected}, ${2:actual}); -snippet asne "$this->assertNotEquals()" - $this->assertNotEquals(${1:expected}, ${2:actual}); -snippet asf "$this->assertFalse()" +snippet ase "$this->assertEquals($a, $b)" + $this->assertEquals(${1:$expected}, ${2:$actual}); +snippet asne "$this->assertNotEquals($a, $b)" + $this->assertNotEquals(${1:$expected}, ${2:$actual}); +snippet asf "$this->assertFalse($a)" $this->assertFalse(${1}); -snippet ast "$this->assertTrue()" +snippet ast "$this->assertTrue($a)" $this->assertTrue(${1}); -snippet asfex "$this->assertFileExists()" +snippet asfex "$this->assertFileExists('path/to/file')" $this->assertFileExists(${1:'path/to/file'}); -snippet asfnex "$this->assertFileNotExists()" +snippet asfnex "$this->assertFileNotExists('path/to/file')" $this->assertFileNotExists(${1:'path/to/file'}); -snippet ascon "$this->assertContains()" +snippet ascon "$this->assertContains($needle, $haystack)" $this->assertContains(${1:$needle}, ${2:$haystack}); -snippet ashk "$this->assertArrayHasKey()" +snippet asncon "$this->assertNotContains($needle, $haystack)" + $this->assertNotContains(${1:$needle}, ${2:$haystack}); +snippet ascono "$this->assertContainsOnly($needle, $haystack)" + $this->assertContainsOnly(${1:$needle}, ${2:$haystack}); +snippet asconoi "$this->assertContainsOnlyInstancesOf(Example::class, $haystack)" + $this->assertContainsOnlyInstancesOf(${1:Example}::class, ${2:$haystack}); +snippet ashk "$this->assertArrayHasKey($key, $array)" $this->assertArrayHasKey(${1:$key}, ${2:$array}); -snippet asnhk "$this->assertArrayNotHasKey()" +snippet asnhk "$this->assertArrayNotHasKey($key, $array)" this->assertArrayNotHasKey(${1:$key}, ${2:$array}); -snippet ascha "$this->assertClassHasAttribute()" - $this->assertClassHasAttribute(${1:$attributeName}, '${2:$className}'); -snippet asi "$this->assertInstanceOf(...)" - $this->assertInstanceOf(${1:expected}, ${2:actual}); +snippet ascha "$this->assertClassHasAttribute($name, Example::class)" + $this->assertClassHasAttribute(${1:$attributeName}, ${2:Example}::class); +snippet asi "$this->assertInstanceOf(Example::class, $actual)" + $this->assertInstanceOf(${1:Example}::class, ${2:$actual}); +snippet ast "$this->assertInternalType('string', $actual)" + $this->assertInternalType(${1:'string'}, ${2:actual}); +snippet asco "$this->assertCount($count, $haystack)" + $this->assertCount(${1:$expectedCount}, ${2:$haystack}); +snippet asnco "$this->assertNotCount($count, $haystack)" + $this->assertNotCount(${1:$count}, ${2:$haystack}); +snippet assub "$this->assertArraySubset($subset, $array)" + $this->assertArraySubset(${1:$subset}, ${2:$array}); +snippet asnu "$this->assertNull($a)" + $this->assertNull(${1}); +snippet asnnu "$this->assertNotNull($a)" + $this->assertNotNull(${1}); snippet test "public function testXYZ() { ... }" public function test${1}() { - ${0} + ${0:${VISUAL}} } snippet setup "protected function setUp() { ... }" protected function setUp() { - ${0} + ${0:${VISUAL}} } snippet teardown "protected function tearDown() { ... }" protected function tearDown() { - ${0} + ${0:${VISUAL}} } +snippet proph "$observer = $this->prophesize(SomeClass::class);" + $${1:observer} = $this->prophesize(${2:SomeClass}::class); +snippet mock "$mock = $this->createMock(SomeClass::class);" + $${1:mock} = $this->createMock(${2:SomeClass}::class); snippet exp "phpunit expects" expects($this->${1:once}()) ->method('${2}') - ->with($this->equalTo(${3})${4}) - ->will($this->returnValue(${5})); + ->with(${3}) + ->willReturn(${4}); snippet testcmt "phpunit comment with group" /** * @group ${1} diff --git a/sources_non_forked/vim-snippets/snippets/processing.snippets b/sources_non_forked/vim-snippets/snippets/processing.snippets index 015af4a5..798e5458 100644 --- a/sources_non_forked/vim-snippets/snippets/processing.snippets +++ b/sources_non_forked/vim-snippets/snippets/processing.snippets @@ -93,13 +93,13 @@ snippet switch #try snippet try try { - ${0} + ${0:${VISUAL}} } catch(${1:Exception} ${2:e}) { } #try catch finally snippet tryf try { - ${0} + ${0:${VISUAL}} } catch(${1:Exception} ${2:e}) { } finally { } diff --git a/sources_non_forked/vim-snippets/snippets/python.snippets b/sources_non_forked/vim-snippets/snippets/python.snippets index 0f68acbd..b32ef0a8 100644 --- a/sources_non_forked/vim-snippets/snippets/python.snippets +++ b/sources_non_forked/vim-snippets/snippets/python.snippets @@ -23,7 +23,7 @@ snippet docs snippet wh while ${1:condition}: - ${0} + ${0:${VISUAL}} # dowh - does the same as do...while in other languages snippet dowh while True: @@ -32,7 +32,7 @@ snippet dowh break snippet with with ${1:expr} as ${2:var}: - ${0} + ${0:${VISUAL}} # New Class snippet cl class ${1:ClassName}(${2:object}): @@ -68,13 +68,13 @@ snippet property # Ifs snippet if if ${1:condition}: - ${0} + ${0:${VISUAL}} snippet el else: - ${0} + ${0:${VISUAL}} snippet ei elif ${1:condition}: - ${0} + ${0:${VISUAL}} # For snippet for for ${1:item} in ${2:items}: @@ -93,27 +93,27 @@ snippet . self. snippet try Try/Except try: - ${1} - except ${2:Exception}, ${3:e}: + ${1:${VISUAL}} + except ${2:Exception} as ${3:e}: ${0:raise $3} snippet try Try/Except/Else try: - ${1} - except ${2:Exception}, ${3:e}: + ${1:${VISUAL}} + except ${2:Exception} as ${3:e}: ${4:raise $3} else: ${0} snippet try Try/Except/Finally try: - ${1} - except ${2:Exception}, ${3:e}: + ${1:${VISUAL}} + except ${2:Exception} as ${3:e}: ${4:raise $3} finally: ${0} snippet try Try/Except/Else/Finally try: - ${1} - except ${2:Exception}, ${3:e}: + ${1:${VISUAL}} + except ${2:Exception} as ${3:e}: ${4:raise $3} else: ${5} diff --git a/sources_non_forked/vim-snippets/snippets/rst.snippets b/sources_non_forked/vim-snippets/snippets/rst.snippets index b1852458..dd47863e 100644 --- a/sources_non_forked/vim-snippets/snippets/rst.snippets +++ b/sources_non_forked/vim-snippets/snippets/rst.snippets @@ -85,9 +85,9 @@ snippet toc: ${0} snippet dow: - :download:`${0:text} <${1:path}>` + :download:\`${0:text} <${1:path}>\` snippet ref: - :ref:`${0:text} <${1:path}>` + :ref:\`${0:text} <${1:path}>\` snippet doc: :doc:`${0:text} <${1:path}>` # CJK optimize, CJK has no space between charaters diff --git a/sources_non_forked/vim-snippets/snippets/ruby.snippets b/sources_non_forked/vim-snippets/snippets/ruby.snippets index 772f4644..9dc984fd 100644 --- a/sources_non_forked/vim-snippets/snippets/ruby.snippets +++ b/sources_non_forked/vim-snippets/snippets/ruby.snippets @@ -39,7 +39,7 @@ snippet case end snippet when when ${1:condition} - ${0} + ${0:${VISUAL}} snippet def def ${1:method_name} ${0} @@ -56,17 +56,17 @@ snippet descendants end snippet if if ${1:condition} - ${0} + ${0:${VISUAL}} end snippet ife if ${1:condition} - ${2} + ${2:${VISUAL}} else ${0} end snippet eif elsif ${1:condition} - ${0} + ${0:${VISUAL}} snippet ifee if ${1:condition} $2 @@ -77,7 +77,7 @@ snippet ifee end snippet unless unless ${1:condition} - ${0} + ${0:${VISUAL}} end snippet unlesse unless ${1:condition} @@ -95,7 +95,7 @@ snippet unlesee end snippet wh while ${1:condition} - ${0} + ${0:${VISUAL}} end snippet for for ${1:e} in ${2:c} @@ -103,7 +103,7 @@ snippet for end snippet until until ${1:condition} - ${0} + ${0:${VISUAL}} end snippet cla class .. end class ${1:`substitute(vim_snippets#Filename(), '\(_\|^\)\(.\)', '\u\2', 'g')`} diff --git a/sources_non_forked/vim-snippets/snippets/rust.snippets b/sources_non_forked/vim-snippets/snippets/rust.snippets index 20532f73..2a353e49 100644 --- a/sources_non_forked/vim-snippets/snippets/rust.snippets +++ b/sources_non_forked/vim-snippets/snippets/rust.snippets @@ -32,7 +32,7 @@ snippet main "Main function" ${0} } snippet let "let variable declaration with type inference" - let ${1} = ${2}; + let ${1} = ${2}; snippet lett "let variable declaration with explicit type annotation" let ${1}: ${2} = ${3}; snippet letm "let mut variable declaration with type inference" @@ -88,21 +88,21 @@ snippet res "Result" # Control structures snippet if if ${1} { - ${0} + ${0:${VISUAL}} } snippet ife "if / else" if ${1} { - ${2} + ${2:${VISUAL}} } else { ${0} } snippet el "else" else { - ${0} + ${0:${VISUAL}} } snippet eli "else if" else if ${1} { - ${0} + ${0:${VISUAL}} } snippet mat "match pattern" match ${1} { @@ -112,11 +112,11 @@ snippet case "Case clause of pattern match" ${1:_} => ${2:expression} snippet loop "loop {}" b loop { - ${0} + ${0:${VISUAL}} } snippet wh "while loop" while ${1:condition} { - ${0} + ${0:${VISUAL}} } snippet for "for ... in ... loop" for ${1:i} in ${2} { diff --git a/sources_non_forked/vim-snippets/snippets/sass.snippets b/sources_non_forked/vim-snippets/snippets/sass.snippets index 7207360c..3e84c20e 100644 --- a/sources_non_forked/vim-snippets/snippets/sass.snippets +++ b/sources_non_forked/vim-snippets/snippets/sass.snippets @@ -1,14 +1,12 @@ -extends css - snippet $ $${1:variable}: ${0:value} snippet imp @import '${0}' snippet mix - @mixin ${1:name}(${2}) + =${1:name}(${2}) ${0} snippet inc - @include ${1:mixin}(${2}) + +${1:mixin}(${2}) snippet ext @extend ${0} snippet fun @@ -16,15 +14,15 @@ snippet fun ${0} snippet if @if ${1:condition} - ${0} + ${0:${VISUAL}} snippet ife @if ${1:condition} - ${2} + ${2:${VISUAL}} @else ${0} snippet eif @else if ${1:condition} - ${0} + ${0:${VISUAL}} snippet for @for ${1:$i} from ${2:1} through ${3:3} ${0} @@ -33,4 +31,985 @@ snippet each ${0} snippet while @while ${1:$i} ${2:>} ${3:0} + ${0:${VISUAL}} +snippet ! + !important +snippet bdi:m+ + -moz-border-image: url('${1}') ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${0:stretch} +snippet bdi:m + -moz-border-image: ${0} +snippet bdrz:m + -moz-border-radius: ${0} +snippet bxsh:m+ + -moz-box-shadow: ${1:0} ${2:0} ${3:0} #${0:000} +snippet bxsh:m + -moz-box-shadow: ${0} +snippet bdi:w+ + -webkit-border-image: url('${1}') ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${0:stretch} +snippet bdi:w + -webkit-border-image: ${0} +snippet bdrz:w + -webkit-border-radius: ${0} +snippet bxsh:w+ + -webkit-box-shadow: ${1:0} ${2:0} ${3:0} #${0:000} +snippet bxsh:w + -webkit-box-shadow: ${0} +snippet @f + @font-face + font-family: ${1} + src: url('${0}') +snippet @i + @import url('${0}') +snippet @m + @media ${1:print} ${0} +snippet bg+ + background: #${1:fff} url('${2}') ${3:0} ${4:0} ${0:no-repeat} +snippet bga + background-attachment: ${0} +snippet bga:f + background-attachment: fixed +snippet bga:s + background-attachment: scroll +snippet bgbk + background-break: ${0} +snippet bgbk:bb + background-break: bounding-box +snippet bgbk:c + background-break: continuous +snippet bgbk:eb + background-break: each-box +snippet bgcp + background-clip: ${0} +snippet bgcp:bb + background-clip: border-box +snippet bgcp:cb + background-clip: content-box +snippet bgcp:nc + background-clip: no-clip +snippet bgcp:pb + background-clip: padding-box +snippet bgc + background-color: #${0:fff} +snippet bgc:t + background-color: transparent +snippet bgi + background-image: url('${0}') +snippet bgi:n + background-image: none +snippet bgo + background-origin: ${0} +snippet bgo:bb + background-origin: border-box +snippet bgo:cb + background-origin: content-box +snippet bgo:pb + background-origin: padding-box +snippet bgpx + background-position-x: ${0} +snippet bgpy + background-position-y: ${0} +snippet bgp + background-position: ${1:0} ${0:0} +snippet bgr + background-repeat: ${0} +snippet bgr:n + background-repeat: no-repeat +snippet bgr:x + background-repeat: repeat-x +snippet bgr:y + background-repeat: repeat-y +snippet bgr:r + background-repeat: repeat +snippet bgz + background-size: ${0} +snippet bgz:a + background-size: auto +snippet bgz:ct + background-size: contain +snippet bgz:cv + background-size: cover +snippet bg + background: ${0} +snippet bg:ie + filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='${1}',sizingMethod='${0:crop}') +snippet bg:n + background: none +snippet bd+ + border: ${1:1px} ${2:solid} #${0:000} +snippet bdb+ + border-bottom: ${1:1px} ${2:solid} #${0:000} +snippet bdbc + border-bottom-color: #${0:000} +snippet bdbi + border-bottom-image: url('${0}') +snippet bdbi:n + border-bottom-image: none +snippet bdbli + border-bottom-left-image: url('${0}') +snippet bdbli:c + border-bottom-left-image: continue +snippet bdbli:n + border-bottom-left-image: none +snippet bdblrz + border-bottom-left-radius: ${0} +snippet bdbri + border-bottom-right-image: url('${0}') +snippet bdbri:c + border-bottom-right-image: continue +snippet bdbri:n + border-bottom-right-image: none +snippet bdbrrz + border-bottom-right-radius: ${0} +snippet bdbs + border-bottom-style: ${0} +snippet bdbs:n + border-bottom-style: none +snippet bdbw + border-bottom-width: ${0} +snippet bdb + border-bottom: ${0} +snippet bdb:n + border-bottom: none +snippet bdbk + border-break: ${0} +snippet bdbk:c + border-break: close +snippet bdcl + border-collapse: ${0} +snippet bdcl:c + border-collapse: collapse +snippet bdcl:s + border-collapse: separate +snippet bdc + border-color: #${0:000} +snippet bdci + border-corner-image: url('${0}') +snippet bdci:c + border-corner-image: continue +snippet bdci:n + border-corner-image: none +snippet bdf + border-fit: ${0} +snippet bdf:c + border-fit: clip +snippet bdf:of + border-fit: overwrite +snippet bdf:ow + border-fit: overwrite +snippet bdf:r + border-fit: repeat +snippet bdf:sc + border-fit: scale +snippet bdf:sp + border-fit: space +snippet bdf:st + border-fit: stretch +snippet bdi + border-image: url('${1}') ${2:0} ${3:0} ${4:0} ${5:0} ${6:stretch} ${0:stretch} +snippet bdi:n + border-image: none +snippet bdl+ + border-left: ${1:1px} ${2:solid} #${0:000} +snippet bdlc + border-left-color: #${0:000} +snippet bdli + border-left-image: url('${0}') +snippet bdli:n + border-left-image: none +snippet bdls + border-left-style: ${0} +snippet bdls:n + border-left-style: none +snippet bdlw + border-left-width: ${0} +snippet bdl + border-left: ${0} +snippet bdl:n + border-left: none +snippet bdlt + border-length: ${0} +snippet bdlt:a + border-length: auto +snippet bdrz + border-radius: ${0} +snippet bdr+ + border-right: ${1:1px} ${2:solid} #${0:000} +snippet bdrc + border-right-color: #${0:000} +snippet bdri + border-right-image: url('${0}') +snippet bdri:n + border-right-image: none +snippet bdrs + border-right-style: ${0} +snippet bdrs:n + border-right-style: none +snippet bdrw + border-right-width: ${0} +snippet bdr + border-right: ${0} +snippet bdr:n + border-right: none +snippet bdsp + border-spacing: ${0} +snippet bds + border-style: ${0} +snippet bds:ds + border-style: dashed +snippet bds:dtds + border-style: dot-dash +snippet bds:dtdtds + border-style: dot-dot-dash +snippet bds:dt + border-style: dotted +snippet bds:db + border-style: double +snippet bds:g + border-style: groove +snippet bds:h + border-style: hidden +snippet bds:i + border-style: inset +snippet bds:n + border-style: none +snippet bds:o + border-style: outset +snippet bds:r + border-style: ridge +snippet bds:s + border-style: solid +snippet bds:w + border-style: wave +snippet bdt+ + border-top: ${1:1px} ${2:solid} #${0:000} +snippet bdtc + border-top-color: #${0:000} +snippet bdti + border-top-image: url('${0}') +snippet bdti:n + border-top-image: none +snippet bdtli + border-top-left-image: url('${0}') +snippet bdtli:c + border-corner-image: continue +snippet bdtli:n + border-corner-image: none +snippet bdtlrz + border-top-left-radius: ${0} +snippet bdtri + border-top-right-image: url('${0}') +snippet bdtri:c + border-top-right-image: continue +snippet bdtri:n + border-top-right-image: none +snippet bdtrrz + border-top-right-radius: ${0} +snippet bdts + border-top-style: ${0} +snippet bdts:n + border-top-style: none +snippet bdtw + border-top-width: ${0} +snippet bdt + border-top: ${0} +snippet bdt:n + border-top: none +snippet bdw + border-width: ${0} +snippet bd + border: ${0} +snippet bd:n + border: none +snippet b + bottom: ${0} +snippet b:a + bottom: auto +snippet bxsh+ + box-shadow: ${1:0} ${2:0} ${3:0} #${0:000} +snippet bxsh + box-shadow: ${0} +snippet bxsh:n + box-shadow: none +snippet bxz + box-sizing: ${0} +snippet bxz:bb + box-sizing: border-box +snippet bxz:cb + box-sizing: content-box +snippet cps + caption-side: ${0} +snippet cps:b + caption-side: bottom +snippet cps:t + caption-side: top +snippet cl + clear: ${0} +snippet cl:b + clear: both +snippet cl:l + clear: left +snippet cl:n + clear: none +snippet cl:r + clear: right +snippet cp + clip: ${0} +snippet cp:a + clip: auto +snippet cp:r + clip: rect(${1:0} ${2:0} ${3:0} ${0:0}) +snippet c + color: #${0:000} +snippet ct + content: ${0} +snippet ct:a + content: attr(${0}) +snippet ct:cq + content: close-quote +snippet ct:c + content: counter(${0}) +snippet ct:cs + content: counters(${0}) +snippet ct:ncq + content: no-close-quote +snippet ct:noq + content: no-open-quote +snippet ct:n + content: normal +snippet ct:oq + content: open-quote +snippet coi + counter-increment: ${0} +snippet cor + counter-reset: ${0} +snippet cur + cursor: ${0} +snippet cur:a + cursor: auto +snippet cur:c + cursor: crosshair +snippet cur:d + cursor: default +snippet cur:ha + cursor: hand +snippet cur:he + cursor: help +snippet cur:m + cursor: move +snippet cur:p + cursor: pointer +snippet cur:t + cursor: text +snippet d + display: ${0} +snippet d:mib + display: -moz-inline-box +snippet d:mis + display: -moz-inline-stack +snippet d:b + display: block +snippet d:cp + display: compact +snippet d:ib + display: inline-block +snippet d:itb + display: inline-table +snippet d:i + display: inline +snippet d:li + display: list-item +snippet d:n + display: none +snippet d:ri + display: run-in +snippet d:tbcp + display: table-caption +snippet d:tbc + display: table-cell +snippet d:tbclg + display: table-column-group +snippet d:tbcl + display: table-column +snippet d:tbfg + display: table-footer-group +snippet d:tbhg + display: table-header-group +snippet d:tbrg + display: table-row-group +snippet d:tbr + display: table-row +snippet d:tb + display: table +snippet ec + empty-cells: ${0} +snippet ec:h + empty-cells: hide +snippet ec:s + empty-cells: show +snippet exp + expression() +snippet fl + float: ${0} +snippet fl:l + float: left +snippet fl:n + float: none +snippet fl:r + float: right +snippet f+ + font: ${1:1em} ${2:Arial},${0:sans-serif} +snippet fef + font-effect: ${0} +snippet fef:eb + font-effect: emboss +snippet fef:eg + font-effect: engrave +snippet fef:n + font-effect: none +snippet fef:o + font-effect: outline +snippet femp + font-emphasize-position: ${0} +snippet femp:a + font-emphasize-position: after +snippet femp:b + font-emphasize-position: before +snippet fems + font-emphasize-style: ${0} +snippet fems:ac + font-emphasize-style: accent +snippet fems:c + font-emphasize-style: circle +snippet fems:ds + font-emphasize-style: disc +snippet fems:dt + font-emphasize-style: dot +snippet fems:n + font-emphasize-style: none +snippet fem + font-emphasize: ${0} +snippet ff + font-family: ${0} +snippet ff:c + font-family: ${0:'Monotype Corsiva','Comic Sans MS'},cursive +snippet ff:f + font-family: ${0:Capitals,Impact},fantasy +snippet ff:m + font-family: ${0:Monaco,'Courier New'},monospace +snippet ff:ss + font-family: ${0:Helvetica,Arial},sans-serif +snippet ff:s + font-family: ${0:Georgia,'Times New Roman'},serif +snippet fza + font-size-adjust: ${0} +snippet fza:n + font-size-adjust: none +snippet fz + font-size: ${0} +snippet fsm + font-smooth: ${0} +snippet fsm:aw + font-smooth: always +snippet fsm:a + font-smooth: auto +snippet fsm:n + font-smooth: never +snippet fst + font-stretch: ${0} +snippet fst:c + font-stretch: condensed +snippet fst:e + font-stretch: expanded +snippet fst:ec + font-stretch: extra-condensed +snippet fst:ee + font-stretch: extra-expanded +snippet fst:n + font-stretch: normal +snippet fst:sc + font-stretch: semi-condensed +snippet fst:se + font-stretch: semi-expanded +snippet fst:uc + font-stretch: ultra-condensed +snippet fst:ue + font-stretch: ultra-expanded +snippet fs + font-style: ${0} +snippet fs:i + font-style: italic +snippet fs:n + font-style: normal +snippet fs:o + font-style: oblique +snippet fv + font-variant: ${0} +snippet fv:n + font-variant: normal +snippet fv:sc + font-variant: small-caps +snippet fw + font-weight: ${0} +snippet fw:b + font-weight: bold +snippet fw:br + font-weight: bolder +snippet fw:lr + font-weight: lighter +snippet fw:n + font-weight: normal +snippet f + font: ${0} +snippet h + height: ${0} +snippet h:a + height: auto +snippet l + left: ${0} +snippet l:a + left: auto +snippet lts + letter-spacing: ${0} +snippet lh + line-height: ${0} +snippet lisi + list-style-image: url('${0}') +snippet lisi:n + list-style-image: none +snippet lisp + list-style-position: ${0} +snippet lisp:i + list-style-position: inside +snippet lisp:o + list-style-position: outside +snippet list + list-style-type: ${0} +snippet list:c + list-style-type: circle +snippet list:dclz + list-style-type: decimal-leading-zero +snippet list:dc + list-style-type: decimal +snippet list:d + list-style-type: disc +snippet list:lr + list-style-type: lower-roman +snippet list:n + list-style-type: none +snippet list:s + list-style-type: square +snippet list:ur + list-style-type: upper-roman +snippet lis + list-style: ${0} +snippet lis:n + list-style: none +snippet mb + margin-bottom: ${0} +snippet mb:a + margin-bottom: auto +snippet ml + margin-left: ${0} +snippet ml:a + margin-left: auto +snippet mr + margin-right: ${0} +snippet mr:a + margin-right: auto +snippet mt + margin-top: ${0} +snippet mt:a + margin-top: auto +snippet m + margin: ${0} +snippet m:4 + margin: ${1:0} ${2:0} ${3:0} ${0:0} +snippet m:3 + margin: ${1:0} ${2:0} ${0:0} +snippet m:2 + margin: ${1:0} ${0:0} +snippet m:0 + margin: 0 +snippet m:a + margin: auto +snippet mah + max-height: ${0} +snippet mah:n + max-height: none +snippet maw + max-width: ${0} +snippet maw:n + max-width: none +snippet mih + min-height: ${0} +snippet miw + min-width: ${0} +snippet op + opacity: ${0} +snippet op:ie + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=${0:100}) +snippet op:ms + -ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=${0:100})' +snippet orp + orphans: ${0} +snippet o+ + outline: ${1:1px} ${2:solid} #${0:000} +snippet oc + outline-color: ${0:#000} +snippet oc:i + outline-color: invert +snippet oo + outline-offset: ${0} +snippet os + outline-style: ${0} +snippet ow + outline-width: ${0} +snippet o + outline: ${0} +snippet o:n + outline: none +snippet ovs + overflow-style: ${0} +snippet ovs:a + overflow-style: auto +snippet ovs:mq + overflow-style: marquee +snippet ovs:mv + overflow-style: move +snippet ovs:p + overflow-style: panner +snippet ovs:s + overflow-style: scrollbar +snippet ovx + overflow-x: ${0} +snippet ovx:a + overflow-x: auto +snippet ovx:h + overflow-x: hidden +snippet ovx:s + overflow-x: scroll +snippet ovx:v + overflow-x: visible +snippet ovy + overflow-y: ${0} +snippet ovy:a + overflow-y: auto +snippet ovy:h + overflow-y: hidden +snippet ovy:s + overflow-y: scroll +snippet ovy:v + overflow-y: visible +snippet ov + overflow: ${0} +snippet ov:a + overflow: auto +snippet ov:h + overflow: hidden +snippet ov:s + overflow: scroll +snippet ov:v + overflow: visible +snippet pb + padding-bottom: ${0} +snippet pl + padding-left: ${0} +snippet pr + padding-right: ${0} +snippet pt + padding-top: ${0} +snippet p + padding: ${0} +snippet p:4 + padding: ${1:0} ${2:0} ${3:0} ${0:0} +snippet p:3 + padding: ${1:0} ${2:0} ${0:0} +snippet p:2 + padding: ${1:0} ${0:0} +snippet p:0 + padding: 0 +snippet pgba + page-break-after: ${0} +snippet pgba:aw + page-break-after: always +snippet pgba:a + page-break-after: auto +snippet pgba:l + page-break-after: left +snippet pgba:r + page-break-after: right +snippet pgbb + page-break-before: ${0} +snippet pgbb:aw + page-break-before: always +snippet pgbb:a + page-break-before: auto +snippet pgbb:l + page-break-before: left +snippet pgbb:r + page-break-before: right +snippet pgbi + page-break-inside: ${0} +snippet pgbi:a + page-break-inside: auto +snippet pgbi:av + page-break-inside: avoid +snippet pos + position: ${0} +snippet pos:a + position: absolute +snippet pos:f + position: fixed +snippet pos:r + position: relative +snippet pos:s + position: static +snippet q + quotes: ${0} +snippet q:en + quotes: '\201C' '\201D' '\2018' '\2019' +snippet q:n + quotes: none +snippet q:ru + quotes: '\00AB' '\00BB' '\201E' '\201C' +snippet rz + resize: ${0} +snippet rz:b + resize: both +snippet rz:h + resize: horizontal +snippet rz:n + resize: none +snippet rz:v + resize: vertical +snippet r + right: ${0} +snippet r:a + right: auto +snippet tbl + table-layout: ${0} +snippet tbl:a + table-layout: auto +snippet tbl:f + table-layout: fixed +snippet tal + text-align-last: ${0} +snippet tal:a + text-align-last: auto +snippet tal:c + text-align-last: center +snippet tal:l + text-align-last: left +snippet tal:r + text-align-last: right +snippet ta + text-align: ${0} +snippet ta:c + text-align: center +snippet ta:l + text-align: left +snippet ta:r + text-align: right +snippet td + text-decoration: ${0} +snippet td:l + text-decoration: line-through +snippet td:n + text-decoration: none +snippet td:o + text-decoration: overline +snippet td:u + text-decoration: underline +snippet te + text-emphasis: ${0} +snippet te:ac + text-emphasis: accent +snippet te:a + text-emphasis: after +snippet te:b + text-emphasis: before +snippet te:c + text-emphasis: circle +snippet te:ds + text-emphasis: disc +snippet te:dt + text-emphasis: dot +snippet te:n + text-emphasis: none +snippet th + text-height: ${0} +snippet th:a + text-height: auto +snippet th:f + text-height: font-size +snippet th:m + text-height: max-size +snippet th:t + text-height: text-size +snippet ti + text-indent: ${0} +snippet ti:- + text-indent: -9999px +snippet tj + text-justify: ${0} +snippet tj:a + text-justify: auto +snippet tj:d + text-justify: distribute +snippet tj:ic + text-justify: inter-cluster +snippet tj:ii + text-justify: inter-ideograph +snippet tj:iw + text-justify: inter-word +snippet tj:k + text-justify: kashida +snippet tj:t + text-justify: tibetan +snippet to+ + text-outline: ${1:0} ${2:0} #${0:000} +snippet to + text-outline: ${0} +snippet to:n + text-outline: none +snippet tr + text-replace: ${0} +snippet tr:n + text-replace: none +snippet tsh+ + text-shadow: ${1:0} ${2:0} ${3:0} #${0:000} +snippet tsh + text-shadow: ${0} +snippet tsh:n + text-shadow: none +snippet tt + text-transform: ${0} +snippet tt:c + text-transform: capitalize +snippet tt:l + text-transform: lowercase +snippet tt:n + text-transform: none +snippet tt:u + text-transform: uppercase +snippet tw + text-wrap: ${0} +snippet tw:no + text-wrap: none +snippet tw:n + text-wrap: normal +snippet tw:s + text-wrap: suppress +snippet tw:u + text-wrap: unrestricted +snippet t + top: ${0} +snippet t:a + top: auto +snippet va + vertical-align: ${0} +snippet va:bl + vertical-align: baseline +snippet va:b + vertical-align: bottom +snippet va:m + vertical-align: middle +snippet va:sub + vertical-align: sub +snippet va:sup + vertical-align: super +snippet va:tb + vertical-align: text-bottom +snippet va:tt + vertical-align: text-top +snippet va:t + vertical-align: top +snippet v + visibility: ${0} +snippet v:c + visibility: collapse +snippet v:h + visibility: hidden +snippet v:v + visibility: visible +snippet whsc + white-space-collapse: ${0} +snippet whsc:ba + white-space-collapse: break-all +snippet whsc:bs + white-space-collapse: break-strict +snippet whsc:k + white-space-collapse: keep-all +snippet whsc:l + white-space-collapse: loose +snippet whsc:n + white-space-collapse: normal +snippet whs + white-space: ${0} +snippet whs:n + white-space: normal +snippet whs:nw + white-space: nowrap +snippet whs:pl + white-space: pre-line +snippet whs:pw + white-space: pre-wrap +snippet whs:p + white-space: pre +snippet wid + widows: ${0} +snippet w + width: ${0} +snippet w:a + width: auto +snippet wob + word-break: ${0} +snippet wob:ba + word-break: break-all +snippet wob:bs + word-break: break-strict +snippet wob:k + word-break: keep-all +snippet wob:l + word-break: loose +snippet wob:n + word-break: normal +snippet wos + word-spacing: ${0} +snippet wow + word-wrap: ${0} +snippet wow:no + word-wrap: none +snippet wow:n + word-wrap: normal +snippet wow:s + word-wrap: suppress +snippet wow:u + word-wrap: unrestricted +snippet z + z-index: ${0} +snippet z:a + z-index: auto +snippet zoo + zoom: 1 +snippet :h + :hover +snippet :fc + :first-child +snippet :lc + :last-child +snippet :nc + :nth-child(${0}) +snippet :nlc + :nth-last-child(${0}) +snippet :oc + :only-child +snippet :a + :after +snippet :b + :before +snippet ::a + ::after +snippet ::b + ::before diff --git a/sources_non_forked/vim-snippets/snippets/scala.snippets b/sources_non_forked/vim-snippets/snippets/scala.snippets index 003081ef..a6c3f3c7 100644 --- a/sources_non_forked/vim-snippets/snippets/scala.snippets +++ b/sources_non_forked/vim-snippets/snippets/scala.snippets @@ -7,30 +7,30 @@ #if snippet if if (${1}) - ${0} + ${0:${VISUAL}} #if not snippet ifn if (!${1}) - ${0} + ${0:${VISUAL}} #if-else snippet ife if (${1}) - ${2} + ${2:${VISUAL}} else ${0} #if-else-if snippet ifelif if (${1}) - ${2} + ${2:${VISUAL}} else if (${3}) - ${0} + ${0:${VISUAL}} snippet eif else if (${3}) - ${0} + ${0:${VISUAL}} #while loop snippet wh while (${1:obj}) { - ${0} + ${0:${VISUAL}} } #for loop(classic) snippet for @@ -50,7 +50,7 @@ snippet fory #exceptions snippet try try { - ${1} + ${1:${VISUAL}} } catch { case e: FileNotFoundException => ${2} case e: IOException => ${3} diff --git a/sources_non_forked/vim-snippets/snippets/sh.snippets b/sources_non_forked/vim-snippets/snippets/sh.snippets index e470a2ab..12f8115a 100644 --- a/sources_non_forked/vim-snippets/snippets/sh.snippets +++ b/sources_non_forked/vim-snippets/snippets/sh.snippets @@ -12,26 +12,26 @@ snippet sbash snippet if if [[ ${1:condition} ]]; then - ${0:#statements} + ${0:${VISUAL}} fi snippet elif elif [[ ${1:condition} ]]; then - ${0:#statements} + ${0:${VISUAL}} snippet for for (( ${2:i} = 0; $2 < ${1:count}; $2++ )); do - ${0:#statements} + ${0:${VISUAL}} done snippet fori for ${1:needle} in ${2:haystack} ; do - ${0:#statements} + ${0:${VISUAL}} done snippet wh while [[ ${1:condition} ]]; do - ${0:#statements} + ${0:${VISUAL}} done snippet until until [[ ${1:condition} ]]; do - ${0:#statements} + ${0:${VISUAL}} done snippet case case ${1:word} in diff --git a/sources_non_forked/vim-snippets/snippets/tex.snippets b/sources_non_forked/vim-snippets/snippets/tex.snippets index 05ec852c..c095b5a4 100644 --- a/sources_non_forked/vim-snippets/snippets/tex.snippets +++ b/sources_non_forked/vim-snippets/snippets/tex.snippets @@ -86,11 +86,11 @@ snippet enumi enumerate environment \\item ${0} \\end{enumerate} # Itemize -snippet itemize itemize environment +snippet item itemize environment \\begin{itemize} \\item ${0} \\end{itemize} -snippet item \item +snippet it \item \\item ${1:${VISUAL}} # Description snippet desc description environment @@ -259,6 +259,13 @@ snippet subfig subfigure environment \\label{fig:${5}} \\end{subfigure} ${0} +snippet tikzcd tikzcd environment + \begin{equation} + \begin{tikzcd} + ${1} + \end{tikzcd} + \end{equation} + ${0} #math snippet stackrel \stackrel{}{} \\stackrel{${1:above}}{${2:below}} ${0} diff --git a/sources_non_forked/vim-snippets/snippets/twig.snippets b/sources_non_forked/vim-snippets/snippets/twig.snippets index 47997c3b..d0d7e1c9 100644 --- a/sources_non_forked/vim-snippets/snippets/twig.snippets +++ b/sources_non_forked/vim-snippets/snippets/twig.snippets @@ -1,6 +1,6 @@ snippet bl "{% block xyz %} .. {% endblock xyz %}" {% block ${1} %} - ${2} + ${2:${VISUAL}} {% endblock $1 %} snippet js "{% javascripts 'xyz' %} .. {% endjavascripts %}" {% javascripts '${1}' %} @@ -12,17 +12,17 @@ snippet css "{% stylesheets 'xyz' %} .. {% endstylesheets %}" {% endstylesheets %} snippet if "{% if %} .. {% endif %}" {% if ${1} %} - ${2} + ${2:${VISUAL}} {% endif %} snippet ife "{% if %} .. {% else %} .. {% endif %}" {% if ${1} %} - ${2} + ${2:${VISUAL}} {% else %} ${0} {% endif %} snippet el "{% else %}" {% else %} - ${0} + ${0:${VISUAL}} snippet eif "{% elseif %}" {% elseif ${1} %} ${0} diff --git a/sources_non_forked/vim-snippets/snippets/vim.snippets b/sources_non_forked/vim-snippets/snippets/vim.snippets index b299f512..c604d9a6 100644 --- a/sources_non_forked/vim-snippets/snippets/vim.snippets +++ b/sources_non_forked/vim-snippets/snippets/vim.snippets @@ -14,13 +14,13 @@ snippet f function endf snippet t try ... catch statement try - ${1} + ${1:${VISUAL}} catch ${2} ${0} endtry snippet for for ... in loop for ${1} in ${2} - ${0} + ${0:${VISUAL}} endfor snippet forkv for [key, value] in loop for [${1},${2}] in items(${3}) @@ -29,15 +29,15 @@ snippet forkv for [key, value] in loop endfor snippet wh while loop while ${1} - ${0} + ${0:${VISUAL}} endw snippet if if statement if ${1} - ${0} + ${0:${VISUAL}} endif snippet ife if ... else statement if ${1} - ${2} + ${2:${VISUAL}} else ${0} endif diff --git a/sources_non_forked/vim-snippets/snippets/zsh.snippets b/sources_non_forked/vim-snippets/snippets/zsh.snippets index fc1c8374..a8173c26 100644 --- a/sources_non_forked/vim-snippets/snippets/zsh.snippets +++ b/sources_non_forked/vim-snippets/snippets/zsh.snippets @@ -4,40 +4,40 @@ snippet #! snippet if if ${1:condition}; then - ${0:# statements} + ${0:${VISUAL}} fi snippet ife if ${1:condition}; then - ${2:# statements} + ${2:${VISUAL}} else ${0:# statements} fi snippet eif elif ${1:condition}; then - ${0:# statements} + ${0:${VISUAL}} snippet for for (( ${2:i} = 0; $2 < ${1:count}; $2++ )); do - ${0:# statements} + ${0:${VISUAL}} done snippet fori for ${1:needle} in ${2:haystack}; do - ${0:#statements} + ${0:${VISUAL}} done snippet fore for ${1:item} in ${2:list}; do - ${0:# statements} + ${0:${VISUAL}} done snippet wh while ${1:condition}; do - ${0:# statements} + ${0:${VISUAL}} done snippet until until ${1:condition}; do - ${0:# statements} + ${0:${VISUAL}} done snippet repeat repeat ${1:integer}; do - ${0:# statements} + ${0:${VISUAL}} done snippet case case ${1:word} in @@ -46,7 +46,7 @@ snippet case esac snippet select select ${1:answer} in ${2:choices}; do - ${0:# statements} + ${0:${VISUAL}} done snippet ( ( ${0:#statements} )