diff --git a/sources_non_forked/ack.vim/autoload/ack.vim b/sources_non_forked/ack.vim/autoload/ack.vim index 82d3de65..dbf84572 100644 --- a/sources_non_forked/ack.vim/autoload/ack.vim +++ b/sources_non_forked/ack.vim/autoload/ack.vim @@ -1,3 +1,7 @@ +if exists('g:autoloaded_ack') || &cp + finish +endif + if exists('g:ack_use_dispatch') if g:ack_use_dispatch && !exists(':Dispatch') call s:Warn('Dispatch not loaded! Falling back to g:ack_use_dispatch = 0.') @@ -238,4 +242,5 @@ function! s:Warn(msg) "{{{ echohl WarningMsg | echomsg 'Ack: ' . a:msg | echohl None endf "}}} +let g:autoloaded_ack = 1 " vim:set et sw=2 ts=2 tw=78 fdm=marker diff --git a/sources_non_forked/ack.vim/doc/ack.txt b/sources_non_forked/ack.vim/doc/ack.txt index 750f7c5a..33939516 100644 --- a/sources_non_forked/ack.vim/doc/ack.txt +++ b/sources_non_forked/ack.vim/doc/ack.txt @@ -4,6 +4,10 @@ Author: Antoine Imbert *ack-author* License: Same terms as Vim itself (see |license|) +This plugin is only available if 'compatible' is not set. + +{Vi does not have any of this} + ============================================================================== INTRODUCTION *ack* @@ -16,7 +20,7 @@ shows the results in a split window. Search recursively in {directory} (which defaults to the current directory) for the {pattern}. Behaves just like the |:grep| command, but will open the |Quickfix| window for you. If [!] is not given the first - occurence is jumped to. + occurrence is jumped to. :AckAdd [options] {pattern} [{directory}] *:AckAdd* @@ -90,7 +94,6 @@ Example: > let g:ackprg = "ag --vimgrep" < - *g:ack_default_options* g:ack_default_options Default: " -s -H --nocolor --nogroup --column" @@ -107,18 +110,17 @@ Example: let g:ack_default_options = \ " -s -H --nocolor --nogroup --column --smart-case --follow" < - *g:ack_apply_qmappings* g:ack_apply_qmappings Default: 1 -This option enable mappings on quickview window. +This option enables mappings on the |quickfix| window. *g:ack_apply_lmappings* g:ack_apply_lmappings Default: 1 -This option enable mappings on Location list window. +This option enables mappings on |location-list| windows. *g:ack_mappings* g:ack_mappings @@ -139,7 +141,6 @@ Example, if you want to open the result in the middle of the screen: > let g:ack_mappings = { "o": "zz" } < - *g:ack_qhandler* g:ack_qhandler Default: "botright copen" @@ -150,7 +151,6 @@ If you want to open a quickview window with 30 lines you can do: > let g:ack_qhandler = "botright copen 30" < - *g:ack_lhandler* g:ack_lhandler Default: "botright lopen" @@ -161,9 +161,7 @@ If you want to open a Location list window with 30 lines you can do: > let g:ack_lhandler = "botright lopen 30" < - *g:ackhighlight* - g:ackhighlight Default: 0 @@ -173,7 +171,6 @@ Example: > let g:ackhighlight = 1 < - *g:ack_autoclose* g:ack_autoclose Default: 0 @@ -185,9 +182,7 @@ Example: > let g:ack_autoclose = 1 < - *g:ack_autofold_results* - g:ack_autofold_results Default: 0 @@ -200,9 +195,7 @@ Example: > let g:ack_autofold_results = 1 < - *g:ackpreview* - g:ackpreview Default: 0 @@ -212,9 +205,7 @@ Example: > let g:ackpreview = 1 < - *g:ack_use_dispatch* - g:ack_use_dispatch Default: 0 @@ -229,9 +220,7 @@ Example: > let g:ack_use_dispatch = 1 < - *g:ack_use_cword_for_empty_search* - g:ack_use_cword_for_empty_search Default: 1 @@ -239,34 +228,76 @@ Use this option to enable blank searches to run against the word under the cursor. When this option is not set, blank searches will only output an error message. - Example: > let g:ack_use_cword_for_empty_search = 0 < - - ============================================================================== MAPPINGS *ack-mappings* -The following keyboard shortcuts are available in the quickfix window: +The following keyboard shortcuts are available in the |quickfix| and +|location-list| windows: -o open file (same as enter). +? display a quick summary of these mappings. -O open file and close quickfix window. +o open file (same as Enter). + +O open file and close the quickfix window. go preview file (open but maintain focus on ack.vim results). t open in a new tab. -T open in new tab silently. +T open in new tab without moving to it. h open in horizontal split. -H open in horizontal split silently. +H open in horizontal split, keeping focus on the results. v open in vertical split. -gv open in vertical split silently. +gv open in vertical split, keeping focus on the results. q close the quickfix window. + +To adjust these, see |g:ack_mappings|. + +============================================================================== +Ignoring files *ack-ignore* + +If you're using this plugin with ag, The Silver Searcher, bear in mind that: + + - It ignores file patterns from your .gitignore and .hgignore. + + - If there are other files in your source repository you don't wish to + search, you can add their patterns to an .agignore file. + +============================================================================== +ISSUES AND FAQ *ack-issues-and-faq* + +I use NERDTree and opening ack.vim results in a vertical split displaces it.~ + + You are probably using NERDTree with its default alignment at the left + side of the window. Set these custom mappings in your vimrc to work around + this: +> + let g:ack_mappings = { + \ 'v': 'LpJp', + \ 'gv': 'LpJ' } +< + This solution will be improved in the future. + +Results show a mix of relative and absolute paths, making them hard to read.~ + + This is a quirk of Vim that can happen with plain |:vimgrep| too. You can + try this in your vimrc to work around it: +> + autocmd BufAdd * exe "cd" fnameescape(getcwd()) +< + but for some users this may be disruptive to their Vim workflow. For more + details, see: + + http://vi.stackexchange.com/a/4816/7174 + https://github.com/mileszs/ack.vim/issues/143 + +vim:set et sw=4 ts=4 tw=78: diff --git a/sources_non_forked/ack.vim/plugin/ack.vim b/sources_non_forked/ack.vim/plugin/ack.vim index 8d18f569..202ae2ea 100644 --- a/sources_non_forked/ack.vim/plugin/ack.vim +++ b/sources_non_forked/ack.vim/plugin/ack.vim @@ -1,4 +1,4 @@ -if exists('g:loaded_ack') +if exists('g:loaded_ack') || &cp finish endif diff --git a/sources_non_forked/ag.vim/README.md b/sources_non_forked/ag.vim/README.md index 9e43262a..e02a4d3e 100644 --- a/sources_non_forked/ag.vim/README.md +++ b/sources_non_forked/ag.vim/README.md @@ -1,5 +1,7 @@ # ag.vim # +## Deprecated: See [this comment](https://github.com/rking/ag.vim/issues/124#issuecomment-227038003) for more info. Maybe try [ack.vim](https://github.com/mileszs/ack.vim#can-i-use-ag-the-silver-searcher-with-this) as an alternative. ## + This plugin is a front for ag, A.K.A. [the_silver_searcher](https://github.com/ggreer/the_silver_searcher). Ag can be used as a replacement for 153% of the uses of `ack`. This plugin will allow diff --git a/sources_non_forked/ctrlp.vim/autoload/ctrlp.vim b/sources_non_forked/ctrlp.vim/autoload/ctrlp.vim index d8601794..04f1aa85 100644 --- a/sources_non_forked/ctrlp.vim/autoload/ctrlp.vim +++ b/sources_non_forked/ctrlp.vim/autoload/ctrlp.vim @@ -93,6 +93,7 @@ let [s:pref, s:bpref, s:opts, s:new_opts, s:lc_opts] = \ 'open_single_match': ['s:opensingle', []], \ 'brief_prompt': ['s:brfprt', 0], \ 'match_current_file': ['s:matchcrfile', 0], + \ 'match_natural_name': ['s:matchnatural', 0], \ 'compare_lim': ['s:compare_lim', 3000], \ 'bufname_mod': ['s:bufname_mod', ':t'], \ 'bufpath_mod': ['s:bufpath_mod', ':~:.:h'], @@ -425,7 +426,7 @@ fu! s:UserCmd(lscmd) let do_ign = \ type(s:usrcmd) == 4 && has_key(s:usrcmd, 'ignore') && s:usrcmd['ignore'] if do_ign && ctrlp#igncwd(s:cwd) | retu | en - if exists('+ssl') && &ssl + if exists('+ssl') && &ssl && &shell !~ 'sh' let [ssl, &ssl, path] = [&ssl, 0, tr(path, '/', '\')] en if (has('win32') || has('win64')) && match(&shellcmdflag, "/") != -1 @@ -653,9 +654,9 @@ fu! s:Update(str) endf fu! s:ForceUpdate() - let wv = winsaveview() + let pos = exists('*getcurpos') ? getcurpos() : getpos('.') sil! cal s:Update(escape(s:getinput(), '\')) - cal winrestview(wv) + cal setpos('.', pos) endf fu! s:BuildPrompt(upd) @@ -839,9 +840,9 @@ fu! s:PrtSelectMove(dir) let wht = winheight(0) let dirs = {'t': 'gg','b': 'G','j': 'j','k': 'k','u': wht.'k','d': wht.'j'} exe 'keepj norm!' dirs[a:dir] - let wv = winsaveview() + let pos = exists('*getcurpos') ? getcurpos() : getpos('.') cal s:BuildPrompt(0) - cal winrestview(wv) + cal setpos('.', pos) endf fu! s:PrtSelectJump(char) @@ -864,9 +865,9 @@ fu! s:PrtSelectJump(char) let [jmpln, s:jmpchr] = [npos == -1 ? pos : npos, [chr, npos]] en exe 'keepj norm!' ( jmpln + 1 ).'G' - let wv = winsaveview() + let pos = exists('*getcurpos') ? getcurpos() : getpos('.') cal s:BuildPrompt(0) - cal winrestview(wv) + cal setpos('.', pos) en endf " Misc {{{2 @@ -907,6 +908,7 @@ fu! s:PrtDeleteMRU() endf fu! s:PrtExit() + exe bufwinnr(s:bufnr).'winc w' if bufnr('%') == s:bufnr && bufname('%') == 'ControlP' noa cal s:Close(1) noa winc p @@ -1822,7 +1824,7 @@ fu! s:highlight(pat, grp) " occurrence of our letters. We also ensure that our matcher is case " insensitive or sensitive depending. cal matchadd(a:grp, beginning.middle.ending) - endfor + endfo en cal matchadd('CtrlPLinePre', '^>') @@ -2346,9 +2348,16 @@ endf fu! s:buildpat(lst) let pat = a:lst[0] - for item in range(1, len(a:lst) - 1) - let pat .= '[^'.a:lst[item - 1].']\{-}'.a:lst[item] - endfo + if s:matchnatural == 1 + for item in range(1, len(a:lst) - 1) + let c = a:lst[item - 1] + let pat .= (c == '/' ? '[^/]\{-}' : '[^'.c.'/]\{-}').a:lst[item] + endfo + else + for item in range(1, len(a:lst) - 1) + let pat .= '[^'.a:lst[item - 1].']\{-}'.a:lst[item] + endfo + en retu pat endf diff --git a/sources_non_forked/lightline.vim/autoload/lightline.vim b/sources_non_forked/lightline.vim/autoload/lightline.vim index 769fa7d9..045e2b85 100644 --- a/sources_non_forked/lightline.vim/autoload/lightline.vim +++ b/sources_non_forked/lightline.vim/autoload/lightline.vim @@ -2,7 +2,7 @@ " Filename: autoload/lightline.vim " Author: itchyny " License: MIT License -" Last Change: 2016/06/11 14:05:27. +" Last Change: 2016/06/12 22:40:00. " ============================================================================= let s:save_cpo = &cpo @@ -263,7 +263,7 @@ endif function! lightline#highlight(...) abort let [c, f] = [s:lightline.palette, s:lightline.mode_fallback] let [s:lightline.llen, s:lightline.rlen] = [len(c.normal.left), len(c.normal.right)] - let [s:lightline.tab_llen, s:lightline.tab_rlen] = [len(has_key(get(c, 'tabline', {}), 'left') ? c.tabline.left : c.normal.left), len(has_key(get(c, 'tabline', {}), 'right') ? c.tabline.right : c.normal.right)] + let [s:lightline.tab_llen, s:lightline.tab_rlen] = [len(has_key(get(c, 'tabline', {}), 'left') ? c.tabline.left : c.normal.left), len(has_key(get(c, 'tabline', {}), 'right') ? c.tabline.right : c.normal.right)] let types = map(s:uniq(sort(filter(values(s:lightline.component_type), 'v:val !=# "raw"'))), '[v:val, 1]') let modes = a:0 ? [a:1] : extend(['normal', 'insert', 'replace', 'visual', 'inactive', 'command', 'select', 'tabline'], has('nvim') ? ['terminal'] : []) for mode in modes @@ -293,7 +293,7 @@ function! lightline#highlight(...) abort endfunction function! s:subseparator(components, subseparator, expanded) abort - let [a, c, f, v] = [ a:components, s:lightline.component, s:lightline.component_function, s:lightline.component_visible_condition ] + let [a, c, f, v] = [ a:components, s:lightline.component, s:lightline.component_function, s:lightline.component_visible_condition ] let xs = map(range(len(a:components)), 'a:expanded[v:val] ? "1" : \ has_key(f, a[v:val]) ? (exists("*".f[a[v:val]]) ? "" : "exists(\"*".f[a[v:val]]."\")&&").f[a[v:val]]."()!=#\"\"" : \ has_key(v, a[v:val]) ? "(" . v[a[v:val]] . ")" : has_key(c, a[v:val]) ? "1" : "0"') diff --git a/sources_non_forked/nerdtree/autoload/nerdtree/ui_glue.vim b/sources_non_forked/nerdtree/autoload/nerdtree/ui_glue.vim index 0912faff..2aa3bece 100644 --- a/sources_non_forked/nerdtree/autoload/nerdtree/ui_glue.vim +++ b/sources_non_forked/nerdtree/autoload/nerdtree/ui_glue.vim @@ -187,17 +187,17 @@ endfunction " closes the parent dir of the current node function! s:closeCurrentDir(node) let parent = a:node.parent + while g:NERDTreeCascadeOpenSingleChildDir && !parent.isRoot() + let childNodes = parent.getVisibleChildren() + if len(childNodes) == 1 && childNodes[0].path.isDirectory + let parent = parent.parent + else + break + endif + endwhile if parent ==# {} || parent.isRoot() call nerdtree#echo("cannot close tree root") else - while g:NERDTreeCascadeOpenSingleChildDir && !parent.parent.isRoot() - if parent.parent.getVisibleChildCount() == 1 - call parent.close() - let parent = parent.parent - else - break - endif - endwhile call parent.close() call b:NERDTree.render() call parent.putCursorHere(0, 0) diff --git a/sources_non_forked/syntastic/CONTRIBUTING.md b/sources_non_forked/syntastic/CONTRIBUTING.md index 6dd17758..1949415e 100644 --- a/sources_non_forked/syntastic/CONTRIBUTING.md +++ b/sources_non_forked/syntastic/CONTRIBUTING.md @@ -11,7 +11,7 @@ ## 1. Bug reports / GitHub issues Please note that the preferred channel for posting bug reports is the -[issue tracker at GitHub][0]. Reports posted elsewhere are less likely +[issue tracker at GitHub][bug_tracker]. Reports posted elsewhere are less likely to be seen by the core team. When reporting a bug make sure you search the existing GitHub issues @@ -39,14 +39,14 @@ too: ## 2. Submitting a patch Before you consider adding features to syntastic, _please_ spend a few minutes -(re-)reading the latest version of the [manual][1]. Syntastic is changing +(re-)reading the latest version of the [manual][manual]. Syntastic is changing rapidly at times, and it's possible that some features you want to add exist already. To submit a patch: -* fork the [repo][2] on GitHub; -* make a [topic branch][3] and start hacking; +* fork the [repo][github] on GitHub; +* make a [topic branch][branches] and start hacking; * submit a pull request based off your topic branch. Small, focused patches are preferred. @@ -69,14 +69,14 @@ Follow the coding conventions/styles used in the syntastic core: * don't use `l:` prefixes for variables unless actually required (i.e. almost never); * code for maintainability; we would rather a function be a couple of -lines longer and have (for example) some [explaining variables][4] to +lines longer and have (for example) some [explaining variables][variables] to aid readability. ## 4. Syntax checker notes -Make sure to read the [guide][5] if you plan to add new syntax checkers. +Make sure to read the [guide][guide] if you plan to add new syntax checkers. Use the existing checkers as templates, rather than writing everything from scratch. @@ -97,9 +97,9 @@ let errorformat = \ '%-G%.%#' ``` -[0]: https://github.com/scrooloose/syntastic/issues -[1]: https://github.com/scrooloose/syntastic/blob/master/doc/syntastic.txt -[2]: https://github.com/scrooloose/syntastic -[3]: https://github.com/dchelimsky/rspec/wiki/Topic-Branches#using-topic-branches-when-contributing-patches -[4]: http://www.refactoring.com/catalog/extractVariable.html -[5]: https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide +[bug_tracker]: https://github.com/scrooloose/syntastic/issues +[manual]: https://github.com/scrooloose/syntastic/blob/master/doc/syntastic.txt +[github]: https://github.com/scrooloose/syntastic +[branches]: https://github.com/dchelimsky/rspec/wiki/Topic-Branches#using-topic-branches-when-contributing-patches +[variables]: http://www.refactoring.com/catalog/extractVariable.html +[guide]: https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide diff --git a/sources_non_forked/syntastic/README.markdown b/sources_non_forked/syntastic/README.markdown index 07106032..685d8408 100644 --- a/sources_non_forked/syntastic/README.markdown +++ b/sources_non_forked/syntastic/README.markdown @@ -46,37 +46,38 @@ ## 1\. Introduction -Syntastic is a syntax checking plugin for [Vim][13] that runs files through +Syntastic is a syntax checking plugin for [Vim][vim] that runs files through external syntax checkers and displays any resulting errors to the user. This can be done on demand, or automatically as files are saved. If syntax errors are detected, the user is notified and is happy because they didn't have to compile their code or execute their script to find them. At the time of this writing, syntastic has checking plugins for ActionScript, -Ada, Ansible configurations, API Blueprint, AppleScript, AsciiDoc, ASM, -BEMHTML, Bro, Bourne shell, C, C++, C#, Cabal, Chef, CoffeeScript, Coco, -Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, Dockerfile, Dust, Elixir, +Ada, Ansible configurations, API Blueprint, AppleScript, AsciiDoc, Assembly +languages, BEMHTML, Bro, Bourne shell, C, C++, C#, Cabal, Chef, CoffeeScript, +Coco, Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, Dockerfile, Dust, Elixir, Erlang, eRuby, Fortran, Gentoo metadata, GLSL, Go, Haml, Haskell, Haxe, Handlebars, HSS, HTML, Java, JavaScript, JSON, JSX, LESS, Lex, Limbo, LISP, LLVM intermediate language, Lua, Markdown, MATLAB, Mercury, NASM, Nix, Objective-C, Objective-C++, OCaml, Perl, Perl POD, PHP, gettext Portable -Object, OS X and iOS property lists, Pug (formerly Jade), Puppet, Python, QML, -R, Racket, RDF TriG, RDF Turtle, Relax NG, reStructuredText, RPM spec, Ruby, -SASS/SCSS, Scala, Slim, SML, Sphinx, SQL, Stylus, Tcl, TeX, Texinfo, Twig, -TypeScript, Vala, Verilog, VHDL, VimL, xHtml, XML, XSLT, XQuery, YACC, YAML, -YANG data models, z80, Zope page templates, and zsh. See the [wiki][3] for -details about the corresponding supported checkers. +Object, OS X and iOS property lists, Pug (formerly Jade), Puppet, Python, +QML, R, Racket, RDF TriG, RDF Turtle, Relax NG, reStructuredText, RPM spec, +Ruby, SASS/SCSS, Scala, Slim, SML, Sphinx, SQL, Stylus, Tcl, TeX, Texinfo, +Twig, TypeScript, Vala, Verilog, VHDL, VimL, xHtml, XML, XSLT, XQuery, +YACC, YAML, YANG data models, z80, Zope page templates, and Zsh. See the +[manual][checkers] for details about the corresponding supported checkers +(`:help syntastic-checkers` in Vim). A number of third-party Vim plugins also provide checkers for syntastic, -for example: [merlin][30], [omnisharp-vim][25], [rust.vim][12], -[syntastic-extras][26], [syntastic-more][27], [vim-crystal][29], -[vim-eastwood][28], and [vim-swift][24]. +for example: [merlin][merlin], [omnisharp-vim][omnisharp], [rust.vim][rust], +[syntastic-extras][myint], [syntastic-more][roktas], [vim-crystal][crystal], +[vim-eastwood][eastwood], and [vim-swift][swift]. Below is a screenshot showing the methods that Syntastic uses to display syntax errors. Note that, in practise, you will only have a subset of these methods enabled. -![Screenshot 1][0] +![Screenshot 1][screenshot] 1. Errors are loaded into the location list for the corresponding window. 2. When the cursor is on a line containing an error, the error message is echoed in the command window. @@ -94,7 +95,7 @@ enabled. ### 2.1\. Requirements Syntastic itself has rather relaxed requirements: it doesn't have any external -dependencies, and it needs a version of [Vim][13] compiled with a few common +dependencies, and it needs a version of [Vim][vim] compiled with a few common features: `autocmd`, `eval`, `file_in_path`, `modify_fname`, `quickfix`, `reltime`, and `user_commands`. Not all possible combinations of features that include the ones above make equal sense on all operating systems, but Vim @@ -102,8 +103,8 @@ version 7 or later with the "normal", "big", or "huge" feature sets should be fine. Syntastic should work with any modern plugin managers for Vim, such as -[NeoBundle][14], [Pathogen][1], [Vim-Addon-Manager][15], [Vim-Plug][16], or -[Vundle][17]. Instructions for installing syntastic with [Pathogen][1] are +[NeoBundle][neobundle], [Pathogen][pathogen], [Vim-Addon-Manager][vam], [Vim-Plug][plug], or +[Vundle][vundle]. Instructions for installing syntastic with [Pathogen][pathogen] are included below for completeness. Starting with Vim version 7.4.1486 you can also load syntastic using the @@ -115,20 +116,21 @@ syntastic is present only in versions 7.4.1486 and later. Last but not least: syntastic doesn't know how to do any syntax checks by itself. In order to get meaningful results you need to install external checkers corresponding to the types of files you use. Please consult the -[wiki][3] for a list of supported checkers. +[manual][checkers] (`:help syntastic-checkers` in Vim) for a list of supported +checkers. ### 2.2\. Installing syntastic with Pathogen -If you already have [Pathogen][1] working then skip [Step 1](#step1) and go to +If you already have [Pathogen][pathogen] working then skip [Step 1](#step1) and go to [Step 2](#step2). #### 2.2.1\. Step 1: Install pathogen.vim -First I'll show you how to install Tim Pope's [Pathogen][1] so that it's easy to +First I'll show you how to install Tim Pope's [Pathogen][pathogen] so that it's easy to install syntastic. Do this in your terminal so that you get the `pathogen.vim` file and the directories it needs: ```sh @@ -155,7 +157,7 @@ Quit vim and start it back up to reload it, then type: :Helptags ``` If you get an error when you do this, then you probably didn't install -[Pathogen][1] right. Go back to [Step 1](#step1) and make sure you did the +[Pathogen][pathogen] right. Go back to [Step 1](#step1) and make sure you did the following: 1. Created both the `~/.vim/autoload` and `~/.vim/bundle` directories. @@ -192,10 +194,11 @@ __4.1. Q. I installed syntastic but it isn't reporting any errors...__ A. The most likely reason is that none of the syntax checkers that it requires are installed. For example: by default, python requires either `flake8` or -`pylint` to be installed and in your `$PATH`. To see which executables are -supported, look at the [wiki][3]. Note that aliases do not work; the actual -executables must be available in your `$PATH`. Symbolic links are okay though. -You can see syntastic's idea of available checkers by running `:SyntasticInfo`. +`pylint` to be installed and in your `$PATH`. Read the [manual][checkers] +(`:help syntastic-checkers` in Vim) to find out what executables are +supported. Note that aliases do not work; the actual executables must be +available in your `$PATH`. Symbolic links are okay though. You can see +syntastic's idea of available checkers by running `:SyntasticInfo`. A second probable reason is that none of the available checkers are enabled. Syntastic comes preconfigured with a default list of enabled checkers @@ -222,7 +225,7 @@ on Windows. Finally, another reason it could fail is that either the command line options or the error output for a syntax checker may have changed. In this case, make sure you have the latest version of the syntax checker installed. If it still -fails then post an [issue][4] - or better yet, create a pull request. +fails then post an [issue][bug_tracker] - or better yet, create a pull request. @@ -238,18 +241,18 @@ let g:syntastic_python_python_exec = '/path/to/python3' __4.3. Q. Are there any local checkers for HTML5 that I can use with syntastic?__ -[HTML Tidy][18] has a fork named [HTML Tidy for HTML5][19]. It's a drop +[HTML Tidy][tidy_old] has a fork named [HTML Tidy for HTML5][tidy]. It's a drop in replacement, and syntastic can use it without changes. Just install it somewhere and point `g:syntastic_html_tidy_exec` to its executable: ```vim let g:syntastic_html_tidy_exec = 'tidy5' ``` -Alternatively, you can install [vnu.jar][21] from the [validator.nu][20] -project and run it as a [HTTP server][23]: +Alternatively, you can install [vnu.jar][vnu_jar] from the [validator.nu][vnu] +project and run it as a [HTTP server][vnu_server]: ```sh $ java -Xss512k -cp /path/to/vnu.jar nu.validator.servlet.Main 8888 ``` -Then you can [configure][22] syntastic to use it: +Then you can configure syntastic to use it: ```vim let g:syntastic_html_validator_api = 'http://localhost:8888/' ``` @@ -260,7 +263,7 @@ __4.4. Q. The `perl` checker has stopped working...__ A. The `perl` checker runs `perl -c` against your file, which in turn __executes__ any `BEGIN`, `UNITCHECK`, and `CHECK` blocks, and any `use` -statements in your file (cf. [perlrun][10]). This is probably fine if you +statements in your file (cf. [perlrun][perlrun]). This is probably fine if you wrote the file yourself, but it's a security problem if you're checking third-party files. Since there is currently no way to disable this behaviour while still producing useful results, the checker is now disabled by default. @@ -274,7 +277,7 @@ let g:syntastic_enable_perl_checker = 1 __4.5. Q. What happened to the `rustc` checker?__ -A. It is now part of the [rust.vim][12] plugin. If you install this plugin the +A. It is now part of the [rust.vim][rust] plugin. If you install this plugin the checker should be picked up automatically by syntastic. @@ -282,7 +285,7 @@ checker should be picked up automatically by syntastic. __4.6. Q. What happened to the `xcrun` checker?__ A. The `xcrun` checker used to have a security problem and it has been removed. -A better checker for __Swift__ is part of the [vim-swift][24] plugin. If you +A better checker for __Swift__ is part of the [vim-swift][swift] plugin. If you install this plugin the checker should be picked up automatically by syntastic. @@ -324,8 +327,8 @@ A. Stick a line like this in your `vimrc`: let g:syntastic__checkers = [''] ``` -To see the list of supported checkers for your filetype look at the -[wiki][3]. +To see the list of supported checkers for your filetype read the +[manual][checkers] (`:help syntastic-checkers` in Vim). e.g. Python has the following checkers, among others: `flake8`, `pyflakes`, `pylint` and a native `python` checker. @@ -406,7 +409,7 @@ A. Vim provides several built-in commands for this. See `:help :lnext` and `:help :lprevious`. If you use these commands a lot then you may want to add shortcut mappings to -your `vimrc`, or install something like [unimpaired][2], which provides such +your `vimrc`, or install something like [unimpaired][unimpaired], which provides such mappings (among other things). @@ -427,50 +430,50 @@ cabbrev bd =(getcmdtype()==#':' && getcmdpos()==1 ? 'lclose\|bdele ## 5\. Resources The preferred place for posting suggestions, reporting bugs, and general -discussions related to syntastic is the [issue tracker at GitHub][4]. -A guide for writing syntax checkers can be found in the [wiki][11]. -There are also a dedicated [google group][5], and a -[syntastic tag at StackOverflow][6]. +discussions related to syntastic is the [issue tracker at GitHub][bug_tracker]. +A guide for writing syntax checkers can be found in the [wiki][guide]. +There are also a dedicated [google group][google_group], and a +[syntastic tag at StackOverflow][stack_overflow]. Syntastic aims to provide a common interface to syntax checkers for as many languages as possible. For particular languages, there are, of course, other plugins that provide more functionality than syntastic. You might want to take -a look at [ghcmod-vim][31], [jedi-vim][7], [python-mode][8], [vim-go][32], or -[YouCompleteMe][9]. +a look at [ghcmod-vim][ghcmod], [jedi-vim][jedi], [python-mode][python_mode], [vim-go][vimgo], or +[YouCompleteMe][ycm]. -[0]: https://github.com/scrooloose/syntastic/raw/master/_assets/screenshot_1.png -[1]: https://github.com/tpope/vim-pathogen -[2]: https://github.com/tpope/vim-unimpaired -[3]: https://github.com/scrooloose/syntastic/wiki/Syntax-Checkers -[4]: https://github.com/scrooloose/syntastic/issues -[5]: https://groups.google.com/group/vim-syntastic -[6]: http://stackoverflow.com/questions/tagged/syntastic -[7]: https://github.com/davidhalter/jedi-vim -[8]: https://github.com/klen/python-mode -[9]: http://valloric.github.io/YouCompleteMe/ -[10]: http://perldoc.perl.org/perlrun.html#*-c* -[11]: https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide -[12]: https://github.com/rust-lang/rust.vim -[13]: http://www.vim.org/ -[14]: https://github.com/Shougo/neobundle.vim -[15]: https://github.com/MarcWeber/vim-addon-manager -[16]: https://github.com/junegunn/vim-plug/ -[17]: https://github.com/gmarik/Vundle.vim -[18]: http://tidy.sourceforge.net/ -[19]: http://www.htacg.org/tidy-html5/ -[20]: http://about.validator.nu/ -[21]: https://github.com/validator/validator/releases/latest -[22]: https://github.com/scrooloose/syntastic/wiki/HTML%3A---validator -[23]: http://validator.github.io/validator/#standalone -[24]: https://github.com/kballard/vim-swift -[25]: https://github.com/OmniSharp/omnisharp-vim -[26]: https://github.com/myint/syntastic-extras -[27]: https://github.com/roktas/syntastic-more -[28]: https://github.com/venantius/vim-eastwood -[29]: https://github.com/rhysd/vim-crystal -[30]: https://github.com/the-lambda-church/merlin -[31]: https://github.com/eagletmt/ghcmod-vim -[32]: https://github.com/fatih/vim-go +[screenshot]: https://github.com/scrooloose/syntastic/raw/master/_assets/screenshot_1.png + +[bug_tracker]: https://github.com/scrooloose/syntastic/issues +[checkers]: https://github.com/scrooloose/syntastic/blob/master/doc/syntastic-checkers.txt +[crystal]: https://github.com/rhysd/vim-crystal +[eastwood]: https://github.com/venantius/vim-eastwood +[ghcmod]: https://github.com/eagletmt/ghcmod-vim +[google_group]: https://groups.google.com/group/vim-syntastic +[guide]: https://github.com/scrooloose/syntastic/wiki/Syntax-Checker-Guide +[jedi]: https://github.com/davidhalter/jedi-vim +[merlin]: https://github.com/the-lambda-church/merlin +[myint]: https://github.com/myint/syntastic-extras +[neobundle]: https://github.com/Shougo/neobundle.vim +[omnisharp]: https://github.com/OmniSharp/omnisharp-vim +[pathogen]: https://github.com/tpope/vim-pathogen +[perlrun]: http://perldoc.perl.org/perlrun.html#*-c* +[plug]: https://github.com/junegunn/vim-plug/ +[python_mode]: https://github.com/klen/python-mode +[roktas]: https://github.com/roktas/syntastic-more +[rust]: https://github.com/rust-lang/rust.vim +[stack_overflow]: http://stackoverflow.com/questions/tagged/syntastic +[swift]: https://github.com/kballard/vim-swift +[tidy]: http://www.htacg.org/tidy-html5/ +[tidy_old]: http://tidy.sourceforge.net/ +[unimpaired]: https://github.com/tpope/vim-unimpaired +[vam]: https://github.com/MarcWeber/vim-addon-manager +[vim]: http://www.vim.org/ +[vimgo]: https://github.com/fatih/vim-go +[vnu]: http://about.validator.nu/ +[vnu_jar]: https://github.com/validator/validator/releases/latest +[vnu_server]: http://validator.github.io/validator/#standalone +[vundle]: https://github.com/gmarik/Vundle.vim +[ycm]: http://valloric.github.io/YouCompleteMe/ + +" vim: sw=2 ts=2 et diff --git a/sources_non_forked/vim-go/indent/go.vim b/sources_non_forked/vim-go/indent/go.vim index a3fa2b7a..ba99d54d 100644 --- a/sources_non_forked/vim-go/indent/go.vim +++ b/sources_non_forked/vim-go/indent/go.vim @@ -9,7 +9,7 @@ " - general line splits (line ends in an operator) if exists("b:did_indent") - finish + finish endif let b:did_indent = 1 @@ -21,58 +21,58 @@ setlocal indentexpr=GoIndent(v:lnum) setlocal indentkeys+=<:>,0=},0=) if exists("*GoIndent") - finish + finish endif " use shiftwidth function only if it's available if exists('*shiftwidth') - func s:sw() - return shiftwidth() - endfunc + func s:sw() + return shiftwidth() + endfunc else - func s:sw() - return &sw - endfunc + func s:sw() + return &sw + endfunc endif function! GoIndent(lnum) - let prevlnum = prevnonblank(a:lnum-1) - if prevlnum == 0 - " top of file - return 0 - endif + let prevlnum = prevnonblank(a:lnum-1) + if prevlnum == 0 + " top of file + return 0 + endif - " grab the previous and current line, stripping comments. - let prevl = substitute(getline(prevlnum), '//.*$', '', '') - let thisl = substitute(getline(a:lnum), '//.*$', '', '') - let previ = indent(prevlnum) + " grab the previous and current line, stripping comments. + let prevl = substitute(getline(prevlnum), '//.*$', '', '') + let thisl = substitute(getline(a:lnum), '//.*$', '', '') + let previ = indent(prevlnum) - let ind = previ + let ind = previ - if prevl =~ '[({]\s*$' - " previous line opened a block - let ind += s:sw() - endif - if prevl =~# '^\s*\(case .*\|default\):$' - " previous line is part of a switch statement - let ind += s:sw() - endif - " TODO: handle if the previous line is a label. + if prevl =~ '[({]\s*$' + " previous line opened a block + let ind += s:sw() + endif + if prevl =~# '^\s*\(case .*\|default\):$' + " previous line is part of a switch statement + let ind += s:sw() + endif + " TODO: handle if the previous line is a label. - if thisl =~ '^\s*[)}]' - " this line closed a block - let ind -= s:sw() - endif + if thisl =~ '^\s*[)}]' + " this line closed a block + let ind -= s:sw() + endif - " Colons are tricky. - " We want to outdent if it's part of a switch ("case foo:" or "default:"). - " We ignore trying to deal with jump labels because (a) they're rare, and - " (b) they're hard to disambiguate from a composite literal key. - if thisl =~# '^\s*\(case .*\|default\):$' - let ind -= s:sw() - endif + " Colons are tricky. + " We want to outdent if it's part of a switch ("case foo:" or "default:"). + " We ignore trying to deal with jump labels because (a) they're rare, and + " (b) they're hard to disambiguate from a composite literal key. + if thisl =~# '^\s*\(case .*\|default\):$' + let ind -= s:sw() + endif - return ind + return ind endfunction -" vim:ts=4:sw=4:et +" vim: sw=2 ts=2 et diff --git a/sources_non_forked/vim-go/indent/gohtmltmpl.vim b/sources_non_forked/vim-go/indent/gohtmltmpl.vim index 94ea135a..d95cbc24 100644 --- a/sources_non_forked/vim-go/indent/gohtmltmpl.vim +++ b/sources_non_forked/vim-go/indent/gohtmltmpl.vim @@ -42,3 +42,5 @@ function! GetGoHTMLTmplIndent(lnum) return ind endfunction + +" vim: sw=2 ts=2 et diff --git a/sources_non_forked/vim-go/plugin/go.vim b/sources_non_forked/vim-go/plugin/go.vim index 779f4e1b..f0d6c8d3 100644 --- a/sources_non_forked/vim-go/plugin/go.vim +++ b/sources_non_forked/vim-go/plugin/go.vim @@ -1,26 +1,26 @@ " install necessary Go tools if exists("g:go_loaded_install") - finish + finish endif let g:go_loaded_install = 1 " these packages are used by vim-go and can be automatically installed if " needed by the user with GoInstallBinaries let s:packages = [ - \ "github.com/nsf/gocode", - \ "github.com/alecthomas/gometalinter", - \ "golang.org/x/tools/cmd/goimports", - \ "golang.org/x/tools/cmd/guru", - \ "golang.org/x/tools/cmd/gorename", - \ "github.com/golang/lint/golint", - \ "github.com/rogpeppe/godef", - \ "github.com/kisielk/errcheck", - \ "github.com/jstemmer/gotags", - \ "github.com/klauspost/asmfmt/cmd/asmfmt", - \ "github.com/fatih/motion", - \ "github.com/zmb3/gogetdoc", - \ "github.com/josharian/impl", - \ ] + \ "github.com/nsf/gocode", + \ "github.com/alecthomas/gometalinter", + \ "golang.org/x/tools/cmd/goimports", + \ "golang.org/x/tools/cmd/guru", + \ "golang.org/x/tools/cmd/gorename", + \ "github.com/golang/lint/golint", + \ "github.com/rogpeppe/godef", + \ "github.com/kisielk/errcheck", + \ "github.com/jstemmer/gotags", + \ "github.com/klauspost/asmfmt/cmd/asmfmt", + \ "github.com/fatih/motion", + \ "github.com/zmb3/gogetdoc", + \ "github.com/josharian/impl", + \ ] " These commands are available on any filetypes command! GoInstallBinaries call s:GoInstallBinaries(-1) @@ -33,145 +33,144 @@ 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 == "" - echohl Error - echomsg "vim.go: $GOPATH is not set" - echohl None - return + if $GOPATH == "" + echohl Error + echomsg "vim.go: $GOPATH is not set" + echohl None + return + endif + + let err = s:CheckBinaries() + if err != 0 + return + endif + + let go_bin_path = go#path#BinPath() + + " change $GOBIN so go get can automatically install to it + let $GOBIN = go_bin_path + + " old_path is used to restore users own path + let old_path = $PATH + + " vim's executable path is looking in PATH so add our go_bin path to it + let $PATH = go_bin_path . go#util#PathListSep() . $PATH + + " when shellslash is set on MS-* systems, shellescape puts single quotes + " around the output string. cmd on Windows does not handle single quotes + " correctly. Unsetting shellslash forces shellescape to use double quotes + " instead. + let resetshellslash = 0 + if has('win32') && &shellslash + let resetshellslash = 1 + set noshellslash + endif + + let cmd = "go get -v " + if get(g:, "go_get_update", 1) != 0 + let cmd .= "-u " + endif + + let s:go_version = matchstr(go#util#System("go version"), '\d.\d.\d') + + " https://github.com/golang/go/issues/10791 + if s:go_version > "1.4.0" && s:go_version < "1.5.0" + let cmd .= "-f " + endif + + for pkg in s:packages + let basename = fnamemodify(pkg, ":t") + let binname = "go_" . basename . "_bin" + + let bin = basename + if exists("g:{binname}") + let bin = g:{binname} endif - let err = s:CheckBinaries() - if err != 0 - return + if !executable(bin) || a:updateBinaries == 1 + if a:updateBinaries == 1 + echo "vim-go: Updating ". basename .". Reinstalling ". pkg . " to folder " . go_bin_path + else + echo "vim-go: ". basename ." not found. Installing ". pkg . " to folder " . go_bin_path + endif + + + let out = go#util#System(cmd . shellescape(pkg)) + if go#util#ShellError() != 0 + echo "Error installing ". pkg . ": " . out + endif endif + endfor - let go_bin_path = go#path#BinPath() - - " change $GOBIN so go get can automatically install to it - let $GOBIN = go_bin_path - - " old_path is used to restore users own path - let old_path = $PATH - - " vim's executable path is looking in PATH so add our go_bin path to it - let $PATH = go_bin_path . go#util#PathListSep() . $PATH - - " when shellslash is set on MS-* systems, shellescape puts single quotes - " around the output string. cmd on Windows does not handle single quotes - " correctly. Unsetting shellslash forces shellescape to use double quotes - " instead. - let resetshellslash = 0 - if has('win32') && &shellslash - let resetshellslash = 1 - set noshellslash - endif - - let cmd = "go get -v " - if get(g:, "go_get_update", 1) != 0 - let cmd .= "-u " - endif - - let s:go_version = matchstr(go#util#System("go version"), '\d.\d.\d') - - " https://github.com/golang/go/issues/10791 - if s:go_version > "1.4.0" && s:go_version < "1.5.0" - let cmd .= "-f " - endif - - for pkg in s:packages - let basename = fnamemodify(pkg, ":t") - let binname = "go_" . basename . "_bin" - - let bin = basename - if exists("g:{binname}") - let bin = g:{binname} - endif - - if !executable(bin) || a:updateBinaries == 1 - if a:updateBinaries == 1 - echo "vim-go: Updating ". basename .". Reinstalling ". pkg . " to folder " . go_bin_path - else - echo "vim-go: ". basename ." not found. Installing ". pkg . " to folder " . go_bin_path - endif - - - let out = go#util#System(cmd . shellescape(pkg)) - if go#util#ShellError() != 0 - echo "Error installing ". pkg . ": " . out - endif - endif - endfor - - " restore back! - let $PATH = old_path - if resetshellslash - set shellslash - endif + " restore back! + let $PATH = old_path + if resetshellslash + set shellslash + endif endfunction " CheckBinaries checks if the necessary binaries to install the Go tool " commands are available. function! s:CheckBinaries() - if !executable('go') - echohl Error | echomsg "vim-go: go executable not found." | echohl None - return -1 - endif + if !executable('go') + echohl Error | echomsg "vim-go: go executable not found." | echohl None + return -1 + endif - if !executable('git') - echohl Error | echomsg "vim-go: git executable not found." | echohl None - return -1 - endif + if !executable('git') + echohl Error | echomsg "vim-go: git executable not found." | echohl None + return -1 + endif endfunction " Autocommands " ============================================================================ " function! s:echo_go_info() - if !exists('v:completed_item') || empty(v:completed_item) - return - endif - let item = v:completed_item + if !exists('v:completed_item') || empty(v:completed_item) + return + endif + let item = v:completed_item - if !has_key(item, "info") - return - endif + if !has_key(item, "info") + return + endif - if empty(item.info) - return - endif + if empty(item.info) + return + endif - redraws! | echo "vim-go: " | echohl Function | echon item.info | echohl None + redraws! | echo "vim-go: " | echohl Function | echon item.info | echohl None endfunction augroup vim-go - autocmd! + autocmd! - " GoInfo automatic update - if get(g:, "go_auto_type_info", 0) - autocmd CursorHold *.go nested call go#complete#Info(1) - endif + " GoInfo automatic update + if get(g:, "go_auto_type_info", 0) + autocmd CursorHold *.go nested call go#complete#Info(1) + endif - " Echo the identifier information when completion is done. Useful to see - " the signature of a function, etc... - if exists('##CompleteDone') - autocmd CompleteDone *.go nested call s:echo_go_info() - endif + " Echo the identifier information when completion is done. Useful to see + " the signature of a function, etc... + if exists('##CompleteDone') + autocmd CompleteDone *.go nested call s:echo_go_info() + endif - " Go code formatting on save - if get(g:, "go_fmt_autosave", 1) - autocmd BufWritePre *.go call go#fmt#Format(-1) - endif + " Go code formatting on save + if get(g:, "go_fmt_autosave", 1) + autocmd BufWritePre *.go call go#fmt#Format(-1) + endif - " Go asm formatting on save - if get(g:, "go_asmfmt_autosave", 1) - autocmd BufWritePre *.s call go#asmfmt#Format() - endif + " Go asm formatting on save + if get(g:, "go_asmfmt_autosave", 1) + autocmd BufWritePre *.s call go#asmfmt#Format() + endif - " run gometalinter on save - if get(g:, "go_metalinter_autosave", 0) - autocmd BufWritePost *.go call go#lint#Gometa(1) - endif + " run gometalinter on save + if get(g:, "go_metalinter_autosave", 0) + autocmd BufWritePost *.go call go#lint#Gometa(1) + endif augroup END - -" vim:ts=4:sw=4:et +" vim: sw=2 ts=2 et diff --git a/sources_non_forked/vim-go/syntax/go.vim b/sources_non_forked/vim-go/syntax/go.vim index f9cd2cba..f3e73c5c 100644 --- a/sources_non_forked/vim-go/syntax/go.vim +++ b/sources_non_forked/vim-go/syntax/go.vim @@ -68,7 +68,7 @@ if !exists("g:go_highlight_methods") endif if !exists("g:go_highlight_fields") - let g:go_highlight_fields = 0 + let g:go_highlight_fields = 0 endif if !exists("g:go_highlight_structs") @@ -336,35 +336,35 @@ hi def link goInterfaceDef Function " Build Constraints if g:go_highlight_build_constraints != 0 - syn match goBuildKeyword display contained "+build" - " Highlight the known values of GOOS, GOARCH, and other +build options. - syn keyword goBuildDirectives contained - \ android darwin dragonfly freebsd linux nacl netbsd openbsd plan9 - \ solaris windows 386 amd64 amd64p32 arm armbe arm64 arm64be ppc64 - \ ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc - \ s390 s390x sparc sparc64 cgo ignore race + syn match goBuildKeyword display contained "+build" + " Highlight the known values of GOOS, GOARCH, and other +build options. + syn keyword goBuildDirectives contained + \ android darwin dragonfly freebsd linux nacl netbsd openbsd plan9 + \ solaris windows 386 amd64 amd64p32 arm armbe arm64 arm64be ppc64 + \ ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc + \ s390 s390x sparc sparc64 cgo ignore race - " Other words in the build directive are build tags not listed above, so - " avoid highlighting them as comments by using a matchgroup just for the - " start of the comment. - " The rs=s+2 option lets the \s*+build portion be part of the inner region - " instead of the matchgroup so it will be highlighted as a goBuildKeyword. - syn region goBuildComment matchgroup=goBuildCommentStart - \ start="//\s*+build\s"rs=s+2 end="$" - \ contains=goBuildKeyword,goBuildDirectives - hi def link goBuildCommentStart Comment - hi def link goBuildDirectives Type - hi def link goBuildKeyword PreProc + " Other words in the build directive are build tags not listed above, so + " avoid highlighting them as comments by using a matchgroup just for the + " start of the comment. + " The rs=s+2 option lets the \s*+build portion be part of the inner region + " instead of the matchgroup so it will be highlighted as a goBuildKeyword. + syn region goBuildComment matchgroup=goBuildCommentStart + \ start="//\s*+build\s"rs=s+2 end="$" + \ contains=goBuildKeyword,goBuildDirectives + hi def link goBuildCommentStart Comment + hi def link goBuildDirectives Type + hi def link goBuildKeyword PreProc - " One or more line comments that are followed immediately by a "package" - " declaration are treated like package documentation, so these must be - " matched as comments to avoid looking like working build constraints. - " The he, me, and re options let the "package" itself be highlighted by - " the usual rules. - syn region goPackageComment start=/\v(\/\/.*\n)+\s*package/ - \ end=/\v\n\s*package/he=e-7,me=e-7,re=e-7 - \ contains=@goCommentGroup,@Spell - hi def link goPackageComment Comment + " One or more line comments that are followed immediately by a "package" + " declaration are treated like package documentation, so these must be + " matched as comments to avoid looking like working build constraints. + " The he, me, and re options let the "package" itself be highlighted by + " the usual rules. + syn region goPackageComment start=/\v(\/\/.*\n)+\s*package/ + \ end=/\v\n\s*package/he=e-7,me=e-7,re=e-7 + \ contains=@goCommentGroup,@Spell + hi def link goPackageComment Comment endif @@ -376,3 +376,5 @@ endif syn sync minlines=500 let b:current_syntax = "go" + +" vim: sw=2 ts=2 et diff --git a/sources_non_forked/vim-go/syntax/godefstack.vim b/sources_non_forked/vim-go/syntax/godefstack.vim index 7574c21d..e4eefff4 100644 --- a/sources_non_forked/vim-go/syntax/godefstack.vim +++ b/sources_non_forked/vim-go/syntax/godefstack.vim @@ -1,5 +1,5 @@ if exists("b:current_syntax") - finish + finish endif syn match godefStackComment '^".*' @@ -16,3 +16,5 @@ hi def link godefStackComment Comment hi def link godefStackCurrentPosition Special hi def link godefStackFilename Directory hi def link godefStackEntryLocationNumber LineNr + +" vim: sw=2 ts=2 et diff --git a/sources_non_forked/vim-go/syntax/gohtmltmpl.vim b/sources_non_forked/vim-go/syntax/gohtmltmpl.vim index 5aa6c98d..f53fbc67 100644 --- a/sources_non_forked/vim-go/syntax/gohtmltmpl.vim +++ b/sources_non_forked/vim-go/syntax/gohtmltmpl.vim @@ -1,9 +1,9 @@ if exists("b:current_syntax") - finish + finish endif if !exists("main_syntax") - let main_syntax = 'html' + let main_syntax = 'html' endif runtime! syntax/gotexttmpl.vim @@ -12,4 +12,4 @@ unlet b:current_syntax let b:current_syntax = "gohtmltmpl" -" vim:ts=4:sw=4:et +" vim: sw=2 ts=2 et diff --git a/sources_non_forked/vim-go/syntax/gotexttmpl.vim b/sources_non_forked/vim-go/syntax/gotexttmpl.vim index f8f4e682..de21d7fc 100644 --- a/sources_non_forked/vim-go/syntax/gotexttmpl.vim +++ b/sources_non_forked/vim-go/syntax/gotexttmpl.vim @@ -6,7 +6,7 @@ " Quit when a (custom) syntax file was already loaded if exists("b:current_syntax") - finish + finish endif syn case match @@ -82,4 +82,4 @@ hi def link goTplComment Comment let b:current_syntax = "gotexttmpl" -" vim:ts=4:sw=4:et +" vim: sw=2 ts=2 et diff --git a/sources_non_forked/vim-go/syntax/vimgo.vim b/sources_non_forked/vim-go/syntax/vimgo.vim index d62791d3..3a2204c4 100644 --- a/sources_non_forked/vim-go/syntax/vimgo.vim +++ b/sources_non_forked/vim-go/syntax/vimgo.vim @@ -1,5 +1,5 @@ if exists("b:current_syntax") - finish + finish endif let b:current_syntax = "vimgo" @@ -9,3 +9,5 @@ syn region goTitle start="\%1l" end=":" hi def link goInterface Type hi def link goTitle Label + +" vim: sw=2 ts=2 et diff --git a/sources_non_forked/vim-snipmate/autoload/snipMate.vim b/sources_non_forked/vim-snipmate/autoload/snipMate.vim index 2157eeb1..74366fa8 100644 --- a/sources_non_forked/vim-snipmate/autoload/snipMate.vim +++ b/sources_non_forked/vim-snipmate/autoload/snipMate.vim @@ -110,7 +110,7 @@ function! s:build_stops(snippet, stops, lnum, col, indent) abort for line in a:snippet let col = s:build_loc_info(line, stops, lnum, col, []) - if line isnot line[-1] + if line isnot a:snippet[-1] let lnum += 1 let col = a:indent endif diff --git a/sources_non_forked/vim-snippets/UltiSnips/htmldjango.snippets b/sources_non_forked/vim-snippets/UltiSnips/htmldjango.snippets index ad571504..37fa85fd 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/htmldjango.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/htmldjango.snippets @@ -186,7 +186,7 @@ snippet iblock "" bi {% block ${1:blockname} %}${VISUAL}{% endblock $1 %} endsnippet -snippet csfr "" bi +snippet csrf "" bi {% csrf_token %} endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/java.snippets b/sources_non_forked/vim-snippets/UltiSnips/java.snippets index e8eb77cc..54d026df 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/java.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/java.snippets @@ -21,7 +21,7 @@ def nl(snip): snip.rv += " " def getArgs(group): import re - word = re.compile('[a-zA-Z><.]+ \w+') + word = re.compile('[a-zA-Z0-9><.]+ \w+') return [i.split(" ") for i in word.findall(group) ] def camel(word): @@ -109,7 +109,7 @@ for i in args: snip.rv += "\n\tprivate " + i[0] + " " + i[1]+ ";" if len(args) > 0: snip.rv += "\n"` - public `!p snip.rv = snip.basename or "unknown"`($1) { `!p + public `!p snip.rv = snip.basename or "unknown"`($1) {`!p args = getArgs(t[1]) for i in args: snip.rv += "\n\t\tthis." + i[1] + " = " + i[1] + ";" @@ -123,8 +123,8 @@ for i in args: snip.rv += "\n\tpublic void set" + camel(i[1]) + "(" + i[0] + " " + i[1] + ") {\n" + "\ \tthis." + i[1] + " = " + i[1] + ";\n\t}\n" - snip.rv += "\n\tpublic " + i[0] + " get" + camel(i[1]) + "() {\ - \n\t\treturn " + i[1] + ";\n\t}\n" + snip.rv += "\n\tpublic " + i[0] + " get" + camel(i[1]) + "() {\n\ + \treturn " + i[1] + ";\n\t}\n" ` } endsnippet @@ -138,7 +138,7 @@ for i in args: snip.rv += "\n\tprivate " + i[0] + " " + i[1]+ ";" if len(args) > 0: snip.rv += "\n"` - public `!p snip.rv = snip.basename or "unknown"`($1) { `!p + public `!p snip.rv = snip.basename or "unknown"`($1) {`!p args = getArgs(t[1]) for i in args: snip.rv += "\n\t\tthis.%s = %s;" % (i[1], i[1]) @@ -266,7 +266,7 @@ for i in args: snip.rv += "\n\tprivate " + i[0] + " " + i[1]+ ";" if len(args) > 0: snip.rv += "\n"` -public `!p snip.rv = snip.basename or "unknown"`($1) { `!p +public `!p snip.rv = snip.basename or "unknown"`($1) {`!p args = getArgs(t[1]) for i in args: snip.rv += "\n\t\tthis.%s = %s;" % (i[1], i[1]) @@ -326,11 +326,11 @@ snippet md "Method With javadoc" b * ${7:Short Description}`!p for i in getArgs(t[4]): snip.rv += "\n\t * @param " + i[1] + " usage..."` - * `!p + *`!p if "throws" in t[5]: snip.rv = "\n\t * @throws " + t[6] else: - snip.rv = ""` `!p + snip.rv = ""``!p if not "void" in t[2]: snip.rv = "\n\t * @return object" else: @@ -356,8 +356,7 @@ endsnippet snippet /se?tge?t|ge?tse?t|gs/ "setter and getter" br public void set${1:Name}(${2:String} `!p snip.rv = mixedCase(t[1])`) { this.`!p snip.rv = mixedCase(t[1])` = `!p snip.rv = mixedCase(t[1])`; -} - +}`!p snip.rv += "\n"` public $2 get$1() { return `!p snip.rv = mixedCase(t[1])`; } diff --git a/sources_non_forked/vim-snippets/UltiSnips/json.snippets b/sources_non_forked/vim-snippets/UltiSnips/json.snippets index b0cad830..75edef9d 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/json.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/json.snippets @@ -4,7 +4,7 @@ snippet s "String" b "${1:key}": "${0:value}", endsnippet -snippet n "number" b +snippet n "Number" b "${1:key}": ${0:value}, endsnippet @@ -13,8 +13,39 @@ snippet a "Array" b ${VISUAL}$0 ], endsnippet + +snippet na "Named array" b +"${1:key}": [ + ${VISUAL}$0 +], +endsnippet + snippet o "Object" b { ${VISUAL}$0 }, endsnippet + +snippet no "Named object" b +"${1:key}": { + ${VISUAL}$0 +}, +endsnippet + +snippet null "Null" b +"${0:key}": null, +endsnippet + + +global !p +def compB(t, opts): + if t: + opts = [m[len(t):] for m in opts if m.startswith(t)] + if len(opts) == 1: + return opts[0] + return "(" + '|'.join(opts) + ')' +endglobal + +snippet b "Bool" b +"${1:key}": $2`!p snip.rv=compB(t[2], ['true', 'false'])`, +endsnippet diff --git a/sources_non_forked/vim-snippets/UltiSnips/php-phpspec.snippets b/sources_non_forked/vim-snippets/UltiSnips/php-phpspec.snippets index 297b73d8..08d84a05 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/php-phpspec.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/php-phpspec.snippets @@ -23,7 +23,7 @@ class `!p snip.rv = re.match(r'.*(?=\.)', fn).group() ` extends ObjectBehavior { - function it${1}() + function it_${1}() { $0 } @@ -31,7 +31,7 @@ snip.rv = re.match(r'.*(?=\.)', fn).group() endsnippet snippet it "function it_does_something() { ... }" -function it${1}() +function it_${1}() { ${0:${VISUAL}} } @@ -163,11 +163,11 @@ endsnippet # Scalar type matchers snippet sbscalar "$this->XYZ()->shouldBeString|Array|Bool()" -$this->${1:method}()->shouldBe(${2:'String|Array|Bool'}); +$this->${1:method}()->shouldBe${2:String|Array|Bool}(); endsnippet snippet snbscalar "$this->XYZ()->shouldNotBeString|Array|Bool()" -$this->${1:method}()->shouldNotBe(${2:'String|Array|Bool'}); +$this->${1:method}()->shouldNotBe${2:String|Array|Bool}(); endsnippet # Contain matcher diff --git a/sources_non_forked/vim-snippets/UltiSnips/php.snippets b/sources_non_forked/vim-snippets/UltiSnips/php.snippets index 74b51cc0..7ba51c75 100644 --- a/sources_non_forked/vim-snippets/UltiSnips/php.snippets +++ b/sources_non_forked/vim-snippets/UltiSnips/php.snippets @@ -3,7 +3,7 @@ priority -50 ## Snippets from SnipMate, taken from ## https://github.com/scrooloose/snipmate-snippets.git -snippet getter "PHP Class Getter" b +snippet gm "PHP Class Getter" b /** * Getter for $1 * @@ -11,11 +11,11 @@ snippet getter "PHP Class Getter" b */ public function get${1/\w+\s*/\u$0/}() { - return $this->$1;$3 + return $this->$1; } endsnippet -snippet setter "PHP Class Setter" b +snippet sm "PHP Class Setter" b /** * Setter for $1 * @@ -24,11 +24,10 @@ snippet setter "PHP Class Setter" b */ public function set${1/\w+\s*/\u$0/}(${4:${2/(void|string|int|integer|double|float|object|boolear|null|mixed|number|resource)|(.*)/(?1::$2 )/}}$$1) { - $this->$1 = $$1;$5 + $this->$1 = $$1; - ${6:return $this;} + ${5:return $this;} } -$0 endsnippet snippet gs "PHP Class Getter Setter" b @@ -39,22 +38,21 @@ snippet gs "PHP Class Getter Setter" b */ public function get${1/\w+\s*/\u$0/}() { - return $this->$1;$3 + return $this->$1; } /** * Setter for $1 * * @param $2 $$1 - * @return ${4:`!p snip.rv=snip.basename`} + * @return ${3:`!p snip.rv=snip.basename`} */ -public function set${1/\w+\s*/\u$0/}(${5:${2/(void|string|int|integer|double|float|object|boolear|null|mixed|number|resource)|(.*)/(?1::$2 )/}}$$1) +public function set${1/\w+\s*/\u$0/}(${4:${2/(void|string|int|integer|double|float|object|boolear|null|mixed|number|resource)|(.*)/(?1::$2 )/}}$$1) { - $this->$1 = $$1;$6 + $this->$1 = $$1; - ${7:return $this;} + ${5:return $this;} } -$0 endsnippet snippet pub "Public function" b diff --git a/sources_non_forked/vim-snippets/snippets/eelixir.snippets b/sources_non_forked/vim-snippets/snippets/eelixir.snippets index bb6c5d4a..3d6e33d4 100644 --- a/sources_non_forked/vim-snippets/snippets/eelixir.snippets +++ b/sources_non_forked/vim-snippets/snippets/eelixir.snippets @@ -1,3 +1,5 @@ +extends html + snippet % <% ${0} %> snippet = diff --git a/sources_non_forked/vim-snippets/snippets/php.snippets b/sources_non_forked/vim-snippets/snippets/php.snippets index d382a8b1..4faa1673 100644 --- a/sources_non_forked/vim-snippets/snippets/php.snippets +++ b/sources_non_forked/vim-snippets/snippets/php.snippets @@ -47,28 +47,27 @@ snippet m { ${0} } -# setter method -snippet sm +snippet sm "PHP Class Setter" /** * Sets the value of ${1:foo} * - * @param ${2:$1} $$1 ${3:description} + * @param ${2:string} $$1 ${3:description} * * @return ${4:`vim_snippets#Filename()`} */ - ${5:public} function set${6:$2}(${7:$2 }$$1) + ${5:public} function set${6:$1}(${7:$2 }$$1) { $this->${8:$1} = $$1; + return $this; } -# getter method -snippet gm +snippet gm "PHP Class Getter Setter" /** * Gets the value of ${1:foo} * - * @return ${2:$1} + * @return ${2:string} */ - ${3:public} function get${4:$2}() + ${3:public} function get${4:$1}() { return $this->${5:$1}; } @@ -391,13 +390,13 @@ snippet ve "Dumb debug helper in HTML" snippet pc "Dumb debug helper in cli" var_export($1);$0 # Getters & Setters -snippet gs +snippet gs "PHP Class Getter Setter" /** * Gets the value of ${1:foo} * - * @return ${2:$1} + * @return ${2:string} */ - public function get${3:$2}() + public function get${3:$1}() { return $this->${4:$1}; } diff --git a/sources_non_forked/vim-snippets/snippets/sass.snippets b/sources_non_forked/vim-snippets/snippets/sass.snippets new file mode 100644 index 00000000..7207360c --- /dev/null +++ b/sources_non_forked/vim-snippets/snippets/sass.snippets @@ -0,0 +1,36 @@ +extends css + +snippet $ + $${1:variable}: ${0:value} +snippet imp + @import '${0}' +snippet mix + @mixin ${1:name}(${2}) + ${0} +snippet inc + @include ${1:mixin}(${2}) +snippet ext + @extend ${0} +snippet fun + @function ${1:name}(${2:args}) + ${0} +snippet if + @if ${1:condition} + ${0} +snippet ife + @if ${1:condition} + ${2} + @else + ${0} +snippet eif + @else if ${1:condition} + ${0} +snippet for + @for ${1:$i} from ${2:1} through ${3:3} + ${0} +snippet each + @each ${1:$item} in ${2:items} + ${0} +snippet while + @while ${1:$i} ${2:>} ${3:0} + ${0} diff --git a/sources_non_forked/vim-snippets/snippets/tex.snippets b/sources_non_forked/vim-snippets/snippets/tex.snippets index a618ceb1..68ac5d05 100644 --- a/sources_non_forked/vim-snippets/snippets/tex.snippets +++ b/sources_non_forked/vim-snippets/snippets/tex.snippets @@ -16,57 +16,57 @@ snippet dmo \DeclareMathOperator # \begin{}...\end{} snippet begin \begin{} ... \end{} block \begin{${1:env}} - ${0} + ${0:${VISUAL}} \end{$1} # Tabular snippet tab tabular (or arbitrary) environment \begin{${1:tabular}}{${2:c}} - ${0} + ${0:${VISUAL}} \end{$1} snippet thm thm (or arbitrary) environment with optional argument \begin[${1:author}]{${2:thm}} - ${0} + ${0:${VISUAL}} \end{$2} snippet center center environment \begin{center} - ${0} + ${0:${VISUAL}} \end{center} # Align(ed) snippet ali align(ed) environment \begin{align${1:ed}} \label{eq:${2}} - ${0} + ${0:${VISUAL}} \end{align$1} # Gather(ed) snippet gat gather(ed) environment \begin{gather${1:ed}} - ${0} + ${0:${VISUAL}} \end{gather$1} # Equation snippet eq equation environment \begin{equation} - ${0} + ${0:${VISUAL}} \end{equation} # Equation snippet eql Labeled equation environment \begin{equation} \label{eq:${2}} - ${0} + ${0:${VISUAL}} \end{equation} # Equation snippet eq* unnumbered equation environment \begin{equation*} - ${0} + ${0:${VISUAL}} \end{equation*} # Unnumbered Equation snippet \ unnumbered equation: \[ ... \] \[ - ${0} + ${0:${VISUAL}} \] # Equation array snippet eqnarray eqnarray environment \begin{eqnarray} - ${0} + ${0:${VISUAL}} \end{eqnarray} # Label snippet lab \label @@ -90,7 +90,7 @@ snippet itemize itemize environment \item ${0} \end{itemize} snippet item \item - \item ${1} + \item ${1:${VISUAL}} # Description snippet desc description environment \begin{description} @@ -103,18 +103,18 @@ snippet ]i \item (recursive) # Matrix snippet mat smart matrix environment \begin{${1:p/b/v/V/B/small}matrix} - ${0} + ${0:${VISUAL}} \end{$1matrix} # Cases snippet cas cases environment \begin{cases} ${1:equation}, &\text{ if }${2:case}\\ - ${0} + ${0:${VISUAL}} \end{cases} # Split snippet spl split environment \begin{split} - ${0} + ${0:${VISUAL}} \end{split} # Part snippet part document \part @@ -203,32 +203,32 @@ snippet fcite \footcite[]{} \footcite[${1}]{${2}}${0} #Formating text: italic, bold, underline, small capital, emphase .. snippet it italic text - \textit{${0:text}} + \textit{${0:${VISUAL:text}}} snippet bf bold face text - \textbf{${0:text}} + \textbf{${0:${VISUAL:text}}} snippet under underline text - \underline{${0:text}} + \underline{${0:${VISUAL:text}}} snippet emp emphasize text - \emph{${0:text}} + \emph{${0:${VISUAL:text}}} snippet sc small caps text - \textsc{${0:text}} + \textsc{${0:${VISUAL:text}}} #Choosing font snippet sf sans serife text - \textsf{${0:text}} + \textsf{${0:${VISUAL:text}}} snippet rm roman font text - \textrm{${0:text}} + \textrm{${0:${VISUAL:text}}} snippet tt typewriter (monospace) text - \texttt{${0:text}} + \texttt{${0:${VISUAL:text}}} #Math font snippet mf mathfrak - \mathfrak{${0:text}} + \mathfrak{${0:${VISUAL:text}}} snippet mc mathcal - \mathcal{${0:text}} + \mathcal{${0:${VISUAL:text}}} snippet ms mathscr - \mathscr{${0:text}} + \mathscr{${0:${VISUAL:text}}} #misc snippet ft \footnote - \footnote{${0:text}} + \footnote{${0:${VISUAL:text}}} snippet fig figure environment (includegraphics) \begin{figure} \begin{center} @@ -260,19 +260,19 @@ snippet lim \lim_{} \lim_{${1:n \to \infty}} ${0} snippet frame frame environment \begin{frame}[${1:t}]{${2:title}} - ${0} + ${0:${VISUAL}} \end{frame} snippet block block environment \begin{block}{${1:title}} - ${0} + ${0:${VISUAL}} \end{block} snippet alert alertblock environment \begin{alertblock}{${1:title}} - ${0} + ${0:${VISUAL}} \end{alertblock} snippet example exampleblock environment \begin{exampleblock}{${1:title}} - ${0} + ${0:${VISUAL}} \end{exampleblock} snippet col2 two-column environment \begin{columns} @@ -301,7 +301,7 @@ snippet lra langle rangle # Code listings snippet lst \begin{listing}[language=${1:language}] - ${0} + ${0:${VISUAL}} \end{listing} snippet lsi \lstinline|${1}| ${0}