From d195ccb777951d53b02c7f5251693bb9a3738916 Mon Sep 17 00:00:00 2001 From: amix Date: Tue, 24 Feb 2015 10:45:22 +0000 Subject: [PATCH] Updated vim plugins --- sources_non_forked/ack.vim/README.md | 187 ++++++----- sources_non_forked/ack.vim/autoload/ack.vim | 303 ++++++++++------- sources_non_forked/ack.vim/doc/ack.txt | 14 +- .../ack.vim/doc/ack_quick_help.txt | 2 +- sources_non_forked/ack.vim/plugin/ack.vim | 12 +- sources_non_forked/goyo.vim/autoload/goyo.vim | 25 +- sources_non_forked/syntastic/README.markdown | 70 ++-- .../syntastic/autoload/syntastic/c.vim | 26 +- .../syntastic/autoload/syntastic/log.vim | 28 +- .../autoload/syntastic/postprocess.vim | 10 +- .../autoload/syntastic/preprocess.vim | 126 +++++-- .../syntastic/autoload/syntastic/util.vim | 56 ++-- .../syntastic/plugin/syntastic.vim | 81 ++--- .../plugin/syntastic/autoloclist.vim | 6 +- .../syntastic/plugin/syntastic/balloons.vim | 10 +- .../syntastic/plugin/syntastic/checker.vim | 59 ++-- .../syntastic/plugin/syntastic/cursor.vim | 14 +- .../plugin/syntastic/highlighting.vim | 12 +- .../syntastic/plugin/syntastic/loclist.vim | 66 ++-- .../syntastic/plugin/syntastic/modemap.vim | 22 +- .../syntastic/plugin/syntastic/notifiers.vim | 8 +- .../syntastic/plugin/syntastic/registry.vim | 28 +- .../syntastic/plugin/syntastic/signs.vim | 14 +- .../syntastic/syntax_checkers/java/javac.vim | 29 +- .../syntax_checkers/javascript/standard.vim | 47 +++ .../syntax_checkers/json/jsonval.vim | 2 +- .../syntastic/syntax_checkers/nasm/nasm.vim | 2 +- .../syntax_checkers/ocaml/camlp4o.vim | 2 +- .../syntax_checkers/python/flake8.vim | 2 +- .../syntastic/syntax_checkers/r/lint.vim | 2 +- .../syntastic/syntax_checkers/ruby/reek.vim | 5 +- .../syntax_checkers/ruby/rubylint.vim | 4 +- .../syntastic/syntax_checkers/slim/slimrb.vim | 8 +- .../{swift/xcrun.vim => sml/smlnj.vim} | 41 ++- .../syntastic/syntax_checkers/vim/vint.vim | 55 ++++ sources_non_forked/vim-airline/LICENSE | 2 +- sources_non_forked/vim-airline/README.md | 2 +- .../vim-airline/autoload/airline.vim | 2 +- .../vim-airline/autoload/airline/builder.vim | 4 +- .../vim-airline/autoload/airline/debug.vim | 2 +- .../autoload/airline/deprecation.vim | 2 +- .../autoload/airline/extensions.vim | 2 +- .../autoload/airline/extensions/branch.vim | 2 +- .../airline/extensions/bufferline.vim | 2 +- .../autoload/airline/extensions/commandt.vim | 2 +- .../autoload/airline/extensions/csv.vim | 2 +- .../autoload/airline/extensions/ctrlp.vim | 2 +- .../autoload/airline/extensions/default.vim | 2 +- .../autoload/airline/extensions/eclim.vim | 2 +- .../autoload/airline/extensions/example.vim | 2 +- .../autoload/airline/extensions/hunks.vim | 2 +- .../autoload/airline/extensions/netrw.vim | 2 +- .../autoload/airline/extensions/nrrwrgn.vim | 2 +- .../airline/extensions/promptline.vim | 2 +- .../autoload/airline/extensions/quickfix.vim | 2 +- .../autoload/airline/extensions/syntastic.vim | 2 +- .../autoload/airline/extensions/tabline.vim | 308 +----------------- .../airline/extensions/tabline/autoshow.vim | 51 +++ .../airline/extensions/tabline/buffers.vim | 185 +++++++++++ .../airline/extensions/tabline/buflist.vim | 38 +++ .../tabline/{ => formatters}/default.vim | 8 +- .../tabline/{ => formatters}/unique_tail.vim | 8 +- .../{ => formatters}/unique_tail_improved.vim | 10 +- .../airline/extensions/tabline/tabs.vim | 80 +++++ .../autoload/airline/extensions/tagbar.vim | 2 +- .../autoload/airline/extensions/tmuxline.vim | 2 +- .../autoload/airline/extensions/undotree.vim | 2 +- .../autoload/airline/extensions/unite.vim | 2 +- .../airline/extensions/virtualenv.vim | 2 +- .../airline/extensions/whitespace.vim | 2 +- .../autoload/airline/highlighter.vim | 10 +- .../vim-airline/autoload/airline/init.vim | 2 +- .../vim-airline/autoload/airline/parts.vim | 2 +- .../vim-airline/autoload/airline/section.vim | 2 +- .../vim-airline/autoload/airline/themes.vim | 2 +- .../autoload/airline/themes/badwolf.vim | 2 +- .../autoload/airline/themes/base16.vim | 8 +- .../vim-airline/autoload/airline/util.vim | 2 +- .../vim-airline/doc/airline.txt | 36 +- .../vim-airline/plugin/airline.vim | 38 +-- .../vim-fugitive/plugin/fugitive.vim | 11 +- sources_non_forked/vim-go/README.md | 32 +- sources_non_forked/vim-go/autoload/go/fmt.vim | 2 +- .../vim-go/autoload/go/oracle.vim | 190 ++++------- .../vim-go/autoload/webapi/json.vim | 135 -------- sources_non_forked/vim-go/doc/vim-go.txt | 124 ++++++- .../vim-go/ftplugin/go/commands.vim | 26 +- .../vim-go/gosnippets/UltiSnips/go.snippets | 39 ++- .../vim-go/gosnippets/snippets/go.snip | 32 ++ sources_non_forked/vim-go/indent/go.vim | 80 +++-- .../vim-multiple-cursors/README.md | 9 +- .../doc/multiple_cursors.txt | 26 +- .../vim-repeat/autoload/repeat.vim | 15 +- .../vim-snipmate/Contributors.md | 1 + sources_non_forked/vim-snipmate/README.md | 4 +- .../vim-snipmate/autoload/snipMate.vim | 8 +- sources_non_forked/vim-snippets/README.md | 2 - .../vim-snippets/UltiSnips/elixir.snippets | 168 ---------- .../vim-snippets/UltiSnips/php.snippets | 10 +- .../vim-snippets/snippets/elixir.snippets | 24 +- .../snippets/javascript/javascript.snippets | 4 +- .../vim-surround/doc/surround.txt | 7 +- .../vim-surround/plugin/surround.vim | 30 +- vimrcs/plugins_config.vim | 2 + 104 files changed, 1743 insertions(+), 1464 deletions(-) create mode 100644 sources_non_forked/syntastic/syntax_checkers/javascript/standard.vim rename sources_non_forked/syntastic/syntax_checkers/{swift/xcrun.vim => sml/smlnj.vim} (50%) create mode 100644 sources_non_forked/syntastic/syntax_checkers/vim/vint.vim create mode 100644 sources_non_forked/vim-airline/autoload/airline/extensions/tabline/autoshow.vim create mode 100644 sources_non_forked/vim-airline/autoload/airline/extensions/tabline/buffers.vim create mode 100644 sources_non_forked/vim-airline/autoload/airline/extensions/tabline/buflist.vim rename sources_non_forked/vim-airline/autoload/airline/extensions/tabline/{ => formatters}/default.vim (75%) rename sources_non_forked/vim-airline/autoload/airline/extensions/tabline/{ => formatters}/unique_tail.vim (56%) rename sources_non_forked/vim-airline/autoload/airline/extensions/tabline/{ => formatters}/unique_tail_improved.vim (85%) create mode 100644 sources_non_forked/vim-airline/autoload/airline/extensions/tabline/tabs.vim delete mode 100644 sources_non_forked/vim-go/autoload/webapi/json.vim delete mode 100644 sources_non_forked/vim-snippets/UltiSnips/elixir.snippets diff --git a/sources_non_forked/ack.vim/README.md b/sources_non_forked/ack.vim/README.md index 008fb3dd..59f00f1d 100644 --- a/sources_non_forked/ack.vim/README.md +++ b/sources_non_forked/ack.vim/README.md @@ -1,131 +1,148 @@ # ack.vim -This plugin is a front for the Perl module -[App::Ack](http://search.cpan.org/~petdance/ack/ack). Ack can be used as a -replacement for 99% of the uses of _grep_. This plugin will allow you to run -ack from vim, and shows the results in a split window. +Run your favorite search tool from Vim, with an enhanced results list. + +This plugin was designed as a Vim frontend for the Perl module [App::Ack]. Ack +can be used as a replacement for 99% of the uses of _grep_. The plugin allows +you to run ack from vim, and shows the results in a split window. + +But here's a little secret for the Vim-seasoned: it's just a light wrapper for +Vim's [grepprg] and the [quickfix] window for match results. This makes it easy +to integrate with your own Vim configuration and use existing knowledge of core +features. It also means the plugin is flexible to use with other search tools. + +[App::Ack]: http://search.cpan.org/~petdance/ack/ack +[grepprg]: http://vimdoc.sourceforge.net/htmldoc/options.html#'grepprg' +[quickfix]: http://vimdoc.sourceforge.net/htmldoc/quickfix.html#quickfix ## Installation ### Ack -You will need the ack(>= 2.0), of course, to install it follow the -[manual](http://beyondgrep.com/install/) +You will need ack (>= 2.0), of course. To install it follow the +[manual](http://beyondgrep.com/install/). ### The Plugin -To install it is recommended to use one of the popular package managers for Vim, -rather than installing by drag and drop all required files into your `.vim` folder. - -#### Manual (not recommended) - -Just -[download](https://github.com/mileszs/ack.vim/archive/kb-improve-readme.zip) the -plugin and put it in your `~/.vim/`(or `%PROGRAMFILES%/Vim/vimfiles` on windows) +It is recommended to use one of the popular plugin managers for Vim. There are +many and you probably already have a preferred one, but a few examples for your +copy-and-paste convenience: #### Vundle - Bundle 'mileszs/ack.vim' + Plugin 'mileszs/ack.vim' #### NeoBundle NeoBundle 'mileszs/ack.vim' +#### Manual (not recommended) + +[Download][releases] the plugin and extract it in `~/.vim/` (or +`%PROGRAMFILES%/Vim/vimfiles` on Windows). + +[zipball]: https://github.com/mileszs/ack.vim/archive/master.zip + ## Usage :Ack [options] {pattern} [{directories}] -Search recursively in {directory} (which defaults to the current directory) for -the {pattern}. +Search recursively in `{directories}` (which defaults to the current directory) +for the `{pattern}`. -Files containing the search term will be listed in the split window, along with -the line number of the occurrence, once for each occurrence. [Enter] on a line -in this window will open the file, and place the cursor on the matching line. +Files containing the search term will be listed in the quickfix window, along +with the line number of the occurrence, once for each occurrence. `` on +a line in this window will open the file, and place the cursor on the matching +line. -Just like where you use :grep, :grepadd, :lgrep, and :lgrepadd, you can use -`:Ack`, `:AckAdd`, `:LAck`, and `:LAckAdd` respectively. -(See `doc/ack.txt`, or install and `:h Ack` for more information.) +Just like where you use `:grep`, `:grepadd`, `:lgrep`, and :`lgrepadd`, you can +use `:Ack`, `:AckAdd`, `:LAck`, and `:LAckAdd` respectively. (See `:help Ack` +after installing, or [`doc/ack.txt`][doc] in the repo, for more information.) -For more ack options see -[ack documentation](http://beyondgrep.com/documentation/) +For more ack help see [ack documentation](http://beyondgrep.com/documentation/). + +[doc]: https://github.com/mileszs/ack.vim/blob/master/doc/ack.txt ### Keyboard Shortcuts -In the quickfix window, you can use: +The quickfix results window is augmented with these convenience mappings: - o to open (same as enter) - O to open and close quickfix window - go to preview file (open but maintain focus on ack.vim results) + ? a quick summary of these keys, repeat to close + o to open (same as Enter) + O to open and close the quickfix window + go to preview file, open but maintain focus on ack.vim results t to open in new tab - T to open in new tab silently + T to open in new tab without moving to it h to open in horizontal split - H to open in horizontal split silently + H to open in horizontal split, keeping focus on the results v to open in vertical split - gv to open in vertical split silently + gv to open in vertical split, keeping focus on the results q to close the quickfix window -This Vim plugin is derived (and by derived, I mean copied, essentially) from -Antoine Imbert's blog post -[Ack and Vim Integration](http://blog.ant0ine.com/typepad/2007/03/ack-and-vim-integration.html) -(in particular, the function at the bottom of the post). I added a help file that -provides just enough reference to get you going. I also highly recommend you -check out the docs for the Perl script 'ack', for obvious reasons: -[ack - grep-like text finder](http://beyondgrep.com/). - ### Gotchas -Some characters have special meaning, and need to be escaped your search -pattern. For instance, '#'. You have to escape it like this `:Ack '\\\#define -foo'` to search for '#define foo'. (From blueyed in issue #5.) +Some characters have special meaning, and need to be escaped in your search +pattern. For instance, `#`. You need to escape it with `:Ack '\\\#define +foo'` to search for '#define foo'. See [issue #5]. + +[issue #5]: https://github.com/mileszs/ack.vim/issues/5 + +## Possibly FAQ + +#### Can I use `ag` ([The Silver Searcher]) with this? + +Absolutely, and probably other tools if their output is similar or you can +write a pattern match for it--just set `g:ackprg`. If you like, you can fall +back to Ack in case you use your vimrc on a system without Ag available: + +```vim +if executable('ag') + let g:ackprg = 'ag --vimgrep' +endif +``` + +Since Ack is quite portable you might check a copy of it into your dotfiles +repository in `~/bin` so you'll nearly always have it available. + +#### What's the difference from ag.vim? + +Well... not a lot really. + +Present maintainer, yours truly, [kind of wishes they never forked][sadface], +contributes to both, and wouldn't mind seeing them merged again. ag.vim got a +nice code clean-up (which ack.vim is now hopefully getting), and ack.vim picked +up a few features that haven't made their way to ag.vim, like `:AckWindow`, +optional background search execution with [vim-dispatch], and auto-previewing. + +[The Silver Searcher]: https://github.com/ggreer/the_silver_searcher +[sadface]: https://github.com/mileszs/ack.vim/commit/d97090fb502d40229e6976dfec0e06636ba227d5#commitcomment-5771145 ## Changelog -### 1.0 +Please see [the Github releases page][releases]. -* Remove support to ack 1.x -* Start to use a Changelog -* Use `autoload` directory to define functions, instead of `plugin`. -* Add option to auto fold the results(`g:ack_autofold_results`) -* Improve documentation, list all options and shortcuts -* Improve highlight option to work when passes directories or use quotes. -* Add g:ack_mapping -* Add g:ack_default_options -* Add a help toggle `?`(like NERDTree) +### 1.0.9 (unreleased) -### 1.0.1 +* Fix location list and layout of quickfix when using Dispatch (#154) +* Fix the quick help overlay clobbering the list mappings +* Fix `:AckFile` when using Dispatch +* Restore original `'makeprg'` and `'errorformat'` when using Dispatch +* Internal refactoring and clean-up -* Fixes #124. Bug with `g:ack_autofold_results` +## Credits -### 1.0.2 +This plugin is derived from Antoine Imbert's blog post [Ack and Vim +Integration][] (in particular, the function in the update to the post). [Miles +Sterrett][mileszs] packaged it up as a plugin and documented it in Vim's help +format, and since then [many contributors][contributors] have submitted +enhancements and fixes. -* Add compatibility with [vim-dispatch](https://github.com/tpope/vim-dispatch) +And of course, where would we be without [Ack]. And, you know, Vim. -### 1.0.3 +[Ack and Vim Integration]: http://blog.ant0ine.com/typepad/2007/03/ack-and-vim-integration.html +[mileszs]: https://github.com/mileszs +[contributors]: https://github.com/mileszs/ack.vim/graphs/contributors +[Ack]: http://beyondgrep.com/ -* Fixes #127. Use `&l:hlsearch` instead of `v:hlsearch` to keep compatibility -with versions that does not have this variable. - -### 1.0.4 - -* Fixes #128. Always apply mappings, even when using vim-dispatch. - -### 1.0.5 - -* Fixes #128. Fixes the `errorformat` for ack when using vim-dispatch. -* Do not use vim-dispatch by default. To use vim-dispath must set -`g:ack_use_dispatch` - -### 1.0.6 - -* Fixes highlight function to work when user passes options. Ex.: Ack -i test - Thank's @mannih. (#131, #134) - -### 1.0.7 - -* Fixes highlight function to work when passes more than one option, or options -with double dashes(--option) Thank's to @MiguelLatorre and @mannih - -### 1.0.8 - -* Fixes (again) highlight, now using negative look behind. -* Change mappings `o` and `O` to behave as documented +[vim-dispatch]: https://github.com/tpope/vim-dispatch +[releases]: https://github.com/mileszs/ack.vim/releases diff --git a/sources_non_forked/ack.vim/autoload/ack.vim b/sources_non_forked/ack.vim/autoload/ack.vim index fae73b1f..fd6e54ca 100644 --- a/sources_non_forked/ack.vim/autoload/ack.vim +++ b/sources_non_forked/ack.vim/autoload/ack.vim @@ -1,6 +1,30 @@ -function! ack#Ack(cmd, args) +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.') + let g:ack_use_dispatch = 0 + endif +else + let g:ack_use_dispatch = 0 +end + +"----------------------------------------------------------------------------- +" Public API +"----------------------------------------------------------------------------- + +function! ack#Ack(cmd, args) "{{{ + call s:Init(a:cmd) redraw - echo "Searching ..." + + " Local values that we'll temporarily set as options when searching + let l:grepprg = g:ackprg + let l:grepformat = '%f:%l:%c:%m,%f:%l:%m' " Include column number + + " Strip some options that are meaningless for path search and set match + " format accordingly. + if s:SearchingFilepaths() + let l:grepprg = substitute(l:grepprg, '-H\|--column', '', 'g') + let l:grepformat = '%f' + endif " If no pattern is provided, search for the word under the cursor if empty(a:args) @@ -8,89 +32,129 @@ function! ack#Ack(cmd, args) else let l:grepargs = a:args . join(a:000, ' ') end - echom l:grepargs - let l:ackprg_run = g:ackprg - " Format, used to manage column jump - if a:cmd =~# '-g$' - let g:ackformat="%f" - let l:ackprg_run = substitute(l:ackprg_run, '-H\|--column', '', 'g') + " NOTE: we escape special chars, but not everything using shellescape to + " allow for passing arguments etc + let l:escaped_args = escape(l:grepargs, '|#%') + + echo "Searching ..." + + if g:ack_use_dispatch + call s:SearchWithDispatch(l:grepprg, l:escaped_args, l:grepformat) else - let g:ackformat="%f:%l:%c:%m,%f:%l:%m" + call s:SearchWithGrep(a:cmd, l:grepprg, l:escaped_args, l:grepformat) endif - let grepprg_bak = &grepprg - let grepformat_bak = &grepformat - let &grepprg=l:ackprg_run - let &grepformat=g:ackformat + " Dispatch has no callback mechanism currently, we just have to display the + " list window early and wait for it to populate :-/ + call ack#ShowResults() + call s:Highlight(l:grepargs) +endfunction "}}} - try - " NOTE: we escape special chars, but not everything using shellescape to - " allow for passing arguments etc - if g:ack_use_dispatch - let &l:errorformat = g:ackformat - let &l:makeprg=g:ackprg." " . escape(l:grepargs, '|#%') - Make - else - silent execute a:cmd . " " . escape(l:grepargs, '|#%') - endif +function! ack#AckFromSearch(cmd, args) "{{{ + let search = getreg('/') + " translate vim regular expression to perl regular expression. + let search = substitute(search, '\(\\<\|\\>\)', '\\b', 'g') + call ack#Ack(a:cmd, '"' . search . '" ' . a:args) +endfunction "}}} - finally - let &grepprg=grepprg_bak - let &grepformat=grepformat_bak - endtry +function! ack#AckHelp(cmd, args) "{{{ + let args = a:args . ' ' . s:GetDocLocations() + call ack#Ack(a:cmd, args) +endfunction "}}} - if a:cmd =~# '^l' - let s:handler = g:ack_lhandler - let s:apply_mappings = g:ack_apply_lmappings - let s:close_cmd = ':lclose' - else - let s:handler = g:ack_qhandler - let s:apply_mappings = g:ack_apply_qmappings - let s:close_cmd = ':cclose' - endif +function! ack#AckWindow(cmd, args) "{{{ + let files = tabpagebuflist() - if !g:ack_use_dispatch - call ack#show_results() - else - copen - endif - call apply_maps() - call highlight(l:grepargs) + " remove duplicated filenames (files appearing in more than one window) + let files = filter(copy(sort(files)), 'index(files,v:val,v:key+1)==-1') + call map(files, "bufname(v:val)") + " remove unnamed buffers as quickfix (empty strings before shellescape) + call filter(files, 'v:val != ""') + + " expand to full path (avoid problems with cd/lcd in au QuickFixCmdPre) + let files = map(files, "shellescape(fnamemodify(v:val, ':p'))") + let args = a:args . ' ' . join(files) + + call ack#Ack(a:cmd, args) +endfunction "}}} + +function! ack#ShowResults() "{{{ + let l:handler = s:UsingLocList() ? g:ack_lhandler : g:ack_qhandler + execute l:handler + call s:ApplyMappings() redraw! -endfunction +endfunction "}}} -function! ack#show_results() - execute s:handler -endfunction +"----------------------------------------------------------------------------- +" Private API +"----------------------------------------------------------------------------- -function! s:apply_maps() - let g:ack_mappings.q = s:close_cmd - - execute "nnoremap ? :call ack#quick_help()" - - if s:apply_mappings && &ft == "qf" - if g:ack_autoclose - for key_map in items(g:ack_mappings) - execute printf("nnoremap %s %s", get(key_map, 0), get(key_map, 1) . s:close_cmd) - endfor - execute "nnoremap " . s:close_cmd - else - for key_map in items(g:ack_mappings) - execute printf("nnoremap %s %s", get(key_map, 0), get(key_map, 1)) - endfor - endif - - if exists("g:ackpreview") " if auto preview in on, remap j and k keys - execute "nnoremap j j" - execute "nnoremap k k" - endif +function! s:ApplyMappings() "{{{ + if !s:UsingListMappings() || &filetype != 'qf' + return endif -endfunction -function! ack#quick_help() - execute "edit " . globpath(&rtp, "doc/ack_quick_help.txt") + let l:wintype = s:UsingLocList() ? 'l' : 'c' + let l:closemap = ':' . l:wintype . 'close' + let g:ack_mappings.q = l:closemap + + nnoremap ? :call QuickHelp() + + if g:ack_autoclose + " We just map the 'go' and 'gv' mappings to close on autoclose, wtf? + for key_map in items(g:ack_mappings) + execute printf("nnoremap %s %s", get(key_map, 0), get(key_map, 1) . l:closemap) + endfor + + execute "nnoremap " . l:closemap + else + for key_map in items(g:ack_mappings) + execute printf("nnoremap %s %s", get(key_map, 0), get(key_map, 1)) + endfor + endif + + if exists("g:ackpreview") " if auto preview in on, remap j and k keys + nnoremap j j + nnoremap k k + endif +endfunction "}}} + +function! s:GetDocLocations() "{{{ + let dp = '' + for p in split(&rtp, ',') + let p = p . '/doc/' + if isdirectory(p) + let dp = p . '*.txt ' . dp + endif + endfor + + return dp +endfunction "}}} + +function! s:Highlight(args) "{{{ + if !g:ackhighlight + return + endif + + let @/ = matchstr(a:args, "\\v(-)\@", "n") +endfunction "}}} + +" Initialize state for an :Ack* or :LAck* search +function! s:Init(cmd) "{{{ + let s:searching_filepaths = (a:cmd =~# '-g$') ? 1 : 0 + let s:using_loclist = (a:cmd =~# '^l') ? 1 : 0 + + if g:ack_use_dispatch && s:using_loclist + call s:Warn('Dispatch does not support location lists! Proceeding with quickfix...') + let s:using_loclist = 0 + endif +endfunction "}}} + +function! s:QuickHelp() "{{{ + execute 'edit' globpath(&rtp, 'doc/ack_quick_help.txt') silent normal gg setlocal buftype=nofile @@ -104,51 +168,68 @@ function! ack#quick_help() setlocal nowrap setlocal foldlevel=20 setlocal foldmethod=diff - nnoremap ? :q!:call ack#show_results() -endfunction -function! s:highlight(args) - if !g:ackhighlight - return + nnoremap ? :q!:call ack#ShowResults() +endfunction "}}} + +function! s:SearchWithDispatch(grepprg, grepargs, grepformat) "{{{ + let l:makeprg_bak = &l:makeprg + let l:errorformat_bak = &l:errorformat + + " We don't execute a :grep command for Dispatch, so add -g here instead + if s:SearchingFilepaths() + let l:grepprg = a:grepprg . ' -g' + else + let l:grepprg = a:grepprg endif - let @/ = matchstr(a:args, "\\v(-)\@", "n") -endfunction + try + let &l:makeprg = l:grepprg . ' ' . a:grepargs + let &l:errorformat = a:grepformat -function! ack#AckFromSearch(cmd, args) - let search = getreg('/') - " translate vim regular expression to perl regular expression. - let search = substitute(search, '\(\\<\|\\>\)', '\\b', 'g') - call ack#Ack(a:cmd, '"' . search . '" ' . a:args) -endfunction + Make + finally + let &l:makeprg = l:makeprg_bak + let &l:errorformat = l:errorformat_bak + endtry +endfunction "}}} -function! s:GetDocLocations() - let dp = '' - for p in split(&rtp, ',') - let p = p . '/doc/' - if isdirectory(p) - let dp = p . '*.txt ' . dp - endif - endfor +function! s:SearchWithGrep(grepcmd, grepprg, grepargs, grepformat) "{{{ + let l:grepprg_bak = &l:grepprg + let l:grepformat_bak = &grepformat - return dp -endfunction + try + let &l:grepprg = a:grepprg + let &grepformat = a:grepformat -function! ack#AckHelp(cmd, args) - let args = a:args . ' ' . s:GetDocLocations() - call ack#Ack(a:cmd, args) -endfunction + silent execute a:grepcmd a:grepargs + finally + let &l:grepprg = l:grepprg_bak + let &grepformat = l:grepformat_bak + endtry +endfunction "}}} -function! ack#AckWindow(cmd, args) - let files = tabpagebuflist() - " remove duplicated filenames (files appearing in more than one window) - let files = filter(copy(sort(files)), 'index(files,v:val,v:key+1)==-1') - call map(files, "bufname(v:val)") - " remove unnamed buffers as quickfix (empty strings before shellescape) - call filter(files, 'v:val != ""') - " expand to full path (avoid problems with cd/lcd in au QuickFixCmdPre) - let files = map(files, "shellescape(fnamemodify(v:val, ':p'))") - let args = a:args . ' ' . join(files) - call ack#Ack(a:cmd, args) -endfunction +" Are we finding matching files, not lines? (the -g option -- :AckFile) +function! s:SearchingFilepaths() "{{{ + return get(s:, 'searching_filepaths', 0) +endfunction "}}} + +" Predicate for whether mappings are enabled for list type of current search. +function! s:UsingListMappings() "{{{ + if s:UsingLocList() + return g:ack_apply_lmappings + else + return g:ack_apply_qmappings + endif +endfunction "}}} + +" Were we invoked with a :LAck command? +function! s:UsingLocList() "{{{ + return get(s:, 'using_loclist', 0) +endfunction "}}} + +function! s:Warn(msg) "{{{ + echohl WarningMsg | echomsg 'Ack: ' . a:msg | echohl None +endf "}}} + +" 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 6b1be331..71d74548 100644 --- a/sources_non_forked/ack.vim/doc/ack.txt +++ b/sources_non_forked/ack.vim/doc/ack.txt @@ -68,7 +68,12 @@ with the line number of the occurrence, once for each occurrence. on a line in this window will open the file, and place the cursor on the matching line. -See http://betterthangrep.com/ for more information. +Note that if you are using Dispatch.vim with |g:ack_use_dispatch|, location +lists are not supported, because Dispatch does not support them at this time. +`:LAck` versions of commands above will give a warning and proceed to use the +quickfix list instead. + +See http://beyondgrep.com/ for more information on searching with ack. ============================================================================== @@ -208,7 +213,12 @@ Example: g:ack_use_dispatch Default: 0 -Use this option to use vim-dispatch to search the results in background +Use this option to use vim-dispatch to run searches in the background, with a +variety of execution backends for different systems. + +Due to limitations in Dispatch at this time, location lists are unsupported +and result windows will appear before results are ready. Still, these may be +acceptable tradeoffs for very large projects where searches are slow. Example: > diff --git a/sources_non_forked/ack.vim/doc/ack_quick_help.txt b/sources_non_forked/ack.vim/doc/ack_quick_help.txt index 5c52f6cb..bcdf5160 100644 --- a/sources_non_forked/ack.vim/doc/ack_quick_help.txt +++ b/sources_non_forked/ack.vim/doc/ack_quick_help.txt @@ -1,6 +1,6 @@ ==== ack.vim quick help =============== - *?:* Show this help + *?:* Show/quit this help *t:* Open in a new tab *T:* Open in a new tab silently *o:* Open diff --git a/sources_non_forked/ack.vim/plugin/ack.vim b/sources_non_forked/ack.vim/plugin/ack.vim index 6d6c55bc..2cc48036 100644 --- a/sources_non_forked/ack.vim/plugin/ack.vim +++ b/sources_non_forked/ack.vim/plugin/ack.vim @@ -1,3 +1,7 @@ +if exists('g:loaded_ack') + finish +endif + if !exists("g:ack_default_options") let g:ack_default_options = " -s -H --nocolor --nogroup --column" endif @@ -22,10 +26,6 @@ if !exists("g:ack_apply_lmappings") let g:ack_apply_lmappings = !exists("g:ack_lhandler") endif -if !exists("g:ack_use_dispatch") - let g:ack_use_dispatch = 0 -end - let s:ack_mappings = { \ "t": "T", \ "T": "TgTj", @@ -73,3 +73,7 @@ command! -bang -nargs=* -complete=help AckHelp call ack#AckHelp('grep', ) command! -bang -nargs=* -complete=help AckWindow call ack#AckWindow('grep', ) command! -bang -nargs=* -complete=help LAckWindow call ack#AckWindow('lgrep', ) + +let g:loaded_ack = 1 + +" vim:set et sw=2 ts=2 tw=78 fdm=marker diff --git a/sources_non_forked/goyo.vim/autoload/goyo.vim b/sources_non_forked/goyo.vim/autoload/goyo.vim index e4a904f7..b790e893 100644 --- a/sources_non_forked/goyo.vim/autoload/goyo.vim +++ b/sources_non_forked/goyo.vim/autoload/goyo.vim @@ -160,6 +160,18 @@ endfunction function! s:goyo_on(width) let s:orig_tab = tabpagenr() + let settings = + \ { 'laststatus': &laststatus, + \ 'showtabline': &showtabline, + \ 'fillchars': &fillchars, + \ 'winminwidth': &winminwidth, + \ 'winwidth': &winwidth, + \ 'winminheight': &winminheight, + \ 'winheight': &winheight, + \ 'ruler': &ruler, + \ 'sidescroll': &sidescroll, + \ 'sidescrolloff': &sidescrolloff + \ } " New tab tab split @@ -170,18 +182,7 @@ function! s:goyo_on(width) let t:goyo_margin_bottom = get(g:, 'goyo_margin_bottom', 4) let t:goyo_initial_dim = [t:goyo_width, t:goyo_margin_top, t:goyo_margin_bottom] let t:goyo_pads = {} - let t:goyo_revert = - \ { 'laststatus': &laststatus, - \ 'showtabline': &showtabline, - \ 'fillchars': &fillchars, - \ 'winminwidth': &winminwidth, - \ 'winwidth': &winwidth, - \ 'winminheight': &winminheight, - \ 'winheight': &winheight, - \ 'ruler': &ruler, - \ 'sidescroll': &sidescroll, - \ 'sidescrolloff': &sidescrolloff - \ } + let t:goyo_revert = settings let t:goyo_maps = extend(s:maps_nop(), s:maps_resize()) if has('gui_running') let t:goyo_revert.guioptions = &guioptions diff --git a/sources_non_forked/syntastic/README.markdown b/sources_non_forked/syntastic/README.markdown index f8cf88b7..73c09c66 100644 --- a/sources_non_forked/syntastic/README.markdown +++ b/sources_non_forked/syntastic/README.markdown @@ -29,14 +29,15 @@ 4.3. [Are there any local checkers for HTML5 that I can use with syntastic?](#faqhtml5) 4.4. [The `perl` checker has stopped working...](#faqperl) 4.5. [What happened to the `rustc` checker?](#faqrust) -4.6. [I run a checker and the location list is not updated...](#faqloclist) -4.6. [I run`:lopen` or `:lwindow` and the error window is empty...](#faqloclist) -4.7. [How can I pass additional arguments to a checker?](#faqargs) -4.8. [Syntastic supports several checkers for my filetype - how do I tell which one(s) to use?](#faqcheckers) -4.9. [What is the difference between syntax checkers and style checkers?](#faqstyle) -4.10. [I have enabled multiple checkers for the current filetype. How can I display all of the errors from all of the checkers together?](#faqaggregate) -4.11. [How can I jump between the different errors without using the location list at the bottom of the window?](#faqlnext) -4.12. [The error window is closed automatically when I :quit the current buffer but not when I :bdelete it?](#faqbdelete) +4.6. [What happened to the `xcrun` checker?](#faqxcrun) +4.7. [I run a checker and the location list is not updated...](#faqloclist) +4.7. [I run`:lopen` or `:lwindow` and the error window is empty...](#faqloclist) +4.8. [How can I pass additional arguments to a checker?](#faqargs) +4.9. [Syntastic supports several checkers for my filetype - how do I tell which one(s) to use?](#faqcheckers) +4.10. [What is the difference between syntax checkers and style checkers?](#faqstyle) +4.11. [I have enabled multiple checkers for the current filetype. How can I display all of the errors from all of the checkers together?](#faqaggregate) +4.12. [How can I jump between the different errors without using the location list at the bottom of the window?](#faqlnext) +4.13. [The error window is closed automatically when I :quit the current buffer but not when I :bdelete it?](#faqbdelete) 5. [Resources](#otherresources) - - - @@ -51,7 +52,7 @@ 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, syntax checking plugins exist for ActionScript, +At the time of this writing, syntastic has checking plugins for ActionScript, Ada, AppleScript, AsciiDoc, ASM, BEMHTML, Bro, Bourne shell, C, C++, C#, Cabal, Chef, CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, Dust, Elixir, Erlang, eRuby, Fortran, Gentoo metadata, GLSL, Go, Haml, Haskell, @@ -59,11 +60,15 @@ Haxe, Handlebars, HSS, HTML, Java, JavaScript, JSON, JSX, LESS, Lex, Limbo, LISP, LLVM intermediate language, Lua, Markdown, MATLAB, NASM, Objective-C, Objective-C++, OCaml, Perl, Perl POD, PHP, gettext Portable Object, OS X and iOS property lists, Puppet, Python, R, Racket, Relax NG, reStructuredText, RPM -spec, Ruby, SASS/SCSS, Scala, Slim, Swift, Tcl, TeX, Texinfo, Twig, TypeScript, +spec, Ruby, SASS/SCSS, Scala, Slim, SML, Tcl, TeX, Texinfo, Twig, TypeScript, Vala, Verilog, VHDL, VimL, xHtml, XML, XSLT, YACC, YAML, z80, Zope page templates, and zsh. See the [wiki][3] for details about the corresponding supported checkers. +A number of third-party Vim plugins also provide checkers for syntastic, +for example: [omnisharp-vim][25], [rust.vim][12], [syntastic-extras][26], +[syntastic-more][27], and [vim-swift][24]. + 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. @@ -183,10 +188,18 @@ 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`. +A second probable reason is that none of the available checkers are +enabled. Syntastic comes preconfigured with a default list of enabled checkers +per filetype, but this list is kept short in order to prevent slowing down Vim +or trying to run conflicting checks. The command `:SyntasticInfo` will show you +which checkers are enabled. You can tell syntastic which checkers (among the +available ones) you want to run by setting `g:syntastic__checkers` in +your `vimrc` (see [below](#faqcheckers)). + 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 -create an issue - or better yet, create a pull request. +post an [issue][4] - or better yet, create a pull request. @@ -236,14 +249,21 @@ let g:syntastic_enable_perl_checker = 1 __4.5. Q. What happened to the `rustc` checker?__ -A. It has been included in the [Rust compiler package][12]. If you have -a recent version of the Rust compiler, the checker should be picked up -automatically by syntastic. +A. It is now part of the [rust.vim][12] plugin. If you install this plugin the +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 +install this plugin the checker should be picked up automatically by syntastic. -__4.6. Q. I run a checker and the location list is not updated...__ -__4.6. Q. I run`:lopen` or `:lwindow` and the error window is empty...__ +__4.7. Q. I run a checker and the location list is not updated...__ +__4.7. Q. I run`:lopen` or `:lwindow` and the error window is empty...__ A. By default the location list is changed only when you run the `:Errors` command, in order to minimise conflicts with other plugins. If you want the @@ -255,7 +275,7 @@ let g:syntastic_always_populate_loc_list = 1 -__4.7. Q. How can I pass additional arguments to a checker?__ +__4.8. Q. How can I pass additional arguments to a checker?__ A. Almost all syntax checkers use the `makeprgBuild()` function. Those checkers that do can be configured using global variables. The general form of the @@ -271,7 +291,7 @@ See `:help syntastic-checker-options` for more information. -__4.8. Q. Syntastic supports several checkers for my filetype - how do I tell it +__4.9. Q. Syntastic supports several checkers for my filetype - how do I tell it which one(s) to use?__ A. Stick a line like this in your `vimrc`: @@ -312,7 +332,7 @@ filetype of the current file is `php`). -__4.9. Q. What is the difference between syntax checkers and style checkers?__ +__4.10. Q. What is the difference between syntax checkers and style checkers?__ A. The errors and warnings they produce are highlighted differently and can be filtered by different rules, but otherwise the distinction is pretty much @@ -342,7 +362,7 @@ See `:help syntastic_quiet_messages` for details. -__4.10. Q. I have enabled multiple checkers for the current filetype. How can I +__4.11. Q. I have enabled multiple checkers for the current filetype. How can I display all of the errors from all of the checkers together?__ A. Set `g:syntastic_aggregate_errors` to 1 in your `vimrc`: @@ -354,7 +374,7 @@ See `:help syntastic-aggregating-errors` for more details. -__4.11. Q. How can I jump between the different errors without using the location +__4.12. Q. How can I jump between the different errors without using the location list at the bottom of the window?__ A. Vim provides several built-in commands for this. See `:help :lnext` and @@ -366,7 +386,7 @@ mappings (among other things). -__4.12. Q. The error window is closed automatically when I :quit the current buffer +__4.13. Q. The error window is closed automatically when I :quit the current buffer but not when I :bdelete it?__ A. There is no safe way to handle that situation automatically, but you can @@ -404,7 +424,7 @@ a look at [jedi-vim][7], [python-mode][8], or [YouCompleteMe][9]. [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/ +[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 @@ -416,6 +436,10 @@ a look at [jedi-vim][7], [python-mode][8], or [YouCompleteMe][9]. [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