From 6a16a9393c145893e2cafd43a76423235cf69b0f Mon Sep 17 00:00:00 2001 From: amix Date: Fri, 18 Apr 2014 13:58:02 +0100 Subject: [PATCH] Updated plugins --- sources_non_forked/ack.vim/README.md | 125 +++---- sources_non_forked/ack.vim/Rakefile | 23 -- sources_non_forked/ack.vim/autoload/ack.vim | 143 ++++++++ sources_non_forked/ack.vim/doc/ack.txt | 149 +++++++- .../ack.vim/doc/ack_quick_help.txt | 14 + sources_non_forked/ack.vim/ftplugin/qf.vim | 9 + sources_non_forked/ack.vim/plugin/ack.vim | 149 +++----- sources_non_forked/goyo.vim/plugin/goyo.vim | 5 +- sources_non_forked/syntastic/CONTRIBUTING.md | 2 +- sources_non_forked/syntastic/README.markdown | 51 ++- .../autoload/syntastic/postprocess.vim | 19 -- .../autoload/syntastic/preprocess.vim | 39 +++ .../syntastic/autoload/syntastic/util.vim | 52 ++- .../syntastic/doc/syntastic.txt | 44 ++- .../syntastic/plugin/syntastic.vim | 8 +- .../syntastic/plugin/syntastic/checker.vim | 18 + .../syntastic/plugin/syntastic/loclist.vim | 4 + .../syntastic/plugin/syntastic/registry.vim | 1 + .../syntax_checkers/actionscript/mxmlc.vim | 2 +- .../syntastic/syntax_checkers/c/oclint.vim | 9 +- .../syntastic/syntax_checkers/c/splint.vim | 3 + .../syntax_checkers/css/prettycss.vim | 5 +- .../syntax_checkers/haskell/hdevtools.vim | 28 +- .../syntax_checkers/haskell/hlint.vim | 8 +- .../syntax_checkers/haskell/scan.vim | 43 +++ .../syntastic/syntax_checkers/html/jshint.vim | 3 +- .../syntastic/syntax_checkers/html/tidy.vim | 194 ++++++----- .../syntax_checkers/java/checkstyle.vim | 5 +- .../syntastic/syntax_checkers/java/javac.vim | 22 +- .../syntax_checkers/javascript/eslint.vim | 15 +- .../syntax_checkers/javascript/jscs.vim | 9 +- .../syntax_checkers/javascript/jshint.vim | 15 +- .../syntax_checkers/javascript/jsl.vim | 3 +- .../syntax_checkers/javascript/jsxhint.vim | 4 - .../syntax_checkers/python/pylama.vim | 5 +- .../syntax_checkers/python/pylint.vim | 10 +- .../syntastic/syntax_checkers/r/lint.vim | 78 +++++ .../syntastic/syntax_checkers/r/svtools.vim | 77 +++++ .../syntax_checkers/racket/code-ayatollah.vim | 5 +- .../syntastic/syntax_checkers/tex/chktex.vim | 9 +- .../syntax_checkers/typescript/tsc.vim | 9 +- .../syntastic/syntax_checkers/vim/vimlint.vim | 11 +- .../syntastic/syntax_checkers/xhtml/tidy.vim | 26 +- .../syntastic/syntax_checkers/xml/plutil.vim | 42 +++ .../tlib/autoload/tlib/World.vim | 4 +- .../tlib/autoload/tlib/cache.vim | 45 ++- .../tlib/autoload/tlib/input.vim | 7 +- .../tlib/autoload/tlib/list.vim | 40 ++- .../tlib/autoload/tlib/persistent.vim | 11 +- sources_non_forked/tlib/doc/tlib.txt | 8 + sources_non_forked/tlib/plugin/02tlib.vim | 10 +- .../autoload/airline/extensions.vim | 3 +- .../autoload/airline/extensions/branch.vim | 54 ++- .../autoload/airline/extensions/eclim.vim | 2 +- .../autoload/airline/extensions/tabline.vim | 8 +- .../airline/extensions/whitespace.vim | 10 +- .../autoload/airline/themes/luna.vim | 2 +- .../autoload/airline/themes/sol.vim | 10 +- .../vim-airline/doc/airline.txt | 9 +- .../vim-commentary/README.markdown | 10 +- .../vim-commentary/doc/commentary.txt | 19 +- .../vim-commentary/plugin/commentary.vim | 39 ++- .../vim-fugitive/doc/fugitive.txt | 2 + .../vim-fugitive/plugin/fugitive.vim | 126 ++++--- .../vim-markdown/ftplugin/markdown.vim | 28 ++ .../vim-snipmate/Contributors.md | 1 + sources_non_forked/vim-snipmate/README.md | 28 ++ .../vim-snipmate/autoload/snipMate.vim | 123 +++---- .../vim-snipmate/doc/snipMate.txt | 13 +- .../vim-snipmate/plugin/snipMate.vim | 77 +++-- .../vim-snipmate/plugin/snipMateInterface.vim | 2 - .../vim-snippets/UltiSnips/html.snippets | 2 +- .../vim-snippets/UltiSnips/java.snippets | 21 +- .../vim-snippets/UltiSnips/php.snippets | 12 +- .../vim-snippets/UltiSnips/proto.snippets | 52 +++ .../vim-snippets/UltiSnips/python.snippets | 80 ++++- .../vim-snippets/UltiSnips/r.snippets | 144 ++++++++ .../vim-snippets/UltiSnips/rnoweb.snippets | 3 + .../vim-snippets/UltiSnips/rst.snippets | 23 +- .../vim-snippets/UltiSnips/rust.snippets | 215 ++++++++++++ .../vim-snippets/UltiSnips/soy.snippets | 63 ++++ .../vim-snippets/plugin/vimsnippets.vim | 37 ++ .../vim-snippets/pythonx/vimsnippets.py | 20 ++ .../vim-snippets/snippets/django.snippets | 6 +- .../vim-snippets/snippets/erlang.snippets | 322 +++++++++++++++++- .../vim-snippets/snippets/eruby.snippets | 2 + .../vim-snippets/snippets/haskell.snippets | 2 + .../vim-snippets/snippets/jade.snippets | 18 + .../vim-snippets/snippets/python.snippets | 8 + .../vim-snippets/snippets/ruby.snippets | 43 +++ .../vim-snippets/snippets/scala.snippets | 3 +- 91 files changed, 2554 insertions(+), 708 deletions(-) delete mode 100644 sources_non_forked/ack.vim/Rakefile create mode 100644 sources_non_forked/ack.vim/autoload/ack.vim create mode 100644 sources_non_forked/ack.vim/doc/ack_quick_help.txt create mode 100644 sources_non_forked/ack.vim/ftplugin/qf.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/haskell/scan.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/r/lint.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/r/svtools.vim create mode 100644 sources_non_forked/syntastic/syntax_checkers/xml/plutil.vim delete mode 100644 sources_non_forked/vim-snipmate/plugin/snipMateInterface.vim create mode 100644 sources_non_forked/vim-snippets/UltiSnips/proto.snippets create mode 100644 sources_non_forked/vim-snippets/UltiSnips/r.snippets create mode 100644 sources_non_forked/vim-snippets/UltiSnips/rnoweb.snippets create mode 100644 sources_non_forked/vim-snippets/UltiSnips/rust.snippets create mode 100644 sources_non_forked/vim-snippets/UltiSnips/soy.snippets create mode 100644 sources_non_forked/vim-snippets/plugin/vimsnippets.vim create mode 100644 sources_non_forked/vim-snippets/pythonx/vimsnippets.py create mode 100644 sources_non_forked/vim-snippets/snippets/jade.snippets diff --git a/sources_non_forked/ack.vim/README.md b/sources_non_forked/ack.vim/README.md index e7182452..d9dbb929 100644 --- a/sources_non_forked/ack.vim/README.md +++ b/sources_non_forked/ack.vim/README.md @@ -1,101 +1,60 @@ -# ack.vim # +# 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. -The *Official Version* of this plugin is available at [vim.org](http://www.vim.org/scripts/script.php?script_id=2572). - -## Installation ## - +## Installation ### Ack -You have to install [ack](http://betterthangrep.com/), of course. - -Install on Debian / Ubuntu with: - - sudo apt-get install ack-grep - -Install on Fedora with: - - su -l -c 'yum install ack' - -Install on openSUSE with: - - sudo zypper install ack - -Install on Gentoo with: - - sudo emerge ack - -Install with Homebrew: - - brew install ack - -Install with MacPorts: - - sudo port install p5-app-ack - -Install with Gentoo Prefix: - - emerge ack - -Install on FreeBSD with: - - cd /usr/ports/textproc/p5-ack/ && make install clean - -You can specify a custom ack name and path in your .vimrc like so: - - let g:ackprg=" -H --nocolor --nogroup --column" - -Otherwise, you are on your own. +You will need the ack, of course, to install it follow the +[manual](http://beyondgrep.com/install/) ### The Plugin -If you have [Rake](http://rake.rubyforge.org/) installed, you can just run: `rake install`. +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. -Otherwise, the file ack.vim goes in ~/.vim/plugin, and the ack.txt file belongs in ~/.vim/doc. Be sure to run +#### Manual (not recommended) - :helptags ~/.vim/doc +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) -afterwards. +#### Vundle + Bundle 'mileszs/ack.vim' -## Usage ## +#### NeoBundle - :Ack [options] {pattern} [{directory}] + NeoBundle 'mileszs/ack.vim' -Search recursively in {directory} (which defaults to the current directory) for the {pattern}. +## Usage + + :Ack [options] {pattern} [{directories}] + +Search recursively in {directory} (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. -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 `doc/ack.txt`, or install and `:h Ack` for more information.) -**From the [ack docs](http://betterthangrep.com/)** (my favorite feature): +For more ack options see +[ack documentation](http://beyondgrep.com/documentation/) - --type=TYPE, --type=noTYPE - - Specify the types of files to include or exclude from a search. TYPE is a filetype, like perl or xml. --type=perl can also be specified as --perl, and --type=noperl can be done as --noperl. - - If a file is of both type "foo" and "bar", specifying --foo and --nobar will exclude the file, because an exclusion takes precedence over an inclusion. - - Type specifications can be repeated and are ORed together. - - See ack --help=types for a list of valid types. - -### 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](https://github.com/mileszs/ack.vim/issues/5).) - -### Keyboard Shortcuts ### +### Keyboard Shortcuts In the quickfix window, you can use: 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) t to open in new tab T to open in new tab silently @@ -106,9 +65,29 @@ In the quickfix window, you can use: 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 +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://betterthangrep.com/). +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.) + +## Changelog + +### 1.0 + +* 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) diff --git a/sources_non_forked/ack.vim/Rakefile b/sources_non_forked/ack.vim/Rakefile deleted file mode 100644 index af5a8695..00000000 --- a/sources_non_forked/ack.vim/Rakefile +++ /dev/null @@ -1,23 +0,0 @@ -# Added by Josh Nichols, a.k.a. technicalpickles -require 'rake' - -files = ['doc/ack.txt', 'plugin/ack.vim'] - -desc 'Install plugin and documentation' -task :install do - vimfiles = if ENV['VIMFILES'] - ENV['VIMFILES'] - elsif RUBY_PLATFORM =~ /(win|w)32$/ - File.expand_path("~/vimfiles") - else - File.expand_path("~/.vim") - end - files.each do |file| - target_file = File.join(vimfiles, file) - FileUtils.mkdir_p File.dirname(target_file) - FileUtils.cp file, target_file - - puts " Copied #{file} to #{target_file}" - end - -end diff --git a/sources_non_forked/ack.vim/autoload/ack.vim b/sources_non_forked/ack.vim/autoload/ack.vim new file mode 100644 index 00000000..ff8d8eb6 --- /dev/null +++ b/sources_non_forked/ack.vim/autoload/ack.vim @@ -0,0 +1,143 @@ +function! ack#Ack(cmd, args) + redraw + echo "Searching ..." + + " If no pattern is provided, search for the word under the cursor + if empty(a:args) + let l:grepargs = expand("") + else + let l:grepargs = a:args . join(a:000, ' ') + end + 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') + else + let g:ackformat="%f:%l:%c:%m,%f:%l:%m" + endif + + let grepprg_bak = &grepprg + let grepformat_bak = &grepformat + let &grepprg=l:ackprg_run + let &grepformat=g:ackformat + + try + " NOTE: we escape special chars, but not everything using shellescape to + " allow for passing arguments etc + silent execute a:cmd . " " . escape(l:grepargs, '|#%') + finally + let &grepprg=grepprg_bak + let &grepformat=grepformat_bak + endtry + + 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 + + call ack#show_results() + call highlight(l:grepargs) + + redraw! +endfunction + +function! ack#show_results() + execute s:handler + call apply_maps() +endfunction + +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 + endif +endfunction + +function! ack#quick_help() + execute "edit " . globpath(&rtp, "doc/ack_quick_help.txt") + + silent normal gg + setlocal buftype=nofile + setlocal bufhidden=hide + setlocal noswapfile + setlocal nobuflisted + setlocal nomodifiable + setlocal filetype=help + setlocal nonumber + setlocal norelativenumber + setlocal nowrap + setlocal foldlevel=20 + setlocal foldmethod=diff + nnoremap ? :q!:call ack#show_results() +endfunction + +function! s:highlight(args) + if !g:ackhighlight + return + endif + + let @/ = matchstr(a:args, "\\v\\w+\>|['\"]\\zs[^\"]+\\ze['\"]") + setlocal hlsearch + call feedkeys(":let v:hlsearch=1 \| echo \", "n") +endfunction + +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 + +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! ack#AckHelp(cmd, args) + let args = a:args . ' ' . s:GetDocLocations() + call ack#Ack(a:cmd, args) +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 diff --git a/sources_non_forked/ack.vim/doc/ack.txt b/sources_non_forked/ack.vim/doc/ack.txt index ec06da3a..33c10529 100644 --- a/sources_non_forked/ack.vim/doc/ack.txt +++ b/sources_non_forked/ack.vim/doc/ack.txt @@ -16,7 +16,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 - error is jumped to. + occurence is jumped to. :AckAdd [options] {pattern} [{directory}] *:AckAdd* @@ -45,7 +45,7 @@ shows the results in a split window. :AckHelp[!] [options] {pattern} *:AckHelp* - Search vim documentation files for the {pattern}. Behaves just like the + Search vim documentation files for the {pattern}. Behaves just like the |:Ack| command, but searches only vim documentation .txt files :LAckHelp [options] {pattern} *:LAckHelp* @@ -53,6 +53,16 @@ shows the results in a split window. Just like |:AckHelp| but instead of the |quickfix| list, matches are placed in the current |location-list|. +:AckWindow[!] [options] {pattern} *:AckWindow* + + Search all buffers visible in the screen (current tab page only) files for + the {pattern}. + +:LAckWindow [options] {pattern} *:LAckWindow* + + Just like |:AckWindow| but instead of the |quickfix| list, matches are + placed in the current |location-list|. + Files containing the search term will be listed in the split 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 @@ -60,6 +70,139 @@ line. See http://betterthangrep.com/ for more information. + +============================================================================== +CONFIGURATION *ack-configuration* + + *g:ackprg* +g:ackprg +Default for ubuntu: "ack-grep" +Default for other systems: "ack" + +Use this option to specify the ack command and its options + +Example: +> + let g:ackprg = "other-bin-ack" +< + + g:ack_default_options* +g:ack_default_options +Default: " -s -H --nocolor --nogroup --column" + +Use this option to specify the options used by ack + +Example: +> + let g:ackprg = + \ " -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. + + *g:ack_apply_lmappings* +g:ack_apply_lmappings +Default: 1 + +This option enable mappings on Location list window. + + *g:ack_mappings* +g:ack_mappings +Default: { + \ "t": "T", + \ "T": "TgTj", + \ "o": "", + \ "O": ":ccl", + \ "go": "j", + \ "h": "K", + \ "H": "Kb", + \ "v": "HbJt", + \ "gv": "HbJ" } + +This option list all maps create on quickfix/Location list window. + +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" + +Command to open the quickview window. + +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" + +Command to open the Location list window. + +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 + +Use this option to highlight the searched term. + +Example: +> + let g:ackhighlight = 1 +< + + *g:ack_autoclose* +g:ack_autoclose +Default: 0 + +Use this option to specify whether to close the quickfix window after +using any of the shortcuts. + +Example: +> + let g:ack_autoclose = 1 +< + + *g:ack_autofold_results* + +g:ack_autofold_results +Default: 0 + +Use this option to fold the results in quickfix by file name. Only the current +fold will be open by default and while you press 'j' and 'k' to move between the +results if you hit other fold the last one will be closed and the current will +be open. + +Example: +> + let g:ack_autofold_results = 1 +< + + *g:ackpreview* + +g:ackpreview +Default: 0 + +Use this option to automagically open the file with 'j' or 'k'. + +Example: +> + let g:ackpreview = 1 +< + ============================================================================== MAPPINGS *ack-mappings* @@ -67,6 +210,8 @@ The following keyboard shortcuts are available in the quickfix window: o open file (same as enter). +O open file and close quickfix window. + go preview file (open but maintain focus on ack.vim results). t open in a new tab. diff --git a/sources_non_forked/ack.vim/doc/ack_quick_help.txt b/sources_non_forked/ack.vim/doc/ack_quick_help.txt new file mode 100644 index 00000000..5c52f6cb --- /dev/null +++ b/sources_non_forked/ack.vim/doc/ack_quick_help.txt @@ -0,0 +1,14 @@ +==== ack.vim quick help =============== + + *?:* Show this help + *t:* Open in a new tab + *T:* Open in a new tab silently + *o:* Open + *O:* Open and close result window + *go:* Preview + *h:* Horizontal open + *H:* Horizontal open silently + *v:* Vertical open + *gv:* Vertical open silently + +======================================== diff --git a/sources_non_forked/ack.vim/ftplugin/qf.vim b/sources_non_forked/ack.vim/ftplugin/qf.vim new file mode 100644 index 00000000..7da45a4c --- /dev/null +++ b/sources_non_forked/ack.vim/ftplugin/qf.vim @@ -0,0 +1,9 @@ +if g:ack_autofold_results + setlocal foldlevel=0 + setlocal foldmethod=expr + setlocal foldexpr=matchstr(getline(v:lnum),'^[^\|]\\+')==#matchstr(getline(v:lnum+1),'^[^\|]\\+')?1:'<1' + setlocal foldenable + setlocal foldclose=all + setlocal foldopen=all + nnoremap j jzz +endif diff --git a/sources_non_forked/ack.vim/plugin/ack.vim b/sources_non_forked/ack.vim/plugin/ack.vim index 3c664bd5..e5d0507b 100644 --- a/sources_non_forked/ack.vim/plugin/ack.vim +++ b/sources_non_forked/ack.vim/plugin/ack.vim @@ -1,16 +1,17 @@ -" NOTE: You must, of course, install the ack script -" in your path. -" On Debian / Ubuntu: -" sudo apt-get install ack-grep -" With MacPorts: -" sudo port install p5-app-ack -" With Homebrew: -" brew install ack +if !exists("g:ack_default_options") + let g:ack_default_options = " -s -H --nocolor --nogroup --column" +endif " Location of the ack utility if !exists("g:ackprg") - let s:ackcommand = executable('ack-grep') ? 'ack-grep' : 'ack' - let g:ackprg=s:ackcommand." -H --nocolor --nogroup --column" + if executable('ack') + let g:ackprg = "ack" + elseif executable('ack-grep') + let g:ackprg = "ack-grep" + else + finish + endif + let g:ackprg .= g:ack_default_options endif if !exists("g:ack_apply_qmappings") @@ -21,102 +22,50 @@ if !exists("g:ack_apply_lmappings") let g:ack_apply_lmappings = !exists("g:ack_lhandler") endif +let s:ack_mappings = { + \ "t": "T", + \ "T": "TgTj", + \ "o": "", + \ "O": ":ccl", + \ "go": "j", + \ "h": "K", + \ "H": "Kb", + \ "v": "HbJt", + \ "gv": "HbJ" } + +if exists("g:ack_mappings") + let g:ack_mappings = extend(s:ack_mappings, g:ack_mappings) +else + let g:ack_mappings = s:ack_mappings +endif + if !exists("g:ack_qhandler") - let g:ack_qhandler="botright copen" + let g:ack_qhandler = "botright copen" endif if !exists("g:ack_lhandler") - let g:ack_lhandler="botright lopen" + let g:ack_lhandler = "botright lopen" endif -function! s:Ack(cmd, args) - redraw - echo "Searching ..." +if !exists("g:ackhighlight") + let g:ackhighlight = 0 +endif - " If no pattern is provided, search for the word under the cursor - if empty(a:args) - let l:grepargs = expand("") - else - let l:grepargs = a:args . join(a:000, ' ') - end +if !exists("g:ack_autoclose") + let g:ack_autoclose = 0 +endif - " Format, used to manage column jump - if a:cmd =~# '-g$' - let g:ackformat="%f" - else - let g:ackformat="%f:%l:%c:%m,%f:%l:%m" - end +if !exists("g:ack_autofold_results") + let g:ack_autofold_results = 0 +endif - let grepprg_bak=&grepprg - let grepformat_bak=&grepformat - try - let &grepprg=g:ackprg - let &grepformat=g:ackformat - silent execute a:cmd . " " . escape(l:grepargs, '|') - finally - let &grepprg=grepprg_bak - let &grepformat=grepformat_bak - endtry - - if a:cmd =~# '^l' - exe g:ack_lhandler - let l:apply_mappings = g:ack_apply_lmappings - let l:close_cmd = ':lclose' - else - exe g:ack_qhandler - let l:apply_mappings = g:ack_apply_qmappings - let l:close_cmd = ':cclose' - endif - - if l:apply_mappings - exec "nnoremap q " . l:close_cmd - exec "nnoremap t T" - exec "nnoremap T TgT" - exec "nnoremap o " - exec "nnoremap go " - exec "nnoremap h K" - exec "nnoremap H Kb" - exec "nnoremap v HbJt" - exec "nnoremap gv HbJ" - endif - - " If highlighting is on, highlight the search keyword. - if exists("g:ackhighlight") - let @/ = substitute(l:grepargs,'["'']','','g') - set hlsearch - end - - redraw! -endfunction - -function! s:AckFromSearch(cmd, args) - let search = getreg('/') - " translate vim regular expression to perl regular expression. - let search = substitute(search,'\(\\<\|\\>\)','\\b','g') - call s:Ack(a:cmd, '"' . search .'" '. a:args) -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:AckHelp(cmd,args) - let args = a:args.' '.s:GetDocLocations() - call s:Ack(a:cmd,args) -endfunction - -command! -bang -nargs=* -complete=file Ack call s:Ack('grep',) -command! -bang -nargs=* -complete=file AckAdd call s:Ack('grepadd', ) -command! -bang -nargs=* -complete=file AckFromSearch call s:AckFromSearch('grep', ) -command! -bang -nargs=* -complete=file LAck call s:Ack('lgrep', ) -command! -bang -nargs=* -complete=file LAckAdd call s:Ack('lgrepadd', ) -command! -bang -nargs=* -complete=file AckFile call s:Ack('grep -g', ) -command! -bang -nargs=* -complete=help AckHelp call s:AckHelp('grep',) -command! -bang -nargs=* -complete=help LAckHelp call s:AckHelp('lgrep',) +command! -bang -nargs=* -complete=file Ack call ack#Ack('grep', ) +command! -bang -nargs=* -complete=file AckAdd call ack#Ack('grepadd', ) +command! -bang -nargs=* -complete=file AckFromSearch call ack#AckFromSearch('grep', ) +command! -bang -nargs=* -complete=file LAck call ack#Ack('lgrep', ) +command! -bang -nargs=* -complete=file LAckAdd call ack#Ack('lgrepadd', ) +command! -bang -nargs=* -complete=file AckFile call ack#Ack('grep -g', ) +command! -bang -nargs=* -complete=help AckHelp call ack#AckHelp('grep', ) +command! -bang -nargs=* -complete=help LAckHelp call ack#AckHelp('lgrep', ) +command! -bang -nargs=* -complete=help AckWindow call ack#AckWindow('grep', ) +command! -bang -nargs=* -complete=help LAckWindow call ack#AckWindow('lgrep', ) diff --git a/sources_non_forked/goyo.vim/plugin/goyo.vim b/sources_non_forked/goyo.vim/plugin/goyo.vim index 751162ce..311589ed 100644 --- a/sources_non_forked/goyo.vim/plugin/goyo.vim +++ b/sources_non_forked/goyo.vim/plugin/goyo.vim @@ -46,7 +46,7 @@ function! s:init_pad(command) execute a:command setlocal buftype=nofile bufhidden=wipe nomodifiable nobuflisted noswapfile - \ nonu nocursorline winfixwidth winfixheight statusline=\ + \ nonu nocursorline nocursorcolumn winfixwidth winfixheight statusline=\ if exists('&rnu') setlocal nornu endif @@ -115,6 +115,8 @@ function! s:tranquilize() endfunction function! s:goyo_on(width) + let s:orig_tab = tabpagenr() + " New tab tab split @@ -249,6 +251,7 @@ function! s:goyo_off() bd endif tabclose + execute 'normal! '.s:orig_tab.'gt' let wmh = remove(goyo_revert, 'winminheight') let wh = remove(goyo_revert, 'winheight') diff --git a/sources_non_forked/syntastic/CONTRIBUTING.md b/sources_non_forked/syntastic/CONTRIBUTING.md index 764ffffc..2eac8325 100644 --- a/sources_non_forked/syntastic/CONTRIBUTING.md +++ b/sources_non_forked/syntastic/CONTRIBUTING.md @@ -29,7 +29,7 @@ Following the coding conventions/styles used in the syntastic core: * Use 4 space indents. * Don't use abbreviated keywords - e.g. use `endfunction`, not `endfun` (there's always room for more fun!). * 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](http://www.refactoring.com/catalog/introduceExplainingVariable.html) to aid readability. +* Code for maintainability. We would rather a function be a couple of lines longer and have (for example) some [explaining variables](http://www.refactoring.com/catalog/extractVariable.html) to aid readability. # Syntax checker style notes diff --git a/sources_non_forked/syntastic/README.markdown b/sources_non_forked/syntastic/README.markdown index 653bd7c6..cdb6f559 100644 --- a/sources_non_forked/syntastic/README.markdown +++ b/sources_non_forked/syntastic/README.markdown @@ -40,10 +40,11 @@ CoffeeScript, Coco, Coq, CSS, Cucumber, CUDA, D, Dart, DocBook, 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, MATLAB, NASM, Objective-C, Objective-C++, -OCaml, Perl, Perl POD, PHP, gettext Portable Object, Puppet, Python, Racket, -reStructuredText, Ruby, Rust, SASS/SCSS, Scala, Slim, Tcl, TeX, Texinfo, Twig, -TypeScript, Vala, Verilog, VHDL, VimL, xHtml, XML, XSLT, YACC, YAML, z80, Zope -page templates, and zsh. +OCaml, Perl, Perl POD, PHP, gettext Portable Object, OS X and iOS property +lists, Puppet, Python, Racket, R, reStructuredText, Ruby, Rust, SASS/SCSS, +Scala, Slim, 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. 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 @@ -111,6 +112,8 @@ If you get an error when you do this, then you probably didn't install ## 3\. FAQ + + __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 @@ -125,6 +128,8 @@ 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. + + __Q. The `perl` checker has stopped working...__ A. The `perl` checker runs `perl -c` against your file, which in turn @@ -138,6 +143,8 @@ still producing useful results, the checker is now disabled by default. To let g:syntastic_enable_perl_checker = 1 ``` + + __Q. I run a checker and the location list is not updated...__ A. By default the location list is changed only when you run the `:Errors` @@ -148,6 +155,8 @@ your vimrc: let g:syntastic_always_populate_loc_list = 1 ``` + + __Q. How can I pass additional arguments to a checker?__ A. Almost all syntax checkers use the `makeprgBuild()` function. Those checkers @@ -162,6 +171,8 @@ let g:syntastic_ruby_mri_args = "--my --args --here" See `:help syntastic-checker-options` for more information. + + __Q. Syntastic supports several checkers for my filetype - how do I tell it which one(s) to use?__ @@ -190,6 +201,32 @@ let g:syntastic_php_checkers = ['php', 'phpcs', 'phpmd'] This is telling syntastic to run the `php` checker first, and if no errors are found, run `phpcs`, and then `phpmd`. +You can also run checkers explicitly by calling `:SyntasticCheck `. + +e.g. to run `phpcs` and `phpmd`: +```vim +:SyntasticCheck phpcs phpmd +``` + +This works for any checkers available for the current filetype, even if they +aren't listed in `g:syntastic__checkers`. You can't run checkers for +"foreign" filetypes though (e.g. you can't run, say, a Python checker if the +current filetype is `php`). + + + +__Q. How can I display together the errors found by all checkers enabled for +the current file?__ + +A. Set `g:syntastic_aggregate_errors` to 1 in your vimrc: +```vim +let g:syntastic_aggregate_errors = 1 +``` + +See `:help syntastic-aggregating-errors` for more details. + + + __Q. How can I jump between the different errors without using the location list at the bottom of the window?__ @@ -200,6 +237,8 @@ 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 mappings (among other things). + + __Q. A syntax checker is giving me unwanted/strange style tips?__ A. Some filetypes (e.g. php) have style checkers as well as syntax @@ -214,6 +253,8 @@ let g:syntastic_quiet_messages = { "type": "style" } ``` See `:help syntastic_quiet_messages` for details. + + __Q. The error window is closed automatically when I :quit the current buffer but not when I :bdelete it?__ @@ -248,5 +289,5 @@ a look at [jedi-vim][7], [python-mode][8], or [YouCompleteMe][9]. [6]: http://stackoverflow.com/questions/tagged/syntastic [7]: https://github.com/davidhalter/jedi-vim [8]: https://github.com/klen/python-mode -[9]: https://github.com/Valloric/YouCompleteMe +[9]: http://valloric.github.io/YouCompleteMe/ [10]: http://perldoc.perl.org/perlrun.html#*-c* diff --git a/sources_non_forked/syntastic/autoload/syntastic/postprocess.vim b/sources_non_forked/syntastic/autoload/syntastic/postprocess.vim index 1558f0f8..377e64a7 100644 --- a/sources_non_forked/syntastic/autoload/syntastic/postprocess.vim +++ b/sources_non_forked/syntastic/autoload/syntastic/postprocess.vim @@ -8,25 +8,6 @@ set cpo&vim " Public functions {{{1 -function! s:compareErrorItems(a, b) " {{{2 - if a:a['bufnr'] != a:b['bufnr'] - " group by files - return a:a['bufnr'] - a:b['bufnr'] - elseif a:a['lnum'] != a:b['lnum'] - return a:a['lnum'] - a:b['lnum'] - elseif a:a['type'] !=? a:b['type'] - " errors take precedence over warnings - return a:a['type'] ==? 'e' ? -1 : 1 - else - return get(a:a, 'col', 0) - get(a:b, 'col', 0) - endif -endfunction " }}}2 - -" natural sort -function! syntastic#postprocess#sort(errors) " {{{2 - return sort(copy(a:errors), 's:compareErrorItems') -endfunction " }}}2 - " merge consecutive blanks function! syntastic#postprocess#compressWhitespace(errors) " {{{2 for e in a:errors diff --git a/sources_non_forked/syntastic/autoload/syntastic/preprocess.vim b/sources_non_forked/syntastic/autoload/syntastic/preprocess.vim index f1af35be..4501e3ff 100644 --- a/sources_non_forked/syntastic/autoload/syntastic/preprocess.vim +++ b/sources_non_forked/syntastic/autoload/syntastic/preprocess.vim @@ -56,6 +56,45 @@ function! syntastic#preprocess#perl(errors) " {{{2 return syntastic#util#unique(out) endfunction " }}}2 +function! syntastic#preprocess#rparse(errors) " {{{2 + let errlist = copy(a:errors) + + " remove uninteresting lines and handle continuations + let i = 0 + while i < len(errlist) + if i > 0 && errlist[i][:1] == ' ' && errlist[i] !~ '\m\s\+\^$' + let errlist[i-1] .= errlist[i][1:] + call remove(errlist, i) + elseif errlist[i] !~ '\m^\(Lint:\|Lint checking:\|Error in\) ' + call remove(errlist, i) + else + let i += 1 + endif + endwhile + + let out = [] + let fname = '' + for e in errlist + if match(e, '\m^Lint: ') == 0 + let parts = matchlist(e, '\m^Lint: \(.*\): found on lines \([0-9, ]\+\)\(+\(\d\+\) more\)\=') + if len(parts) >= 3 + for line in split(parts[2], '\m,\s*') + call add(out, 'E:' . fname . ':' . line . ': ' . parts[1]) + endfor + endif + if len(parts) >= 5 && parts[4] != '' + call add(out, 'E:' . fname . ':0: ' . parts[1] . ' - ' . parts[4] . ' messages not shown') + endif + elseif match(e, '\m^Lint checking: ') == 0 + let fname = matchstr(e, '\m^Lint checking: \zs.*') + elseif match(e, '\m^Error in ') == 0 + call add(out, substitute(e, '\m^Error in .\+ : .\+\ze:\d\+:\d\+: ', 'E:' . fname, '')) + endif + endfor + + return out +endfunction " }}}2 + function! syntastic#preprocess#validator(errors) " {{{2 let out = [] for e in a:errors diff --git a/sources_non_forked/syntastic/autoload/syntastic/util.vim b/sources_non_forked/syntastic/autoload/syntastic/util.vim index d1dc2618..d4fa034b 100644 --- a/sources_non_forked/syntastic/autoload/syntastic/util.vim +++ b/sources_non_forked/syntastic/autoload/syntastic/util.vim @@ -101,7 +101,7 @@ function! syntastic#util#wideMsg(msg) " {{{2 "convert tabs to spaces so that the tabs count towards the window "width as the proper amount of characters let chunks = split(msg, "\t", 1) - let msg = join(map(chunks[:-2], 'v:val . repeat(" ", &ts - s:width(v:val) % &ts)'), '') . chunks[-1] + let msg = join(map(chunks[:-2], 'v:val . repeat(" ", &tabstop - s:width(v:val) % &tabstop)'), '') . chunks[-1] let msg = strpart(msg, 0, &columns - 1) set noruler noshowcmd @@ -218,6 +218,13 @@ function! syntastic#util#dictFilter(errors, filter) " {{{2 endtry endfunction " }}}2 +function! syntastic#util#sortLoclist(errors) " {{{2 + for e in a:errors + call s:setScreenColumn(e) + endfor + call sort(a:errors, 's:compareErrorItems') +endfunction " }}}2 + " }}}1 " Private functions {{{1 @@ -254,6 +261,49 @@ function! s:translateElement(key, term) " {{{2 return ret endfunction " }}}2 +function! s:screenWidth(str, tabstop) " {{{2 + let chunks = split(a:str, "\t", 1) + let width = s:width(chunks[-1]) + for c in chunks[:-2] + let cwidth = s:width(c) + let width += cwidth + a:tabstop - cwidth % a:tabstop + endfor + return width +endfunction " }}}2 + +function! s:setScreenColumn(item) " {{{2 + if !has_key(a:item, 'scol') + let col = get(a:item, 'col', 0) + if col != 0 && a:item['vcol'] == 0 + let buf = str2nr(a:item['bufnr']) + try + let line = getbufline(buf, a:item['lnum'])[0] + catch /\m^Vim\%((\a\+)\)\=:E684/ + let line = '' + endtry + let a:item['scol'] = s:screenWidth(strpart(line, 0, col), getbufvar(buf, '&tabstop')) + else + let a:item['scol'] = col + endif + endif +endfunction " }}}2 + +function! s:compareErrorItems(a, b) " {{{2 + if a:a['bufnr'] != a:b['bufnr'] + " group by file + return a:a['bufnr'] - a:b['bufnr'] + elseif a:a['lnum'] != a:b['lnum'] + " sort by line + return a:a['lnum'] - a:b['lnum'] + elseif a:a['type'] !=? a:b['type'] + " errors take precedence over warnings + return a:a['type'] ==? 'E' ? -1 : 1 + else + " sort by screen column + return a:a['scol'] - a:b['scol'] + endif +endfunction " }}}2 + " }}}1 let &cpo = s:save_cpo diff --git a/sources_non_forked/syntastic/doc/syntastic.txt b/sources_non_forked/syntastic/doc/syntastic.txt index 86a5ed2b..fd0fb2b9 100644 --- a/sources_non_forked/syntastic/doc/syntastic.txt +++ b/sources_non_forked/syntastic/doc/syntastic.txt @@ -39,6 +39,8 @@ CONTENTS *syntastic-contents* 6.2.Interaction with python-mode...........|syntastic-pymode| 6.3.Interaction with the fish shell........|syntastic-fish| 6.4.Using syntastic with the fizsh shell...|syntastic-fizsh| + 6.5.Interaction with Eclim.................|syntastic-eclim| + 6.6.Interaction with vim-virtualenv........|syntastic-vim-virtualenv| 7.About........................................|syntastic-about| 8.License......................................|syntastic-license| @@ -186,7 +188,12 @@ If |'syntastic_aggregate_errors'| is set, syntastic runs all checkers that apply (still cf. |syntastic-filetype-checkers|), then aggregates errors found by all checkers in a single list, and notifies you. In this mode each error message is labeled with the name of the checker that generated it, but you can -disable these labels by unsetting '|syntastic_id_checkers|'. +disable generation of these labels by turning off '|syntastic_id_checkers|'. + +If |'syntastic_sort_aggregated_errors'| is set (which is the default), messages +in the aggregated list are grouped by file, then sorted by line number, then +type, then column number. Otherwise messages produced by the same checker are +grouped together. ------------------------------------------------------------------------------ 2.6 Filtering errors *syntastic-filtering-errors* @@ -278,6 +285,14 @@ a file with a composite filetype), it might not be immediately obvious which checker has produced a given error message. This variable instructs syntastic to label error messages with the names of the checkers that created them. > let g:syntastic_id_checkers = 0 +< + *'syntastic_sort_aggregated_errors'* +Default: 1 +By default, when |syntastic_aggregate_errors| is enabled, errors are grouped +by file, then sorted by line number, then grouped by type (namely, errors take +precedence over warnings), then they are sorted by column number. If you want +to leave messages grouped by checker output, set this variable to 0. > + let g:syntastic_sort_aggregated_errors = 0 < *'syntastic_echo_current_error'* Default: 1 @@ -557,10 +572,10 @@ Use |:SyntasticInfo| to see which checkers are available for a given filetype. ------------------------------------------------------------------------------ 5.2 Choosing the executable *syntastic-config-exec* - *'syntastic___exec'* + *'syntastic___exec'* The executable used by a checker is normally defined automatically, when the checkers is registered. You can however override it by setting the variable -'g:syntastic___exec': > +'g:syntastic___exec': > let g:syntastic_ruby_mri_exec = '~/bin/ruby2' < ------------------------------------------------------------------------------ @@ -569,7 +584,7 @@ checkers is registered. You can however override it by setting the variable Most checkers use the 'makeprgBuild()' function and provide many options by default - in fact you can customise every part of the command that gets called. - *'syntastic___