docvim 0.3.1.1 → 0.3.1.2
raw patch · 154 files changed
+19552/−4 lines, 154 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- README.md +6/−0
- docvim.cabal +155/−4
- lib/Text/Docvim/Printer/Vim.hs +3/−0
- tests/fixtures/integration/command-t/golden/ast.golden +3/−0
- tests/fixtures/integration/command-t/golden/markdown.golden +3/−0
- tests/fixtures/integration/command-t/golden/plaintext.golden +3/−0
- tests/fixtures/integration/command-t/input/autoload/commandt.vim +188/−0
- tests/fixtures/integration/command-t/input/autoload/commandt/isengard.vim +25/−0
- tests/fixtures/integration/command-t/input/autoload/commandt/mirkwood.vim +44/−0
- tests/fixtures/integration/command-t/input/autoload/commandt/private.vim +90/−0
- tests/fixtures/integration/command-t/input/plugin/command-t.vim +20/−0
- tests/fixtures/integration/ferret/golden/ast.golden +5649/−0
- tests/fixtures/integration/ferret/golden/markdown.golden +461/−0
- tests/fixtures/integration/ferret/golden/plaintext.golden +569/−0
- tests/fixtures/integration/ferret/input/autoload/ferret/private.vim +454/−0
- tests/fixtures/integration/ferret/input/autoload/ferret/private/async.vim +152/−0
- tests/fixtures/integration/ferret/input/autoload/ferret/private/dispatch.vim +24/−0
- tests/fixtures/integration/ferret/input/autoload/ferret/private/vanilla.vim +19/−0
- tests/fixtures/integration/ferret/input/ftplugin/qf.vim +64/−0
- tests/fixtures/integration/ferret/input/plugin/ferret.vim +628/−0
- tests/fixtures/integration/loupe/golden/ast.golden +2438/−0
- tests/fixtures/integration/loupe/golden/markdown.golden +258/−0
- tests/fixtures/integration/loupe/golden/plaintext.golden +315/−0
- tests/fixtures/integration/loupe/input/autoload/loupe/private.vim +136/−0
- tests/fixtures/integration/loupe/input/plugin/loupe.vim +383/−0
- tests/fixtures/integration/pinnacle/golden/ast.golden +898/−0
- tests/fixtures/integration/pinnacle/golden/markdown.golden +103/−0
- tests/fixtures/integration/pinnacle/golden/plaintext.golden +116/−0
- tests/fixtures/integration/pinnacle/input/autoload/pinnacle.vim +210/−0
- tests/fixtures/integration/scalpel/golden/ast.golden +1521/−0
- tests/fixtures/integration/scalpel/golden/markdown.golden +168/−0
- tests/fixtures/integration/scalpel/golden/plaintext.golden +182/−0
- tests/fixtures/integration/scalpel/input/autoload/scalpel.vim +88/−0
- tests/fixtures/integration/scalpel/input/plugin/scalpel.vim +264/−0
- tests/fixtures/integration/terminus/golden/ast.golden +281/−0
- tests/fixtures/integration/terminus/golden/markdown.golden +0/−0
- tests/fixtures/integration/terminus/golden/plaintext.golden +0/−0
- tests/fixtures/integration/terminus/input/autoload/terminus/private.vim +45/−0
- tests/fixtures/integration/terminus/input/plugin/terminus.vim +144/−0
- tests/fixtures/integration/vim-clipper/golden/ast.golden +57/−0
- tests/fixtures/integration/vim-clipper/golden/markdown.golden +0/−0
- tests/fixtures/integration/vim-clipper/golden/plaintext.golden +0/−0
- tests/fixtures/integration/vim-clipper/input/autoload/clipper/private.vim +16/−0
- tests/fixtures/integration/vim-clipper/input/plugin/clipper.vim +27/−0
- tests/fixtures/integration/vim-docvim/golden/ast.golden +1081/−0
- tests/fixtures/integration/vim-docvim/golden/markdown.golden +124/−0
- tests/fixtures/integration/vim-docvim/golden/plaintext.golden +143/−0
- tests/fixtures/integration/vim-docvim/input/after/syntax/vim.vim +237/−0
- tests/fixtures/integration/vim-docvim/input/ftplugin/vim.vim +6/−0
- tests/fixtures/markdown/basic-paragraphs.golden +5/−0
- tests/fixtures/markdown/basic-paragraphs.vim +8/−0
- tests/fixtures/markdown/blockquotes.golden +7/−0
- tests/fixtures/markdown/blockquotes.vim +9/−0
- tests/fixtures/markdown/break-tags.golden +13/−0
- tests/fixtures/markdown/break-tags.vim +21/−0
- tests/fixtures/markdown/code.golden +1/−0
- tests/fixtures/markdown/code.vim +2/−0
- tests/fixtures/markdown/fenced.golden +12/−0
- tests/fixtures/markdown/fenced.vim +14/−0
- tests/fixtures/markdown/headings.golden +9/−0
- tests/fixtures/markdown/headings.vim +11/−0
- tests/fixtures/markdown/link-targets.golden +2/−0
- tests/fixtures/markdown/link-targets.vim +5/−0
- tests/fixtures/markdown/links.golden +4/−0
- tests/fixtures/markdown/links.vim +6/−0
- tests/fixtures/markdown/list-items.golden +6/−0
- tests/fixtures/markdown/list-items.vim +8/−0
- tests/fixtures/markdown/ordering-across-docblocks.golden +29/−0
- tests/fixtures/markdown/ordering-across-docblocks.vim +42/−0
- tests/fixtures/markdown/ordering-within-docblocks.golden +29/−0
- tests/fixtures/markdown/ordering-within-docblocks.vim +33/−0
- tests/fixtures/markdown/separator.golden +5/−0
- tests/fixtures/markdown/separator.vim +7/−0
- tests/fixtures/parser/backticks.golden +41/−0
- tests/fixtures/parser/backticks.vim +6/−0
- tests/fixtures/parser/blank-docblock-lines.golden +11/−0
- tests/fixtures/parser/blank-docblock-lines.vim +16/−0
- tests/fixtures/parser/blockquotes.golden +90/−0
- tests/fixtures/parser/blockquotes.vim +20/−0
- tests/fixtures/parser/br-tags.golden +56/−0
- tests/fixtures/parser/br-tags.vim +24/−0
- tests/fixtures/parser/command.golden +34/−0
- tests/fixtures/parser/command.vim +10/−0
- tests/fixtures/parser/commands.golden +44/−0
- tests/fixtures/parser/commands.vim +10/−0
- tests/fixtures/parser/comments.golden +1/−0
- tests/fixtures/parser/comments.vim +3/−0
- tests/fixtures/parser/empty-function.golden +13/−0
- tests/fixtures/parser/empty-function.vim +2/−0
- tests/fixtures/parser/empty.golden +1/−0
- tests/fixtures/parser/empty.vim +0/−0
- tests/fixtures/parser/endfunction.golden +50/−0
- tests/fixtures/parser/endfunction.vim +24/−0
- tests/fixtures/parser/fenced-code-blocks.golden +18/−0
- tests/fixtures/parser/fenced-code-blocks.vim +14/−0
- tests/fixtures/parser/function-autoloaded.golden +13/−0
- tests/fixtures/parser/function-autoloaded.vim +2/−0
- tests/fixtures/parser/function-bang.golden +13/−0
- tests/fixtures/parser/function-bang.vim +2/−0
- tests/fixtures/parser/function-command-variants.golden +83/−0
- tests/fixtures/parser/function-command-variants.vim +33/−0
- tests/fixtures/parser/function-script-local.golden +27/−0
- tests/fixtures/parser/function-script-local.vim +9/−0
- tests/fixtures/parser/function-varargs.golden +29/−0
- tests/fixtures/parser/function-varargs.vim +9/−0
- tests/fixtures/parser/function-with-nested-contents.golden +14/−0
- tests/fixtures/parser/function-with-nested-contents.vim +4/−0
- tests/fixtures/parser/functions-with-attributes.golden +41/−0
- tests/fixtures/parser/functions-with-attributes.vim +16/−0
- tests/fixtures/parser/functions.golden +44/−0
- tests/fixtures/parser/functions.vim +10/−0
- tests/fixtures/parser/headings.golden +11/−0
- tests/fixtures/parser/headings.vim +6/−0
- tests/fixtures/parser/just-whitespace.golden +1/−0
- tests/fixtures/parser/just-whitespace.vim +3/−0
- tests/fixtures/parser/let.golden +13/−0
- tests/fixtures/parser/let.vim +6/−0
- tests/fixtures/parser/lexpr.golden +16/−0
- tests/fixtures/parser/lexpr.vim +8/−0
- tests/fixtures/parser/link-targets.golden +10/−0
- tests/fixtures/parser/link-targets.vim +4/−0
- tests/fixtures/parser/links.golden +43/−0
- tests/fixtures/parser/links.vim +5/−0
- tests/fixtures/parser/list-items.golden +83/−0
- tests/fixtures/parser/list-items.vim +11/−0
- tests/fixtures/parser/lw.golden +18/−0
- tests/fixtures/parser/lw.vim +13/−0
- tests/fixtures/parser/mappings.golden +44/−0
- tests/fixtures/parser/mappings.vim +10/−0
- tests/fixtures/parser/minimal-annotation.golden +1/−0
- tests/fixtures/parser/minimal-annotation.vim +1/−0
- tests/fixtures/parser/options.golden +44/−0
- tests/fixtures/parser/options.vim +10/−0
- tests/fixtures/parser/phrasing-content.golden +81/−0
- tests/fixtures/parser/phrasing-content.vim +15/−0
- tests/fixtures/parser/plugin-annotation.golden +6/−0
- tests/fixtures/parser/plugin-annotation.vim +2/−0
- tests/fixtures/parser/simple-annotations.golden +10/−0
- tests/fixtures/parser/simple-annotations.vim +4/−0
- tests/fixtures/parser/trailing-comment.golden +10/−0
- tests/fixtures/parser/trailing-comment.vim +4/−0
- tests/fixtures/vim/basic-paragraphs.golden +6/−0
- tests/fixtures/vim/blockquotes.golden +7/−0
- tests/fixtures/vim/break-tags.golden +20/−0
- tests/fixtures/vim/code.golden +1/−0
- tests/fixtures/vim/fenced.golden +9/−0
- tests/fixtures/vim/headings.golden +16/−0
- tests/fixtures/vim/link-targets.golden +3/−0
- tests/fixtures/vim/links.golden +5/−0
- tests/fixtures/vim/list-items.golden +6/−0
- tests/fixtures/vim/options.golden +25/−0
- tests/fixtures/vim/options.vim +16/−0
- tests/fixtures/vim/plugin.golden +11/−0
- tests/fixtures/vim/plugin.vim +8/−0
README.md view
@@ -1,5 +1,7 @@ # docvim: a documentation generator for Vim plug-ins +[](https://travis-ci.org/wincent/docvim) [](http://stackage.org/lts/package/docvim) [](http://stackage.org/nightly/package/docvim)+ docvim is a documentation generator for Vim plug-ins, written in Haskell. ## Quickstart@@ -34,6 +36,10 @@ ## Installation ```+# Stack:+stack install docvim++# Cabal: cabal install docvim ```
docvim.cabal view
@@ -10,7 +10,7 @@ -- PVP summary: +-+------- breaking API changes -- | | +----- non-breaking API additions -- | | | +--- code changes with no API change-version: 0.3.1.1+version: 0.3.1.2 -- A short (one-line) description of the package. synopsis: Documentation generator for Vim plug-ins@@ -41,9 +41,160 @@ build-type: Simple --- Extra files to be distributed with the package, such as examples or a--- README. extra-source-files: README.md+ -- Created with:+ -- :read !find tests/fixtures -type f -and -name '*.vim' -or -name '*.golden'+ , tests/fixtures/integration/command-t/golden/ast.golden+ , tests/fixtures/integration/command-t/golden/markdown.golden+ , tests/fixtures/integration/command-t/golden/plaintext.golden+ , tests/fixtures/integration/command-t/input/autoload/commandt/isengard.vim+ , tests/fixtures/integration/command-t/input/autoload/commandt/mirkwood.vim+ , tests/fixtures/integration/command-t/input/autoload/commandt/private.vim+ , tests/fixtures/integration/command-t/input/autoload/commandt.vim+ , tests/fixtures/integration/command-t/input/plugin/command-t.vim+ , tests/fixtures/integration/ferret/golden/ast.golden+ , tests/fixtures/integration/ferret/golden/markdown.golden+ , tests/fixtures/integration/ferret/golden/plaintext.golden+ , tests/fixtures/integration/ferret/input/autoload/ferret/private/async.vim+ , tests/fixtures/integration/ferret/input/autoload/ferret/private/dispatch.vim+ , tests/fixtures/integration/ferret/input/autoload/ferret/private/vanilla.vim+ , tests/fixtures/integration/ferret/input/autoload/ferret/private.vim+ , tests/fixtures/integration/ferret/input/ftplugin/qf.vim+ , tests/fixtures/integration/ferret/input/plugin/ferret.vim+ , tests/fixtures/integration/loupe/golden/ast.golden+ , tests/fixtures/integration/loupe/golden/markdown.golden+ , tests/fixtures/integration/loupe/golden/plaintext.golden+ , tests/fixtures/integration/loupe/input/autoload/loupe/private.vim+ , tests/fixtures/integration/loupe/input/plugin/loupe.vim+ , tests/fixtures/integration/pinnacle/golden/ast.golden+ , tests/fixtures/integration/pinnacle/golden/markdown.golden+ , tests/fixtures/integration/pinnacle/golden/plaintext.golden+ , tests/fixtures/integration/pinnacle/input/autoload/pinnacle.vim+ , tests/fixtures/integration/scalpel/golden/ast.golden+ , tests/fixtures/integration/scalpel/golden/markdown.golden+ , tests/fixtures/integration/scalpel/golden/plaintext.golden+ , tests/fixtures/integration/scalpel/input/autoload/scalpel.vim+ , tests/fixtures/integration/scalpel/input/plugin/scalpel.vim+ , tests/fixtures/integration/terminus/golden/ast.golden+ , tests/fixtures/integration/terminus/golden/markdown.golden+ , tests/fixtures/integration/terminus/golden/plaintext.golden+ , tests/fixtures/integration/terminus/input/autoload/terminus/private.vim+ , tests/fixtures/integration/terminus/input/plugin/terminus.vim+ , tests/fixtures/integration/vim-clipper/golden/ast.golden+ , tests/fixtures/integration/vim-clipper/golden/markdown.golden+ , tests/fixtures/integration/vim-clipper/golden/plaintext.golden+ , tests/fixtures/integration/vim-clipper/input/autoload/clipper/private.vim+ , tests/fixtures/integration/vim-clipper/input/plugin/clipper.vim+ , tests/fixtures/integration/vim-docvim/golden/ast.golden+ , tests/fixtures/integration/vim-docvim/golden/markdown.golden+ , tests/fixtures/integration/vim-docvim/golden/plaintext.golden+ , tests/fixtures/integration/vim-docvim/input/after/syntax/vim.vim+ , tests/fixtures/integration/vim-docvim/input/ftplugin/vim.vim+ , tests/fixtures/markdown/basic-paragraphs.golden+ , tests/fixtures/markdown/basic-paragraphs.vim+ , tests/fixtures/markdown/blockquotes.golden+ , tests/fixtures/markdown/blockquotes.vim+ , tests/fixtures/markdown/break-tags.golden+ , tests/fixtures/markdown/break-tags.vim+ , tests/fixtures/markdown/code.golden+ , tests/fixtures/markdown/code.vim+ , tests/fixtures/markdown/fenced.golden+ , tests/fixtures/markdown/fenced.vim+ , tests/fixtures/markdown/headings.golden+ , tests/fixtures/markdown/headings.vim+ , tests/fixtures/markdown/link-targets.golden+ , tests/fixtures/markdown/link-targets.vim+ , tests/fixtures/markdown/links.golden+ , tests/fixtures/markdown/links.vim+ , tests/fixtures/markdown/list-items.golden+ , tests/fixtures/markdown/list-items.vim+ , tests/fixtures/markdown/ordering-across-docblocks.golden+ , tests/fixtures/markdown/ordering-across-docblocks.vim+ , tests/fixtures/markdown/ordering-within-docblocks.golden+ , tests/fixtures/markdown/ordering-within-docblocks.vim+ , tests/fixtures/markdown/separator.golden+ , tests/fixtures/markdown/separator.vim+ , tests/fixtures/parser/backticks.golden+ , tests/fixtures/parser/backticks.vim+ , tests/fixtures/parser/blank-docblock-lines.golden+ , tests/fixtures/parser/blank-docblock-lines.vim+ , tests/fixtures/parser/blockquotes.golden+ , tests/fixtures/parser/blockquotes.vim+ , tests/fixtures/parser/br-tags.golden+ , tests/fixtures/parser/br-tags.vim+ , tests/fixtures/parser/command.golden+ , tests/fixtures/parser/command.vim+ , tests/fixtures/parser/commands.golden+ , tests/fixtures/parser/commands.vim+ , tests/fixtures/parser/comments.golden+ , tests/fixtures/parser/comments.vim+ , tests/fixtures/parser/empty-function.golden+ , tests/fixtures/parser/empty-function.vim+ , tests/fixtures/parser/empty.golden+ , tests/fixtures/parser/empty.vim+ , tests/fixtures/parser/endfunction.golden+ , tests/fixtures/parser/endfunction.vim+ , tests/fixtures/parser/fenced-code-blocks.golden+ , tests/fixtures/parser/fenced-code-blocks.vim+ , tests/fixtures/parser/function-autoloaded.golden+ , tests/fixtures/parser/function-autoloaded.vim+ , tests/fixtures/parser/function-bang.golden+ , tests/fixtures/parser/function-bang.vim+ , tests/fixtures/parser/function-command-variants.golden+ , tests/fixtures/parser/function-command-variants.vim+ , tests/fixtures/parser/function-script-local.golden+ , tests/fixtures/parser/function-script-local.vim+ , tests/fixtures/parser/function-varargs.golden+ , tests/fixtures/parser/function-varargs.vim+ , tests/fixtures/parser/function-with-nested-contents.golden+ , tests/fixtures/parser/function-with-nested-contents.vim+ , tests/fixtures/parser/functions-with-attributes.golden+ , tests/fixtures/parser/functions-with-attributes.vim+ , tests/fixtures/parser/functions.golden+ , tests/fixtures/parser/functions.vim+ , tests/fixtures/parser/headings.golden+ , tests/fixtures/parser/headings.vim+ , tests/fixtures/parser/just-whitespace.golden+ , tests/fixtures/parser/just-whitespace.vim+ , tests/fixtures/parser/let.golden+ , tests/fixtures/parser/let.vim+ , tests/fixtures/parser/lexpr.golden+ , tests/fixtures/parser/lexpr.vim+ , tests/fixtures/parser/link-targets.golden+ , tests/fixtures/parser/link-targets.vim+ , tests/fixtures/parser/links.golden+ , tests/fixtures/parser/links.vim+ , tests/fixtures/parser/list-items.golden+ , tests/fixtures/parser/list-items.vim+ , tests/fixtures/parser/lw.golden+ , tests/fixtures/parser/lw.vim+ , tests/fixtures/parser/mappings.golden+ , tests/fixtures/parser/mappings.vim+ , tests/fixtures/parser/minimal-annotation.golden+ , tests/fixtures/parser/minimal-annotation.vim+ , tests/fixtures/parser/options.golden+ , tests/fixtures/parser/options.vim+ , tests/fixtures/parser/phrasing-content.golden+ , tests/fixtures/parser/phrasing-content.vim+ , tests/fixtures/parser/plugin-annotation.golden+ , tests/fixtures/parser/plugin-annotation.vim+ , tests/fixtures/parser/simple-annotations.golden+ , tests/fixtures/parser/simple-annotations.vim+ , tests/fixtures/parser/trailing-comment.golden+ , tests/fixtures/parser/trailing-comment.vim+ , tests/fixtures/vim/basic-paragraphs.golden+ , tests/fixtures/vim/blockquotes.golden+ , tests/fixtures/vim/break-tags.golden+ , tests/fixtures/vim/code.golden+ , tests/fixtures/vim/fenced.golden+ , tests/fixtures/vim/headings.golden+ , tests/fixtures/vim/link-targets.golden+ , tests/fixtures/vim/links.golden+ , tests/fixtures/vim/list-items.golden+ , tests/fixtures/vim/options.golden+ , tests/fixtures/vim/options.vim+ , tests/fixtures/vim/plugin.golden+ , tests/fixtures/vim/plugin.vim -- Constraint on the version of Cabal needed to build this package. cabal-version: >=1.10@@ -55,7 +206,7 @@ source-repository this type: git location: https://github.com/wincent/docvim.git- tag: 0.3.1.1+ tag: 0.3.1.2 executable docvim -- .hs or .lhs file containing the Main module.
lib/Text/Docvim/Printer/Vim.hs view
@@ -24,6 +24,7 @@ data Operation = Append String | Delete Int -- unconditional delete count of Char | Slurp String -- delete string if present+-- TODO: make this a Maybe String directly instead of a record data Metadata = Metadata { pluginName :: Maybe String } data Context = Context { lineBreak :: String , partialLine :: String@@ -115,6 +116,8 @@ defaultLineBreak = "\n" nodes :: [Node] -> Env+-- TODO: may want to suppress line breaking on first node (temporarily set very+-- high text width, to deal with issues like #23) nodes ns = concat <$> mapM node ns node :: Node -> Env
+ tests/fixtures/integration/command-t/golden/ast.golden view
@@ -0,0 +1,3 @@+"(eval)" (line 134, column 38):+unexpected "_"+expecting letter or digit, "\n", "," or ")"
+ tests/fixtures/integration/command-t/golden/markdown.golden view
@@ -0,0 +1,3 @@+"(eval)" (line 134, column 38):+unexpected "_"+expecting letter or digit, "\n", "," or ")"
+ tests/fixtures/integration/command-t/golden/plaintext.golden view
@@ -0,0 +1,3 @@+"(eval)" (line 134, column 38):+unexpected "_"+expecting letter or digit, "\n", "," or ")"
+ tests/fixtures/integration/command-t/input/autoload/commandt.vim view
@@ -0,0 +1,188 @@+" Copyright 2010-present Greg Hurrell. All rights reserved.+" Licensed under the terms of the BSD 2-clause license.++if exists('g:command_t_autoloaded') || &cp+ finish+endif+let g:command_t_autoloaded = 1++"+" Functions+"++function! s:RubyWarning() abort+ echohl WarningMsg+ echo 'command-t.vim requires Vim to be compiled with Ruby support'+ echo 'For more information type: :help command-t'+ echohl none+endfunction++function! commandt#BufferFinder() abort+ if has('ruby')+ ruby $command_t.show_buffer_finder+ else+ call s:RubyWarning()+ endif+endfunction++function! commandt#CommandFinder() abort+ if has('ruby')+ ruby $command_t.show_command_finder+ else+ call s:RubyWarning()+ endif+endfunction++function! commandt#FileFinder(arg) abort+ if has('ruby')+ ruby $command_t.show_file_finder+ else+ call s:RubyWarning()+ endif+endfunction++function! commandt#JumpFinder() abort+ if has('ruby')+ ruby $command_t.show_jump_finder+ else+ call s:RubyWarning()+ endif+endfunction++function! commandt#MRUFinder() abort+ if has('ruby')+ ruby $command_t.show_mru_finder+ else+ call s:RubyWarning()+ endif+endfunction++function! commandt#HelpFinder() abort+ if has('ruby')+ ruby $command_t.show_help_finder+ else+ call s:RubyWarning()+ endif+endfunction++function! commandt#HistoryFinder() abort+ if has('ruby')+ ruby $command_t.show_history_finder+ else+ call s:RubyWarning()+ endif+endfunction++function! commandt#LineFinder() abort+ if has('ruby')+ let g:CommandTCurrentBuffer=bufnr('%')+ ruby $command_t.show_line_finder+ else+ call s:RubyWarning()+ endif+endfunction++function! commandt#SearchFinder() abort+ if has('ruby')+ ruby $command_t.show_search_finder+ else+ call s:RubyWarning()+ endif+endfunction++function! commandt#TagFinder() abort+ if has('ruby')+ ruby $command_t.show_tag_finder+ else+ call s:RubyWarning()+ endif+endfunction++function! commandt#Flush() abort+ if has('ruby')+ ruby $command_t.flush+ else+ call s:RubyWarning()+ endif+endfunction++function! commandt#Load() abort+ if !has('ruby')+ call s:RubyWarning()+ endif+endfunction++" For possible use in status lines.+function! commandt#ActiveFinder() abort+ if has('ruby')+ ruby ::VIM::command "return '#{$command_t.active_finder}'"+ else+ return ''+ endif+endfunction++" For possible use in status lines.+function! commandt#Path() abort+ if has('ruby')+ ruby ::VIM::command "return '#{($command_t.path || '').gsub(/'/, "''")}'"+ else+ return ''+ endif+endfunction++" For possible use in status lines.+function! commandt#CheckBuffer(buffer_number) abort+ if has('ruby')+ execute 'ruby $command_t.return_is_own_buffer' a:buffer_number+ else+ return 0+ endif+endfunction++if !has('ruby')+ finish+endif++" note that we only start tracking buffers from first (autoloaded) use of Command-T+augroup CommandTMRUBuffer+ autocmd!+ autocmd BufEnter * ruby CommandT::MRU.touch+ autocmd BufDelete * ruby CommandT::MRU.delete+augroup END++ruby << EOF+ # require Ruby files+ begin+ require 'command-t'++ # Make sure we're running with the same version of Ruby that Command-T was+ # compiled with.+ patchlevel = defined?(RUBY_PATCHLEVEL) ? RUBY_PATCHLEVEL : nil+ if CommandT::Metadata::UNKNOWN == true || (+ CommandT::Metadata::EXPECTED_RUBY_VERSION == RUBY_VERSION &&+ CommandT::Metadata::EXPECTED_RUBY_PATCHLEVEL == patchlevel+ )+ require 'command-t/ext' # eager load, to catch compilation problems early+ $command_t = CommandT::Controller.new+ else+ $command_t = CommandT::Stub.new+ end+ rescue LoadError+ load_path_modified = false+ ::VIM::evaluate('&runtimepath').to_s.split(',').each do |path|+ ext = "#{path}/ruby/command-t/ext"+ if !$LOAD_PATH.include?(ext) && File.exist?(ext)+ $LOAD_PATH << ext+ load_path_modified = true+ end+ lib = "#{path}/ruby/command-t/lib"+ if !$LOAD_PATH.include?(lib) && File.exist?(lib)+ $LOAD_PATH << lib+ load_path_modified = true+ end+ end+ retry if load_path_modified++ $command_t = CommandT::Stub.new+ end+EOF
+ tests/fixtures/integration/command-t/input/autoload/commandt/isengard.vim view
@@ -0,0 +1,25 @@+" Copyright 2010-present Greg Hurrell. All rights reserved.+" Licensed under the terms of the BSD 2-clause license.++let s:script_directory=expand('<sfile>:p:h')++" Set up the new async implementation of the Command-T engine -- successor to+" "mirkwood" -- codenamed "isengard".+function! commandt#isengard#init() abort+ let l:daemon_path=resolve(s:script_directory . '/../../ruby/command-t/bin/commandtd')++ let l:client_log_file=get(g:, 'CommandTClientLog', '')+ let l:server_log_file=get(g:, 'CommandTServerLog', '')+ if !empty(l:client_log_file)+ call ch_logfile(l:client_log_file, 'w')+ endif+ if !empty(l:server_log_file)+ let s:job=job_start([l:daemon_path, '--logfile=' . l:server_log_file, '--vim-pid=' . getpid()])+ else+ let s:job=job_start([l:daemon_path, '--vim-pid=' . getpid()])+ endif+ let s:channel=job_getchannel(s:job)++ call ch_evalraw(s:channel, json_encode({'cd': getcwd()}) . "\n")+ let g:CommandTResult=ch_evalraw(s:channel, json_encode({'match': 'commandt'}) . "\n")+endfunction
+ tests/fixtures/integration/command-t/input/autoload/commandt/mirkwood.vim view
@@ -0,0 +1,44 @@+" Copyright 2010-present Greg Hurrell. All rights reserved.+" Licensed under the terms of the BSD 2-clause license.++" Set up the original implementation Command-T engine, codenamed "mirkwood".+function! commandt#mirkwood#init() abort+ command! CommandTBuffer call commandt#BufferFinder()+ command! CommandTCommand call commandt#CommandFinder()+ command! CommandTHelp call commandt#HelpFinder()+ command! CommandTHistory call commandt#HistoryFinder()+ command! CommandTJump call commandt#JumpFinder()+ command! CommandTLine call commandt#LineFinder()+ command! CommandTMRU call commandt#MRUFinder()+ command! CommandTSearch call commandt#SearchFinder()+ command! CommandTTag call commandt#TagFinder()+ command! -nargs=? -complete=dir CommandT call commandt#FileFinder(<q-args>)+ command! CommandTFlush call commandt#Flush()+ command! CommandTLoad call commandt#Load()++ if !hasmapto('<Plug>(CommandT)') && maparg('<Leader>t', 'n') ==# ''+ nmap <unique> <Leader>t <Plug>(CommandT)+ endif+ nnoremap <silent> <Plug>(CommandT) :CommandT<CR>++ if !hasmapto('<Plug>(CommandTBuffer)') && maparg('<Leader>b', 'n') ==# ''+ nmap <unique> <Leader>b <Plug>(CommandTBuffer)+ endif+ nnoremap <silent> <Plug>(CommandTBuffer) :CommandTBuffer<CR>++ nnoremap <silent> <Plug>(CommandTHelp) :CommandTHelp<CR>+ nnoremap <silent> <Plug>(CommandTHistory) :CommandTHistory<CR>++ if has('jumplist')+ if !hasmapto('<Plug>(CommandTJump)') && maparg('<Leader>j', 'n') ==# ''+ nmap <unique> <Leader>j <Plug>(CommandTJump)+ endif+ nnoremap <silent> <Plug>(CommandTJump) :CommandTJump<CR>+ endif++ nnoremap <silent> <Plug>(CommandTCommand) :CommandTCommand<CR>+ nnoremap <silent> <Plug>(CommandTLine) :CommandTLine<CR>+ nnoremap <silent> <Plug>(CommandTMRU) :CommandTMRU<CR>+ nnoremap <silent> <Plug>(CommandTSearch) :CommandTSearch<CR>+ nnoremap <silent> <Plug>(CommandTTag) :CommandTTag<CR>+endfunction
+ tests/fixtures/integration/command-t/input/autoload/commandt/private.vim view
@@ -0,0 +1,90 @@+" Copyright 2010-present Greg Hurrell. All rights reserved.+" Licensed under the terms of the BSD 2-clause license.++function! commandt#private#ListMatches() abort+ ruby $command_t.list_matches+endfunction++function! commandt#private#HandleKey(arg) abort+ ruby $command_t.handle_key+endfunction++function! commandt#private#Backspace() abort+ ruby $command_t.backspace+endfunction++function! commandt#private#Delete() abort+ ruby $command_t.delete+endfunction++function! commandt#private#AcceptSelection() abort+ ruby $command_t.accept_selection+endfunction++function! commandt#private#AcceptSelectionTab() abort+ ruby $command_t.accept_selection :command => $command_t.tab_command+endfunction++function! commandt#private#AcceptSelectionSplit() abort+ ruby $command_t.accept_selection :command => $command_t.split_command+endfunction++function! commandt#private#AcceptSelectionVSplit() abort+ ruby $command_t.accept_selection :command => $command_t.vsplit_command+endfunction++function! commandt#private#Quickfix() abort+ ruby $command_t.quickfix+endfunction++function! commandt#private#Refresh() abort+ ruby $command_t.refresh+endfunction++function! commandt#private#ToggleFocus() abort+ ruby $command_t.toggle_focus+endfunction++function! commandt#private#Cancel() abort+ ruby $command_t.cancel+endfunction++function! commandt#private#SelectNext() abort+ ruby $command_t.select_next+endfunction++function! commandt#private#SelectPrev() abort+ ruby $command_t.select_prev+endfunction++function! commandt#private#Clear() abort+ ruby $command_t.clear+endfunction++function! commandt#private#ClearPrevWord() abort+ ruby $command_t.clear_prev_word+endfunction++function! commandt#private#CursorLeft() abort+ ruby $command_t.cursor_left+endfunction++function! commandt#private#CursorRight() abort+ ruby $command_t.cursor_right+endfunction++function! commandt#private#CursorEnd() abort+ ruby $command_t.cursor_end+endfunction++function! commandt#private#CursorStart() abort+ ruby $command_t.cursor_start+endfunction++function! commandt#private#RunAutocmd(cmd) abort+ if v:version > 703 || v:version == 703 && has('patch438')+ execute 'silent doautocmd <nomodeline> User ' . a:cmd+ else+ execute 'silent doautocmd User ' . a:cmd+ endif+endfunction
+ tests/fixtures/integration/command-t/input/plugin/command-t.vim view
@@ -0,0 +1,20 @@+" Copyright 2010-present Greg Hurrell. All rights reserved.+" Licensed under the terms of the BSD 2-clause license.++if exists('g:command_t_loaded') || &compatible+ finish+endif+let g:command_t_loaded = 1++" HACK: use both old and new during early development+if has('patch-7-4-1829') && get(g:, 'CommandTEngine', 'mirkwood') ==? 'isengard'+ call commandt#isengard#init()+endif+call commandt#mirkwood#init()+finish++if has('patch-7-4-1829') && get(g:, 'CommandTEngine', 'isengard') ==? 'isengard'+ call commandt#isengard#init()+else+ call commandt#mirkwood#init()+endif
+ tests/fixtures/integration/ferret/golden/ast.golden view
@@ -0,0 +1,5649 @@+Project+ [ DocBlock+ [ PluginAnnotation "ferret" "Ferret plug-in for Vim"+ , TOC+ [ "Intro"+ , "Installation"+ , "Commands"+ , "Mappings"+ , "Options"+ , "Custom autocommands"+ , "Overrides"+ , "Troubleshooting"+ , "FAQ"+ , "Related"+ , "Website"+ , "License"+ , "Development"+ , "Authors"+ , "History"+ ]+ ]+ , HeadingAnnotation "Intro"+ , Blockquote+ [ Paragraph+ [ Plaintext "\"ferret"+ , Whitespace+ , Plaintext "(verb)"+ , BreakTag+ , Plaintext "(ferret"+ , Whitespace+ , Plaintext "something"+ , Whitespace+ , Plaintext "out)"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "tenaciously"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "find"+ , Whitespace+ , Plaintext "something:"+ , Whitespace+ , Plaintext "she"+ , Whitespace+ , Plaintext "had"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "ability"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "ferret"+ , Whitespace+ , Plaintext "out"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "facts.\""+ ]+ ]+ , LinkTargets [ "ferret-features" ]+ , Paragraph+ [ Plaintext "Ferret"+ , Whitespace+ , Plaintext "improves"+ , Whitespace+ , Plaintext "Vim's"+ , Whitespace+ , Plaintext "multi-file"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "four"+ , Whitespace+ , Plaintext "ways:"+ ]+ , SubheadingAnnotation "1. Powerful multi-file search"+ , Paragraph+ [ Plaintext "Ferret"+ , Whitespace+ , Plaintext "provides"+ , Whitespace+ , Plaintext "an"+ , Whitespace+ , Link ":Ack"+ , Whitespace+ , Plaintext "command"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "searching"+ , Whitespace+ , Plaintext "across"+ , Whitespace+ , Plaintext "multiple"+ , Whitespace+ , Plaintext "files"+ , Whitespace+ , Plaintext "using"+ , Whitespace+ , Plaintext "The"+ , Whitespace+ , Plaintext "Silver"+ , Whitespace+ , Plaintext "Searcher"+ , Whitespace+ , Plaintext "(https://github.com/ggreer/the_silver_searcher),"+ , Whitespace+ , Plaintext "Ack"+ , Whitespace+ , Plaintext "(http://beyondgrep.com/),"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Plaintext "Grep"+ , Whitespace+ , Plaintext "(http://www.gnu.org/software/grep/)."+ , Whitespace+ , Plaintext "Support"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "passing"+ , Whitespace+ , Plaintext "options"+ , Whitespace+ , Plaintext "through"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "underlying"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "command"+ , Whitespace+ , Plaintext "exists,"+ , Whitespace+ , Plaintext "along"+ , Whitespace+ , Plaintext "with"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "ability"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "use"+ , Whitespace+ , Plaintext "full"+ , Whitespace+ , Plaintext "regular"+ , Whitespace+ , Plaintext "expression"+ , Whitespace+ , Plaintext "syntax"+ , Whitespace+ , Plaintext "without"+ , Whitespace+ , Plaintext "doing"+ , Whitespace+ , Plaintext "special"+ , Whitespace+ , Plaintext "escaping."+ ]+ , Paragraph+ [ Plaintext "Shortcut"+ , Whitespace+ , Plaintext "mappings"+ , Whitespace+ , Plaintext "are"+ , Whitespace+ , Plaintext "provided"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "start"+ , Whitespace+ , Plaintext "an"+ , Whitespace+ , Link ":Ack"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "(<leader>a)"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "word"+ , Whitespace+ , Plaintext "currently"+ , Whitespace+ , Plaintext "under"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "cursor"+ , Whitespace+ , Plaintext "(<leader>s)."+ ]+ , Paragraph+ [ Plaintext "Results"+ , Whitespace+ , Plaintext "are"+ , Whitespace+ , Plaintext "normally"+ , Whitespace+ , Plaintext "displayed"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link "quickfix"+ , Whitespace+ , Plaintext "window,"+ , Whitespace+ , Plaintext "but"+ , Whitespace+ , Plaintext "Ferret"+ , Whitespace+ , Plaintext "also"+ , Whitespace+ , Plaintext "provides"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Link ":Lack"+ , Whitespace+ , Plaintext "command"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "behaves"+ , Whitespace+ , Plaintext "like"+ , Whitespace+ , Link ":Ack"+ , Whitespace+ , Plaintext "but"+ , Whitespace+ , Plaintext "uses"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link "location-list"+ , Whitespace+ , Plaintext "instead,"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "<leader>l"+ , Whitespace+ , Plaintext "mapping"+ , Whitespace+ , Plaintext "as"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "shortcut"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Link ":Lack"+ , Plaintext "."+ ]+ , Paragraph+ [ Plaintext "Finally,"+ , Whitespace+ , Plaintext "Ferret"+ , Whitespace+ , Plaintext "offers"+ , Whitespace+ , Plaintext "integration"+ , Whitespace+ , Plaintext "with"+ , Whitespace+ , Plaintext "dispatch.vim"+ , Whitespace+ , Plaintext "(https://github.com/tpope/vim-dispatch),"+ , Whitespace+ , Plaintext "which"+ , Whitespace+ , Plaintext "enables"+ , Whitespace+ , Plaintext "asynchronous"+ , Whitespace+ , Plaintext "searching"+ , Whitespace+ , Plaintext "despite"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "fact"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "Vim"+ , Whitespace+ , Plaintext "itself"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "single-threaded."+ ]+ , SubheadingAnnotation "2. Streamlined multi-file replace"+ , Paragraph+ [ Plaintext "The"+ , Whitespace+ , Plaintext "companion"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Link ":Ack"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Link ":Acks"+ , Whitespace+ , Plaintext "(mnemonic:"+ , Whitespace+ , Plaintext "\"Ack"+ , Whitespace+ , Plaintext "substitute\","+ , Whitespace+ , Plaintext "accessible"+ , Whitespace+ , Plaintext "via"+ , Whitespace+ , Plaintext "shortcut"+ , Whitespace+ , Plaintext "<leader>r),"+ , Whitespace+ , Plaintext "which"+ , Whitespace+ , Plaintext "allows"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "run"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "multi-file"+ , Whitespace+ , Plaintext "replace"+ , Whitespace+ , Plaintext "across"+ , Whitespace+ , Plaintext "all"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "files"+ , Whitespace+ , Plaintext "placed"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link "quickfix"+ , Whitespace+ , Plaintext "window"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "previous"+ , Whitespace+ , Plaintext "invocation"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Link ":Ack"+ , Plaintext "."+ ]+ , SubheadingAnnotation "3. Quickfix listing enhancements"+ , Paragraph+ [ Plaintext "The"+ , Whitespace+ , Link "quickfix"+ , Whitespace+ , Plaintext "listing"+ , Whitespace+ , Plaintext "itself"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "enhanced"+ , Whitespace+ , Plaintext "with"+ , Whitespace+ , Plaintext "settings"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "improve"+ , Whitespace+ , Plaintext "its"+ , Whitespace+ , Plaintext "usability,"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "natural"+ , Whitespace+ , Plaintext "mappings"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "allow"+ , Whitespace+ , Plaintext "quick"+ , Whitespace+ , Plaintext "removal"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "items"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "list"+ , Whitespace+ , Plaintext "(for"+ , Whitespace+ , Plaintext "example,"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "reduce"+ , Whitespace+ , Plaintext "clutter"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "listing"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "removing"+ , Whitespace+ , Plaintext "lines"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "don't"+ , Whitespace+ , Plaintext "intend"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "make"+ , Whitespace+ , Plaintext "changes"+ , Whitespace+ , Plaintext "to)."+ ]+ , Paragraph+ [ Plaintext "Additionally,"+ , Whitespace+ , Plaintext "Vim's"+ , Whitespace+ , Link ":cn"+ , Plaintext ","+ , Whitespace+ , Link ":cp"+ , Plaintext ","+ , Whitespace+ , Link ":cnf"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Link ":cpf"+ , Whitespace+ , Plaintext "commands"+ , Whitespace+ , Plaintext "are"+ , Whitespace+ , Plaintext "tweaked"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "make"+ , Whitespace+ , Plaintext "it"+ , Whitespace+ , Plaintext "easier"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "immediately"+ , Whitespace+ , Plaintext "identify"+ , Whitespace+ , Plaintext "matches"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "centering"+ , Whitespace+ , Plaintext "them"+ , Whitespace+ , Plaintext "within"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "viewport."+ ]+ , SubheadingAnnotation+ "4. Easy operations on files in the quickfix listing"+ , Paragraph+ [ Plaintext "Finally,"+ , Whitespace+ , Plaintext "Ferret"+ , Whitespace+ , Plaintext "provides"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Link ":Qargs"+ , Whitespace+ , Plaintext "command"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "puts"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "files"+ , Whitespace+ , Plaintext "currently"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link "quickfix"+ , Whitespace+ , Plaintext "listing"+ , Whitespace+ , Plaintext "into"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link ":args"+ , Whitespace+ , Plaintext "list,"+ , Whitespace+ , Plaintext "where"+ , Whitespace+ , Plaintext "they"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "be"+ , Whitespace+ , Plaintext "operated"+ , Whitespace+ , Plaintext "on"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "bulk"+ , Whitespace+ , Plaintext "via"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link ":argdo"+ , Whitespace+ , Plaintext "command."+ , Whitespace+ , Plaintext "This"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "what's"+ , Whitespace+ , Plaintext "used"+ , Whitespace+ , Plaintext "under"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "covers"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Link ":Acks"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "do"+ , Whitespace+ , Plaintext "its"+ , Whitespace+ , Plaintext "work."+ ]+ , HeadingAnnotation "Installation"+ , Paragraph+ [ Plaintext "To"+ , Whitespace+ , Plaintext "install"+ , Whitespace+ , Plaintext "Ferret,"+ , Whitespace+ , Plaintext "use"+ , Whitespace+ , Plaintext "your"+ , Whitespace+ , Plaintext "plug-in"+ , Whitespace+ , Plaintext "management"+ , Whitespace+ , Plaintext "system"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "choice."+ ]+ , Paragraph+ [ Plaintext "If"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "don't"+ , Whitespace+ , Plaintext "have"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "\"plug-in"+ , Whitespace+ , Plaintext "management"+ , Whitespace+ , Plaintext "system"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "choice\","+ , Whitespace+ , Plaintext "I"+ , Whitespace+ , Plaintext "recommend"+ , Whitespace+ , Plaintext "Pathogen"+ , Whitespace+ , Plaintext "(https://github.com/tpope/vim-pathogen)"+ , Whitespace+ , Plaintext "due"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "its"+ , Whitespace+ , Plaintext "simplicity"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "robustness."+ , Whitespace+ , Plaintext "Assuming"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "have"+ , Whitespace+ , Plaintext "Pathogen"+ , Whitespace+ , Plaintext "installed"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "configured,"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "want"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "install"+ , Whitespace+ , Plaintext "Ferret"+ , Whitespace+ , Plaintext "into"+ , Whitespace+ , Code "~/.vim/bundle"+ , Plaintext ","+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "do"+ , Whitespace+ , Plaintext "so"+ , Whitespace+ , Plaintext "with:"+ ]+ , Fenced+ [ "git clone https://github.com/wincent/ferret.git ~/.vim/bundle/ferret"+ ]+ , Paragraph+ [ Plaintext "Alternatively,"+ , Whitespace+ , Plaintext "if"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "use"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "Git"+ , Whitespace+ , Plaintext "submodule"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "each"+ , Whitespace+ , Plaintext "Vim"+ , Whitespace+ , Plaintext "plug-in,"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "could"+ , Whitespace+ , Plaintext "do"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "following"+ , Whitespace+ , Plaintext "after"+ , Whitespace+ , Code "cd"+ , Plaintext "-ing"+ , Whitespace+ , Plaintext "into"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "top-level"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "your"+ , Whitespace+ , Plaintext "Git"+ , Whitespace+ , Plaintext "superproject:"+ ]+ , Fenced+ [ "git submodule add https://github.com/wincent/ferret.git ~/vim/bundle/ferret"+ , "git submodule init"+ ]+ , Paragraph+ [ Plaintext "To"+ , Whitespace+ , Plaintext "generate"+ , Whitespace+ , Plaintext "help"+ , Whitespace+ , Plaintext "tags"+ , Whitespace+ , Plaintext "under"+ , Whitespace+ , Plaintext "Pathogen,"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "do"+ , Whitespace+ , Plaintext "so"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "inside"+ , Whitespace+ , Plaintext "Vim"+ , Whitespace+ , Plaintext "with:"+ ]+ , Fenced [ ":call pathogen#helptags()" ]+ , Project+ [ Unit+ [ LetStatement { letLexpr = "s:jobs" , letValue = "{}" }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "s:channel_id"+ , functionArguments = ArgumentList [ Argument "channel" ]+ , functionAttributes = []+ , functionBody =+ [ GenericStatement "return matchstr(a:channel, '\\d\\+')" ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "s:info_from_channel"+ , functionArguments = ArgumentList [ Argument "channel" ]+ , functionAttributes = []+ , functionBody =+ [ LetStatement+ { letLexpr = "l:channel_id"+ , letValue = "s:channel_id(a:channel)"+ }+ , GenericStatement "if has_key(s:jobs, l:channel_id)"+ , GenericStatement "return s:jobs[l:channel_id]"+ , GenericStatement "endif"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#async#search"+ , functionArguments =+ ArgumentList [ Argument "command" , Argument "ack" ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement "call ferret#private#async#cancel()"+ , GenericStatement+ "call ferret#private#autocmd('FerretAsyncStart')"+ , LetStatement+ { letLexpr = "l:command_and_args "+ , letValue = "extend(split(&grepprg), a:command)"+ }+ , LetStatement+ { letLexpr = "l:job"+ , letValue = "job_start(l:command_and_args, {"+ }+ , GenericStatement+ "\\ 'err_cb': 'ferret#private#async#err_cb', 'out_cb': 'ferret#private#async#out_cb', 'close_cb': 'ferret#private#async#close_cb', 'err_mode': 'raw', 'out_mode': 'raw' })"+ , LetStatement+ { letLexpr = "l:channel" , letValue = "job_getchannel(l:job)" }+ , LetStatement+ { letLexpr = "l:channel_id"+ , letValue = "s:channel_id(l:channel)"+ }+ , LetStatement+ { letLexpr = "s:jobs[l:channel_id]" , letValue = "{" }+ , GenericStatement+ "\\ 'channel_id': l:channel_id, 'job': l:job, 'errors': [], 'output': [], 'pending_error': '', 'pending_output': '', 'pending_error_length': 0, 'pending_output_length': 0, 'ack': a:ack, 'window': win_getid() }"+ ]+ }+ , LetStatement+ { letLexpr = "s:max_line_length" , letValue = "32768" }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#async#err_cb"+ , functionArguments =+ ArgumentList [ Argument "channel" , Argument "msg" ]+ , functionAttributes = []+ , functionBody =+ [ LetStatement+ { letLexpr = "l:info"+ , letValue = "s:info_from_channel(a:channel)"+ }+ , GenericStatement "if type(l:info) == 4"+ , LetStatement { letLexpr = "l:start" , letValue = "0" }+ , GenericStatement "while 1"+ , LetStatement+ { letLexpr = "l:idx" , letValue = "match(a:msg, '\\n', l:start)" }+ , GenericStatement "if l:idx==-1"+ , GenericStatement+ "if l:info.pending_error_length < s:max_line_length"+ , LetStatement+ { letLexpr = "l:rest" , letValue = "strpart(a:msg, l:start)" }+ , LetStatement+ { letLexpr = "l:length" , letValue = "strlen(l:rest)" }+ , LetStatement+ { letLexpr = "l:info.pending_error." , letValue = "l:rest" }+ , LetStatement+ { letLexpr = "l:info.pending_error_length+"+ , letValue = "l:length"+ }+ , GenericStatement "endif"+ , GenericStatement "break"+ , GenericStatement "else"+ , GenericStatement+ "if l:info.pending_error_length < s:max_line_length"+ , LetStatement+ { letLexpr = "l:info.pending_error."+ , letValue = "strpart(a:msg, l:start, l:idx - l:start)"+ }+ , GenericStatement "endif"+ , GenericStatement "call add(l:info.errors, l:info.pending_error)"+ , LetStatement+ { letLexpr = "l:info.pending_error" , letValue = "''" }+ , LetStatement+ { letLexpr = "l:info.pending_error_length" , letValue = "0" }+ , GenericStatement "endif"+ , LetStatement { letLexpr = "l:start" , letValue = "l:idx + 1" }+ , GenericStatement "endwhile"+ , GenericStatement "endif"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#async#out_cb"+ , functionArguments =+ ArgumentList [ Argument "channel" , Argument "msg" ]+ , functionAttributes = []+ , functionBody =+ [ LetStatement+ { letLexpr = "l:info"+ , letValue = "s:info_from_channel(a:channel)"+ }+ , GenericStatement "if type(l:info) == 4"+ , LetStatement { letLexpr = "l:start" , letValue = "0" }+ , GenericStatement "while 1"+ , LetStatement+ { letLexpr = "l:idx" , letValue = "match(a:msg, '\\n', l:start)" }+ , GenericStatement "if l:idx==-1"+ , GenericStatement+ "if l:info.pending_output_length < s:max_line_length"+ , LetStatement+ { letLexpr = "l:rest" , letValue = "strpart(a:msg, l:start)" }+ , LetStatement+ { letLexpr = "l:length" , letValue = "strlen(l:rest)" }+ , LetStatement+ { letLexpr = "l:info.pending_output." , letValue = "l:rest" }+ , LetStatement+ { letLexpr = "l:info.pending_output_length+"+ , letValue = "l:length"+ }+ , GenericStatement "endif"+ , GenericStatement "break"+ , GenericStatement "else"+ , GenericStatement+ "if l:info.pending_output_length < s:max_line_length"+ , LetStatement+ { letLexpr = "l:info.pending_output."+ , letValue = "strpart(a:msg, l:start, l:idx - l:start)"+ }+ , GenericStatement "endif"+ , GenericStatement "call add(l:info.output, l:info.pending_output)"+ , LetStatement+ { letLexpr = "l:info.pending_output" , letValue = "''" }+ , LetStatement+ { letLexpr = "l:info.pending_output_length" , letValue = "0" }+ , GenericStatement "endif"+ , LetStatement { letLexpr = "l:start" , letValue = "l:idx + 1" }+ , GenericStatement "endwhile"+ , GenericStatement "endif"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#async#close_cb"+ , functionArguments = ArgumentList [ Argument "channel" ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ LetStatement+ { letLexpr = "l:info"+ , letValue = "s:info_from_channel(a:channel)"+ }+ , GenericStatement "if type(l:info) == 4"+ , GenericStatement "call remove(s:jobs, l:info.channel_id)"+ , GenericStatement+ "call ferret#private#autocmd('FerretAsyncFinish')"+ , GenericStatement "if !l:info.ack"+ , GenericStatement "call win_gotoid(l:info.window)"+ , GenericStatement "endif"+ , GenericStatement+ "call s:finalize_search(l:info.output, l:info.ack)"+ , GenericStatement "for l:error in l:info.errors"+ , GenericStatement "unsilent echomsg l:error"+ , GenericStatement "endfor"+ , GenericStatement "endif"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#async#pull"+ , functionArguments = ArgumentList []+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement "for l:channel_id in keys(s:jobs)"+ , LetStatement+ { letLexpr = "l:info" , letValue = "s:jobs[l:channel_id]" }+ , GenericStatement+ "call s:finalize_search(l:info.output, l:info.ack)"+ , GenericStatement "endfor"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#async#cancel"+ , functionArguments = ArgumentList []+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ LetStatement { letLexpr = "l:canceled" , letValue = "0" }+ , GenericStatement "for l:channel_id in keys(s:jobs)"+ , LetStatement+ { letLexpr = "l:info" , letValue = "s:jobs[l:channel_id]" }+ , GenericStatement "call job_stop(l:info.job)"+ , GenericStatement "call remove(s:jobs, l:channel_id)"+ , LetStatement { letLexpr = "l:canceled" , letValue = "1" }+ , GenericStatement "endfor"+ , GenericStatement "if l:canceled"+ , GenericStatement+ "call ferret#private#autocmd('FerretAsyncFinish')"+ , GenericStatement "endif"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#async#debug"+ , functionArguments = ArgumentList []+ , functionAttributes = [ "abort" ]+ , functionBody = [ GenericStatement "return s:jobs" ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "s:finalize_search"+ , functionArguments =+ ArgumentList [ Argument "output" , Argument "ack" ]+ , functionAttributes = []+ , functionBody =+ [ GenericStatement "if a:ack"+ , GenericStatement "cexpr a:output"+ , GenericStatement+ "execute get(g:, 'FerretQFHandler', 'botright cwindow')"+ , GenericStatement "call ferret#private#post('qf')"+ , GenericStatement "else"+ , LexprStatement { lexprBang = False , lexprExpr = "a:output" }+ , GenericStatement "execute get(g:, 'FerretLLHandler', 'lwindow')"+ , GenericStatement "call ferret#private#post('location')"+ , GenericStatement "endif"+ ]+ }+ ]+ , Unit+ [ FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#dispatch#search"+ , functionArguments = ArgumentList [ Argument "command" ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement "if has('autocmd')"+ , GenericStatement "augroup FerretPostQF"+ , GenericStatement "autocmd!"+ , GenericStatement+ "autocmd QuickfixCmdPost cgetfile call ferret#private#post('qf')"+ , GenericStatement "augroup END"+ , GenericStatement "endif"+ , LetStatement+ { letLexpr = "l:original_makeprg" , letValue = "&l:makeprg" }+ , LetStatement+ { letLexpr = "l:original_errorformat"+ , letValue = "&l:errorformat"+ }+ , GenericStatement "try"+ , LetStatement+ { letLexpr = "&l:makeprg"+ , letValue = "&grepprg . ' ' . a:command"+ }+ , LetStatement+ { letLexpr = "&l:errorformat" , letValue = "&grepformat" }+ , GenericStatement "echomsg &l:makeprg"+ , GenericStatement "Make"+ , GenericStatement "catch"+ , GenericStatement "call ferret#private#clearautocmd()"+ , GenericStatement "finally"+ , LetStatement+ { letLexpr = "&l:makeprg" , letValue = "l:original_makeprg" }+ , LetStatement+ { letLexpr = "&l:errorformat"+ , letValue = "l:original_errorformat"+ }+ , GenericStatement "endtry"+ ]+ }+ ]+ , Unit+ [ FunctionDeclaration+ { functionBang = True+ , functionName = "s:finalize_search"+ , functionArguments =+ ArgumentList [ Argument "output" , Argument "ack" ]+ , functionAttributes = []+ , functionBody =+ [ GenericStatement "if a:ack"+ , GenericStatement "cexpr a:output"+ , GenericStatement+ "execute get(g:, 'FerretQFHandler', 'botright cwindow')"+ , GenericStatement "call ferret#private#post('qf')"+ , GenericStatement "else"+ , LexprStatement { lexprBang = False , lexprExpr = "a:output" }+ , GenericStatement "execute get(g:, 'FerretLLHandler', 'lwindow')"+ , GenericStatement "call ferret#private#post('location')"+ , GenericStatement "endif"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#vanilla#search"+ , functionArguments =+ ArgumentList [ Argument "command" , Argument "ack" ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ LetStatement+ { letLexpr = "l:output"+ , letValue = "system(&grepprg . ' ' . a:command)"+ }+ , GenericStatement "call s:finalize_search(l:output, a:ack)"+ ]+ }+ ]+ , Unit+ [ FunctionDeclaration+ { functionBang = True+ , functionName = "s:delete"+ , functionArguments =+ ArgumentList [ Argument "first" , Argument "last" ]+ , functionAttributes = []+ , functionBody =+ [ LetStatement { letLexpr = "l:list" , letValue = "getqflist()" }+ , LetStatement { letLexpr = "l:line" , letValue = "a:first" }+ , GenericStatement "while l:line >= a:first && l:line <= a:last"+ , LetStatement { letLexpr = "l:list[l:line - 1]" , letValue = "0" }+ , LetStatement { letLexpr = "l:line" , letValue = "l:line + 1" }+ , GenericStatement "endwhile"+ , GenericStatement "call setqflist(l:list, 'r')"+ , GenericStatement "execute 'cc ' . a:first"+ , GenericStatement "execute \"normal \\<C-W>\\<C-P>\""+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#dispatch"+ , functionArguments = ArgumentList []+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ Empty+ , LetStatement+ { letLexpr = "l:dispatch"+ , letValue = "get(g:, 'FerretDispatch', 1)"+ }+ , GenericStatement "return l:dispatch && exists(':Make') == 2"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#async"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody =+ [ LetStatement+ { letLexpr = "l:async" , letValue = "get(g:, 'FerretJob', 1)" }+ , GenericStatement "return l:async && has('patch-7-4-1829')"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#error"+ , functionArguments = ArgumentList [ Argument "message" ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement "call inputsave()"+ , GenericStatement "echohl ErrorMsg"+ , GenericStatement+ "unsilent call input(a:message . ': press ENTER to continue')"+ , GenericStatement "echohl NONE"+ , GenericStatement "call inputrestore()"+ , GenericStatement "unsilent echo"+ , GenericStatement "redraw!"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "s:parse"+ , functionArguments = ArgumentList [ Argument "args" ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement "if exists('g:ferret_lastsearch')"+ , UnletStatement+ { unletBang = False , unletBody = "g:ferret_lastsearch" }+ , GenericStatement "endif"+ , LetStatement { letLexpr = "l:expanded_args" , letValue = "[]" }+ , GenericStatement "for l:arg in a:args"+ , GenericStatement "if ferret#private#option(l:arg)"+ , GenericStatement "call add(l:expanded_args, l:arg)"+ , GenericStatement "elseif exists('g:ferret_lastsearch')"+ , LetStatement+ { letLexpr = "l:file_args"+ , letValue =+ "glob(l:arg, 1, 1) \" Ignore 'wildignore', return a list."+ }+ , GenericStatement "if len(l:file_args)"+ , GenericStatement "call extend(l:expanded_args, l:file_args)"+ , GenericStatement "else"+ , GenericStatement "call add(l:expanded_args, l:arg)"+ , GenericStatement "endif"+ , GenericStatement "else"+ , LetStatement+ { letLexpr = "g:ferret_lastsearch" , letValue = "l:arg" }+ , GenericStatement "call add(l:expanded_args, l:arg)"+ , GenericStatement "endif"+ , GenericStatement "endfor"+ , GenericStatement "if ferret#private#async()"+ , GenericStatement "return l:expanded_args"+ , GenericStatement "endif"+ , LetStatement+ { letLexpr = "l:each_word_shell_escaped"+ , letValue = "map(l:expanded_args, 'shellescape(v:val)')"+ }+ , LetStatement+ { letLexpr = "l:joined"+ , letValue = "join(l:each_word_shell_escaped)"+ }+ , GenericStatement "return escape(l:joined, '<>#')"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#clearautocmd"+ , functionArguments = ArgumentList []+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement "if has('autocmd')"+ , GenericStatement "augroup FerretPostQF"+ , GenericStatement "autocmd!"+ , GenericStatement "augroup END"+ , GenericStatement "endif"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#post"+ , functionArguments = ArgumentList [ Argument "type" ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement "call ferret#private#clearautocmd()"+ , LetStatement+ { letLexpr = "l:lastsearch "+ , letValue = "get(g:, 'ferret_lastsearch', '')"+ }+ , LetStatement+ { letLexpr = "l:qflist "+ , letValue = "a:type == 'qf' ? getqflist() : getloclist(0)"+ }+ , LetStatement+ { letLexpr = "l:tip "+ , letValue = "' [see `:help ferret-quotes`]'"+ }+ , GenericStatement "if len(l:qflist) == 0"+ , LetStatement+ { letLexpr = "l:base "+ , letValue =+ "'No results for search pattern `' . l:lastsearch . '`'"+ }+ , GenericStatement+ "if l:lastsearch =~ '\\v^([' . \"'\" . '\"])[^ \\1]+\\1$'"+ , GenericStatement "call ferret#private#error(l:base . l:tip)"+ , GenericStatement "else"+ , GenericStatement "call ferret#private#error(l:base)"+ , GenericStatement "endif"+ , GenericStatement "else"+ , LetStatement+ { letLexpr = "l:invalid "+ , letValue = "filter(copy(l:qflist), 'v:val.valid == 0')"+ }+ , GenericStatement "if len(l:invalid) == len(l:qflist)"+ , GenericStatement "redraw!"+ , GenericStatement "echohl ErrorMsg"+ , GenericStatement "for l:item in l:invalid"+ , GenericStatement "unsilent echomsg l:item.text"+ , GenericStatement "endfor"+ , GenericStatement "echohl NONE"+ , LetStatement+ { letLexpr = "l:base "+ , letValue = "'Search for `' . l:lastsearch . '` failed'"+ }+ , LetStatement+ { letLexpr = "l:suffix "+ , letValue = "a:type == 'qf' && ferret#private#dispatch() ?"+ }+ , GenericStatement "\\ ' (run `:messages` to see details)' : ''"+ , GenericStatement+ "if l:lastsearch =~ '\\v^[' . \"'\" . '\"].+[^' . \"'\" . '\"]$'"+ , GenericStatement+ "call ferret#private#error(l:base . l:tip . l:suffix)"+ , GenericStatement "else"+ , GenericStatement "call ferret#private#error(l:base . l:suffix)"+ , GenericStatement "endif"+ , GenericStatement "endif"+ , GenericStatement "endif"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#ack"+ , functionArguments = ArgumentList [ Argument "..." ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ LetStatement+ { letLexpr = "l:command" , letValue = "s:parse(a:000)" }+ , GenericStatement "call ferret#private#hlsearch()"+ , GenericStatement "if empty(&grepprg)"+ , GenericStatement "return"+ , GenericStatement "endif"+ , GenericStatement "if ferret#private#async()"+ , GenericStatement "call ferret#private#async#search(l:command, 1)"+ , GenericStatement "elseif ferret#private#dispatch()"+ , GenericStatement "call ferret#private#dispatch#search(l:command)"+ , GenericStatement "else"+ , GenericStatement+ "call ferret#private#vanilla#search(l:command, 1)"+ , GenericStatement "endif"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#lack"+ , functionArguments = ArgumentList [ Argument "..." ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ LetStatement+ { letLexpr = "l:command" , letValue = "s:parse(a:000)" }+ , GenericStatement "call ferret#private#hlsearch()"+ , GenericStatement "if empty(&grepprg)"+ , GenericStatement "return"+ , GenericStatement "endif"+ , GenericStatement "if ferret#private#async()"+ , GenericStatement "call ferret#private#async#search(l:command, 0)"+ , GenericStatement "else"+ , GenericStatement+ "call ferret#private#vanilla#search(l:command, 0)"+ , GenericStatement "endif"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#hlsearch"+ , functionArguments = ArgumentList []+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement "if has('extra_search')"+ , Empty+ , LetStatement+ { letLexpr = "l:hlsearch"+ , letValue = "get(g:, 'FerretHlsearch', &hlsearch)"+ }+ , GenericStatement "if l:hlsearch"+ , LetStatement+ { letLexpr = "@/" , letValue = "g:ferret_lastsearch" }+ , GenericStatement+ "call feedkeys(\":let &hlsearch=1 | echo \\<CR>\", 'n')"+ , GenericStatement "endif"+ , GenericStatement "endif"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#acks"+ , functionArguments = ArgumentList [ Argument "command" ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ LetStatement+ { letLexpr = "l:matches "+ , letValue =+ "matchlist(a:command, '\\v\\C^(([^|\"\\\\a-zA-Z0-9]).+\\2.*\\2)([cgeiI]*)$')"+ }+ , GenericStatement "if !len(l:matches)"+ , GenericStatement+ "call ferret#private#error( 'Ferret: Expected a substitution expression (/foo/bar/); got: ' . a:command )"+ , GenericStatement "return"+ , GenericStatement "endif"+ , LetStatement+ { letLexpr = "l:pattern " , letValue = "l:matches[1]" }+ , LetStatement+ { letLexpr = "l:options " , letValue = "l:matches[3]" }+ , GenericStatement "if l:options !~# 'e'"+ , LetStatement { letLexpr = "l:options ." , letValue = "'e'" }+ , GenericStatement "endif"+ , GenericStatement "if l:options !~# 'g'"+ , LetStatement { letLexpr = "l:options ." , letValue = "'g'" }+ , GenericStatement "endif"+ , LetStatement+ { letLexpr = "l:filenames" , letValue = "ferret#private#qargs()" }+ , GenericStatement "if l:filenames ==# ''"+ , GenericStatement+ "call ferret#private#error( 'Ferret: Quickfix filenames must be present, but there are none ' . '(must use :Ack to find files before :Acks can be used)' )"+ , GenericStatement "return"+ , GenericStatement "endif"+ , GenericStatement "execute 'args' l:filenames"+ , GenericStatement "call ferret#private#autocmd('FerretWillWrite')"+ , GenericStatement+ "execute 'argdo' '%s' . l:pattern . l:options . ' | update'"+ , GenericStatement "call ferret#private#autocmd('FerretDidWrite')"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#autocmd"+ , functionArguments = ArgumentList [ Argument "cmd" ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement+ "if v:version > 703 || v:version == 703 && has('patch438')"+ , GenericStatement+ "execute 'silent doautocmd <nomodeline> User ' . a:cmd"+ , GenericStatement "else"+ , GenericStatement "execute 'silent doautocmd User ' . a:cmd"+ , GenericStatement "endif"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "s:split"+ , functionArguments = ArgumentList [ Argument "str" ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement+ "return split(a:str, '\\%(\\%(\\%(^\\|[^\\\\]\\)\\\\\\)\\@<!\\s\\)\\+\\zs')"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#ackcomplete"+ , functionArguments =+ ArgumentList+ [ Argument "arglead" , Argument "cmdline" , Argument "cursorpos" ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement+ "return ferret#private#complete('Ack', a:arglead, a:cmdline, a:cursorpos)"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#lackcomplete"+ , functionArguments =+ ArgumentList+ [ Argument "arglead" , Argument "cmdline" , Argument "cursorpos" ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement+ "return ferret#private#complete('Lack', a:arglead, a:cmdline, a:cursorpos)"+ ]+ }+ , GenericStatement "if executable('ag')"+ , LetStatement { letLexpr = "s:executable" , letValue = "'ag'" }+ , GenericStatement "elseif executable('ack')"+ , LetStatement { letLexpr = "s:executable" , letValue = "'ack'" }+ , GenericStatement "elseif executable('grep')"+ , LetStatement { letLexpr = "s:executable" , letValue = "'grep'" }+ , GenericStatement "else"+ , LetStatement { letLexpr = "s:executable" , letValue = "''" }+ , GenericStatement "endif"+ , LetStatement { letLexpr = "s:options " , letValue = "{" }+ , GenericStatement+ "\\ 'ack': [ '--ignore-ack-defaults', '--ignore-case', '--ignore-dir', '--ignore-directory', '--invert-match', '--known-types', '--literal', '--no-recurse', '--recurse', '--sort-files', '--type', '--word-regexp', '-1', '-Q', '-R', '-i', '-k', '-r', '-v', '-w', ], 'ag': [ '--all-types', '--all-text', '--case-sensitive', '--depth', '--follow', '--ignore', '--ignore-case', '--ignore-dir', '--invert-match', '--literal', '--max-count', '--skip-vcs-ignores', '--unrestricted', '--word-regexp', '-Q', '-U', '-a', '-i', '-m', '-s', '-t', '-u', '-v', '-w' ] }"+ , FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#complete"+ , functionArguments =+ ArgumentList+ [ Argument "cmd"+ , Argument "arglead"+ , Argument "cmdline"+ , Argument "cursorpos"+ ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ LetStatement+ { letLexpr = "l:args"+ , letValue = "s:split(a:cmdline[:a:cursorpos])"+ }+ , LetStatement { letLexpr = "l:command_seen" , letValue = "0" }+ , LetStatement { letLexpr = "l:pattern_seen" , letValue = "0" }+ , LetStatement { letLexpr = "l:position" , letValue = "0" }+ , GenericStatement "for l:arg in l:args"+ , LetStatement+ { letLexpr = "l:position" , letValue = "l:position + len(l:arg)" }+ , LetStatement+ { letLexpr = "l:stripped"+ , letValue = "substitute(l:arg, '\\s\\+$', '', '')"+ }+ , GenericStatement "if ferret#private#option(l:stripped)"+ , GenericStatement "if a:cursorpos <= l:position"+ , LetStatement+ { letLexpr = "l:options"+ , letValue = "get(s:options, s:executable, [])"+ }+ , GenericStatement+ "return filter(l:options, 'match(v:val, l:stripped) == 0')"+ , GenericStatement "endif"+ , GenericStatement "elseif l:pattern_seen"+ , GenericStatement "if a:cursorpos <= l:position"+ , GenericStatement "return glob(a:arglead . '*', 1, 1)"+ , GenericStatement "end"+ , GenericStatement "elseif l:command_seen"+ , LetStatement { letLexpr = "l:pattern_seen" , letValue = "1" }+ , GenericStatement "elseif l:stripped ==# a:cmd"+ , LetStatement { letLexpr = "l:command_seen" , letValue = "1" }+ , GenericStatement "else"+ , GenericStatement "end"+ , GenericStatement "endfor"+ , GenericStatement "return []"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#option"+ , functionArguments = ArgumentList [ Argument "str" ]+ , functionAttributes = [ "abort" ]+ , functionBody = [ GenericStatement "return a:str =~# '^-'" ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#qargs"+ , functionArguments = ArgumentList []+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ LetStatement { letLexpr = "l:buffer_numbers" , letValue = "{}" }+ , GenericStatement "for l:item in getqflist()"+ , LetStatement+ { letLexpr = "l:buffer_numbers[l:item['bufnr']]"+ , letValue = "bufname(l:item['bufnr'])"+ }+ , GenericStatement "endfor"+ , GenericStatement+ "return join(map(values(l:buffer_numbers), 'fnameescape(v:val)'))"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#qf_delete"+ , functionArguments = ArgumentList []+ , functionAttributes = [ "range" ]+ , functionBody =+ [ GenericStatement "call s:delete(a:firstline, a:lastline)" ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "ferret#private#qf_delete_motion"+ , functionArguments =+ ArgumentList [ Argument "type" , Argument "..." ]+ , functionAttributes = []+ , functionBody =+ [ LetStatement+ { letLexpr = "l:selection" , letValue = "&selection" }+ , LetStatement+ { letLexpr = "&selection" , letValue = "'inclusive'" }+ , LetStatement+ { letLexpr = "l:firstline" , letValue = "line(\"'[\")" }+ , LetStatement+ { letLexpr = "l:lastline" , letValue = "line(\"']\")" }+ , GenericStatement "call s:delete(l:firstline, l:lastline)"+ , LetStatement+ { letLexpr = "&selection" , letValue = "l:selection" }+ ]+ }+ ]+ , Unit+ [ LetStatement+ { letLexpr = "s:options"+ , letValue = "get(g:, 'FerretQFOptions', 1)"+ }+ , GenericStatement "if s:options"+ , GenericStatement "setlocal nolist"+ , GenericStatement "if exists('+relativenumber')"+ , GenericStatement "setlocal norelativenumber"+ , GenericStatement "endif"+ , GenericStatement "setlocal nowrap"+ , GenericStatement "setlocal number"+ , LetStatement+ { letLexpr = "s:original_scrolloff" , letValue = "&scrolloff" }+ , GenericStatement "set scrolloff=0"+ , GenericStatement "if has('autocmd')"+ , GenericStatement "augroup FerretQF"+ , GenericStatement "autocmd!"+ , GenericStatement+ "autocmd BufLeave <buffer> execute 'set scrolloff=' . s:original_scrolloff"+ , GenericStatement+ "autocmd BufEnter <buffer> set scrolloff=0 | setlocal nocursorline"+ , GenericStatement "augroup END"+ , GenericStatement "endif"+ , GenericStatement "endif"+ , LetStatement+ { letLexpr = "s:map" , letValue = "get(g:, 'FerretQFMap', 1)" }+ , GenericStatement "if s:map"+ , GenericStatement+ "nnoremap <buffer> <silent> d :set operatorfunc=ferret#private#qf_delete_motion<CR>g@"+ , GenericStatement+ "nnoremap <buffer> <silent> dd :call ferret#private#qf_delete()<CR>"+ , GenericStatement+ "vnoremap <buffer> <silent> d :call ferret#private#qf_delete()<CR>"+ , GenericStatement "endif"+ ]+ , Unit+ [ GenericStatement+ "if exists('g:FerretLoaded') || &compatible || v:version < 700"+ , GenericStatement "finish"+ , GenericStatement "endif"+ , LetStatement { letLexpr = "g:FerretLoaded " , letValue = "1" }+ , LetStatement+ { letLexpr = "s:cpoptions " , letValue = "&cpoptions" }+ , GenericStatement "set cpoptions&vim"+ , GenericStatement+ "if executable('ag') \" The Silver Searcher: faster than ack."+ , LetStatement+ { letLexpr = "s:ackprg " , letValue = "'ag --vimgrep'" }+ , GenericStatement+ "elseif executable('ack') \" Ack: better than grep."+ , LetStatement+ { letLexpr = "s:ackprg "+ , letValue = "'ack --column --with-filename'"+ }+ , GenericStatement+ "elseif executable('grep') \" Grep: it's just grep."+ , LetStatement+ { letLexpr = "s:ackprg "+ , letValue = "&grepprg \" default is: grep -n $* /dev/null"+ }+ , GenericStatement "endif"+ , GenericStatement "if !empty(s:ackprg)"+ , LetStatement { letLexpr = "&grepprg" , letValue = "s:ackprg" }+ , GenericStatement "set grepformat=%f:%l:%c:%m"+ , GenericStatement "endif"+ , GenericStatement "if has('autocmd')"+ , GenericStatement "augroup Ferret"+ , GenericStatement "autocmd!"+ , GenericStatement "autocmd QuickFixCmdPost [^l]* nested cwindow"+ , GenericStatement "autocmd QuickFixCmdPost l* nested lwindow"+ , GenericStatement "augroup END"+ , GenericStatement "endif"+ , GenericStatement+ "command! -nargs=+ -complete=customlist,ferret#private#ackcomplete Ack call ferret#private#ack(<f-args>)"+ , GenericStatement+ "command! -nargs=+ -complete=customlist,ferret#private#lackcomplete Lack call ferret#private#lack(<f-args>)"+ , GenericStatement+ "command! -nargs=1 Acks call ferret#private#acks(<q-args>)"+ , GenericStatement+ "command! FerretCancelAsync call ferret#private#async#cancel()"+ , GenericStatement+ "command! FerretPullAsync call ferret#private#async#pull()"+ , GenericStatement "nnoremap <Plug>(FerretAck) :Ack<space>"+ , GenericStatement "nnoremap <Plug>(FerretLack) :Lack<space>"+ , GenericStatement+ "nnoremap <Plug>(FerretAckWord) :Ack <C-r><C-w><CR>"+ , GenericStatement+ "nnoremap <Plug>(FerretAcks) :Acks <c-r>=(exists('g:ferret_lastsearch') ? '/' . g:ferret_lastsearch . '//' : ' ')<CR><Left>"+ , LetStatement+ { letLexpr = "s:map" , letValue = "get(g:, 'FerretMap', 1)" }+ , GenericStatement "if s:map"+ , GenericStatement+ "if !hasmapto('<Plug>(FerretAck)') && maparg('<leader>a', 'n') ==# ''"+ , GenericStatement "nmap <unique> <leader>a <Plug>(FerretAck)"+ , GenericStatement "endif"+ , GenericStatement+ "if !hasmapto('<Plug>FerretLack') && maparg('<leader>l', 'n') ==# ''"+ , GenericStatement "nmap <unique> <leader>l <Plug>(FerretLack)"+ , GenericStatement "endif"+ , GenericStatement+ "if !hasmapto('<Plug>(FerretAckWord)') && maparg('<leader>s', 'n') ==# ''"+ , GenericStatement "nmap <unique> <leader>s <Plug>(FerretAckWord)"+ , GenericStatement "endif"+ , GenericStatement+ "if !hasmapto('<Plug>(FerretAcks)') && maparg('<leader>r', 'n') ==# ''"+ , GenericStatement "nmap <unique> <leader>r <Plug>(FerretAcks)"+ , GenericStatement "endif"+ , GenericStatement "endif"+ , GenericStatement+ "command! -bar Qargs execute 'args' ferret#private#qargs()"+ , LetStatement+ { letLexpr = "s:commands"+ , letValue = "get(g:, 'FerretQFCommands', 1)"+ }+ , GenericStatement "if s:commands"+ , GenericStatement+ "cabbrev <silent> <expr> cn ((getcmdtype() == ':' && getcmdpos() == 3) ? 'cn <bar> normal zz' : 'cn')"+ , GenericStatement+ "cabbrev <silent> <expr> cnf ((getcmdtype() == ':' && getcmdpos() == 4) ? 'cnf <bar> normal zz' : 'cnf')"+ , GenericStatement+ "cabbrev <silent> <expr> cp ((getcmdtype() == ':' && getcmdpos() == 3) ? 'cp <bar> normal zz' : 'cp')"+ , GenericStatement+ "cabbrev <silent> <expr> cpf ((getcmdtype() == ':' && getcmdpos() == 4) ? 'cpf <bar> normal zz' : 'cpf')"+ , GenericStatement "endif"+ , LetStatement+ { letLexpr = "&cpoptions " , letValue = "s:cpoptions" }+ , UnletStatement { unletBang = False , unletBody = "s:cpoptions" }+ ]+ ]+ , CommandsAnnotation+ , CommandAnnotation "Ack" (Just "{pattern} {options}")+ , Paragraph+ [ Plaintext "Searches"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "{pattern}"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "all"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "files"+ , Whitespace+ , Plaintext "under"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "current"+ , Whitespace+ , Plaintext "directory"+ , Whitespace+ , Plaintext "(see"+ , Whitespace+ , Link ":pwd"+ , Plaintext "),"+ , Whitespace+ , Plaintext "unless"+ , Whitespace+ , Plaintext "otherwise"+ , Whitespace+ , Plaintext "overridden"+ , Whitespace+ , Plaintext "via"+ , Whitespace+ , Plaintext "{options},"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "displays"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "results"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link "quickfix"+ , Whitespace+ , Plaintext "listing."+ ]+ , Paragraph+ [ Code "ag"+ , Whitespace+ , Plaintext "(The"+ , Whitespace+ , Plaintext "Silver"+ , Whitespace+ , Plaintext "Searcher)"+ , Whitespace+ , Plaintext "will"+ , Whitespace+ , Plaintext "be"+ , Whitespace+ , Plaintext "used"+ , Whitespace+ , Plaintext "preferentially"+ , Whitespace+ , Plaintext "if"+ , Whitespace+ , Plaintext "present"+ , Whitespace+ , Plaintext "on"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "system,"+ , Whitespace+ , Plaintext "because"+ , Whitespace+ , Plaintext "it"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "faster,"+ , Whitespace+ , Plaintext "falling"+ , Whitespace+ , Plaintext "back"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Code "ack"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "then"+ , Whitespace+ , Code "grep"+ , Whitespace+ , Plaintext "as"+ , Whitespace+ , Plaintext "needed."+ ]+ , Paragraph+ [ Plaintext "If"+ , Whitespace+ , Plaintext "dispatch.vim"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "installed"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "process"+ , Whitespace+ , Plaintext "will"+ , Whitespace+ , Plaintext "run"+ , Whitespace+ , Plaintext "asynchronously"+ , Whitespace+ , Plaintext "via"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link ":Make"+ , Whitespace+ , Plaintext "command,"+ , Whitespace+ , Plaintext "otherwise"+ , Whitespace+ , Plaintext "it"+ , Whitespace+ , Plaintext "will"+ , Whitespace+ , Plaintext "be"+ , Whitespace+ , Plaintext "run"+ , Whitespace+ , Plaintext "synchronously"+ , Whitespace+ , Plaintext "via"+ , Whitespace+ , Link ":cexpr"+ , Plaintext "."+ , Whitespace+ , Plaintext "Asynchronous"+ , Whitespace+ , Plaintext "searches"+ , Whitespace+ , Plaintext "are"+ , Whitespace+ , Plaintext "preferred"+ , Whitespace+ , Plaintext "because"+ , Whitespace+ , Plaintext "they"+ , Whitespace+ , Plaintext "do"+ , Whitespace+ , Plaintext "not"+ , Whitespace+ , Plaintext "block,"+ , Whitespace+ , Plaintext "despite"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "fact"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "Vim"+ , Whitespace+ , Plaintext "itself"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "single"+ , Whitespace+ , Plaintext "threaded."+ , Whitespace+ , Plaintext "The"+ , Whitespace+ , Link "g:FerretDispatch"+ , Whitespace+ , Plaintext "option"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "be"+ , Whitespace+ , Plaintext "used"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "prevent"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "use"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "dispatch.vim."+ ]+ , Paragraph+ [ Plaintext "The"+ , Whitespace+ , Plaintext "{pattern}"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "passed"+ , Whitespace+ , Plaintext "through"+ , Whitespace+ , Plaintext "as-is"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "underlying"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "program,"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "no"+ , Whitespace+ , Plaintext "escaping"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "required"+ , Whitespace+ , Plaintext "other"+ , Whitespace+ , Plaintext "than"+ , Whitespace+ , Plaintext "preceding"+ , Whitespace+ , Plaintext "spaces"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "single"+ , Whitespace+ , Plaintext "backslash."+ , Whitespace+ , Plaintext "For"+ , Whitespace+ , Plaintext "example,"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "\"\\bfoo[0-9]{2}"+ , Whitespace+ , Plaintext "bar\\b\""+ , Whitespace+ , Plaintext "(ie."+ , Whitespace+ , Plaintext "using"+ , Whitespace+ , Code "ag"+ , Plaintext "'s"+ , Whitespace+ , Plaintext "Perl-style"+ , Whitespace+ , Plaintext "regular"+ , Whitespace+ , Plaintext "expression"+ , Whitespace+ , Plaintext "syntax),"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "could"+ , Whitespace+ , Plaintext "do:"+ ]+ , Fenced [ ":Ack \\bfoo[0-9]{2}\\ bar\\b" ]+ , Paragraph+ [ Plaintext "Likewise,"+ , Whitespace+ , Plaintext "{options}"+ , Whitespace+ , Plaintext "are"+ , Whitespace+ , Plaintext "passed"+ , Whitespace+ , Plaintext "through."+ , Whitespace+ , Plaintext "In"+ , Whitespace+ , Plaintext "this"+ , Whitespace+ , Plaintext "example,"+ , Whitespace+ , Plaintext "we"+ , Whitespace+ , Plaintext "pass"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Code "-w"+ , Whitespace+ , Plaintext "option"+ , Whitespace+ , Plaintext "(to"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "on"+ , Whitespace+ , Plaintext "word"+ , Whitespace+ , Plaintext "boundaries),"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "scope"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "\"foo\""+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "\"bar\""+ , Whitespace+ , Plaintext "subdirectories:"+ , Whitespace+ , Plaintext ">"+ ]+ , Fenced [ ":Ack -w something foo bar" ]+ , Paragraph+ [ Plaintext "As"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "convenience"+ , Whitespace+ , Plaintext "<leader>a"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "set-up"+ , Whitespace+ , Plaintext "("+ , Link "<Plug>(FerretAck)"+ , Plaintext ")"+ , Whitespace+ , Plaintext "as"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "shortcut"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "enter"+ , Whitespace+ , Link "Cmdline-mode"+ , Whitespace+ , Plaintext "with"+ , Whitespace+ , Code ":Ack"+ , Whitespace+ , Plaintext "inserted"+ , Whitespace+ , Plaintext "on"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link "Cmdline"+ , Plaintext "."+ , Whitespace+ , Plaintext "Likewise"+ , Whitespace+ , Plaintext "<leader>s"+ , Whitespace+ , Plaintext "("+ , Link "<Plug>(FerretAckWord)"+ , Plaintext ")"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "shortcut"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "running"+ , Whitespace+ , Link ":Ack"+ , Whitespace+ , Plaintext "with"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "word"+ , Whitespace+ , Plaintext "currently"+ , Whitespace+ , Plaintext "under"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "cursor."+ ]+ , CommandAnnotation "Lack" (Just "{pattern} {options}")+ , Paragraph+ [ Plaintext "Just"+ , Whitespace+ , Plaintext "like"+ , Whitespace+ , Link ":Ack"+ , Plaintext ","+ , Whitespace+ , Plaintext "but"+ , Whitespace+ , Plaintext "instead"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "using"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link "quickfix"+ , Whitespace+ , Plaintext "listing,"+ , Whitespace+ , Plaintext "which"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "global"+ , Whitespace+ , Plaintext "across"+ , Whitespace+ , Plaintext "an"+ , Whitespace+ , Plaintext "entire"+ , Whitespace+ , Plaintext "Vim"+ , Whitespace+ , Plaintext "instance,"+ , Whitespace+ , Plaintext "it"+ , Whitespace+ , Plaintext "uses"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link "location-list"+ , Plaintext ","+ , Whitespace+ , Plaintext "which"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "per-window"+ , Whitespace+ , Plaintext "construct."+ ]+ , Paragraph+ [ Plaintext "Note"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Link ":Lack"+ , Whitespace+ , Plaintext "always"+ , Whitespace+ , Plaintext "runs"+ , Whitespace+ , Plaintext "synchronously"+ , Whitespace+ , Plaintext "via"+ , Whitespace+ , Link ":cexpr"+ , Plaintext ","+ , Whitespace+ , Plaintext "because"+ , Whitespace+ , Plaintext "dispatch.vim"+ , Whitespace+ , Plaintext "doesn't"+ , Whitespace+ , Plaintext "currently"+ , Whitespace+ , Plaintext "support"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link "location-list"+ , Plaintext "."+ ]+ , CommandAnnotation "Acks" (Just "/{pattern}/{replacement}/")+ , Paragraph+ [ Plaintext "Takes"+ , Whitespace+ , Plaintext "all"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "files"+ , Whitespace+ , Plaintext "currently"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link "quickfix"+ , Whitespace+ , Plaintext "listing"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "performs"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "substitution"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "all"+ , Whitespace+ , Plaintext "instances"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "{pattern}"+ , Whitespace+ , Plaintext "(a"+ , Whitespace+ , Plaintext "standard"+ , Whitespace+ , Plaintext "Vim"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Link "pattern"+ , Plaintext ")"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "{replacement}."+ ]+ , Paragraph+ [ Plaintext "A"+ , Whitespace+ , Plaintext "typical"+ , Whitespace+ , Plaintext "sequence"+ , Whitespace+ , Plaintext "consists"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "an"+ , Whitespace+ , Link ":Ack"+ , Whitespace+ , Plaintext "invocation"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "populate"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link "quickfix"+ , Whitespace+ , Plaintext "listing"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "then"+ , Whitespace+ , Link ":Acks"+ , Whitespace+ , Plaintext "(mnemonic:"+ , Whitespace+ , Plaintext "\"Ack"+ , Whitespace+ , Plaintext "substitute\")"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "perform"+ , Whitespace+ , Plaintext "replacements."+ , Whitespace+ , Plaintext "For"+ , Whitespace+ , Plaintext "example,"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "replace"+ , Whitespace+ , Plaintext "\"foo\""+ , Whitespace+ , Plaintext "with"+ , Whitespace+ , Plaintext "\"bar\""+ , Whitespace+ , Plaintext "across"+ , Whitespace+ , Plaintext "all"+ , Whitespace+ , Plaintext "files"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "current"+ , Whitespace+ , Plaintext "directory:"+ ]+ , Fenced [ ":Ack foo" , ":Acks /foo/bar/" ]+ , CommandAnnotation "Qargs" Nothing+ , Paragraph+ [ Plaintext "This"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "utility"+ , Whitespace+ , Plaintext "function"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "used"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link ":Acks"+ , Whitespace+ , Plaintext "command"+ , Whitespace+ , Plaintext "but"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "also"+ , Whitespace+ , Plaintext "generally"+ , Whitespace+ , Plaintext "useful"+ , Whitespace+ , Plaintext "enough"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "warrant"+ , Whitespace+ , Plaintext "being"+ , Whitespace+ , Plaintext "exposed"+ , Whitespace+ , Plaintext "publicly."+ ]+ , Paragraph+ [ Plaintext "It"+ , Whitespace+ , Plaintext "takes"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "files"+ , Whitespace+ , Plaintext "currently"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link "quickfix"+ , Whitespace+ , Plaintext "listing"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "sets"+ , Whitespace+ , Plaintext "them"+ , Whitespace+ , Plaintext "as"+ , Whitespace+ , Link ":args"+ , Whitespace+ , Plaintext "so"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "they"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "be"+ , Whitespace+ , Plaintext "operated"+ , Whitespace+ , Plaintext "on"+ , Whitespace+ , Plaintext "en"+ , Whitespace+ , Plaintext "masse"+ , Whitespace+ , Plaintext "via"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link ":argdo"+ , Whitespace+ , Plaintext "command."+ ]+ , MappingsAnnotation+ , SubheadingAnnotation+ "Circumstances where mappings do not get set up"+ , Paragraph+ [ Plaintext "Note"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "Ferret"+ , Whitespace+ , Plaintext "will"+ , Whitespace+ , Plaintext "not"+ , Whitespace+ , Plaintext "try"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Plaintext "up"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "<leader>"+ , Whitespace+ , Plaintext "mappings"+ , Whitespace+ , Plaintext "if"+ , Whitespace+ , Plaintext "any"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "following"+ , Whitespace+ , Plaintext "are"+ , Whitespace+ , Plaintext "true:"+ ]+ , List+ [ ListItem+ [ Plaintext "A"+ , Whitespace+ , Plaintext "mapping"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "already"+ , Whitespace+ , Plaintext "exists."+ ]+ , ListItem+ [ Plaintext "An"+ , Whitespace+ , Plaintext "alternative"+ , Whitespace+ , Plaintext "mapping"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "same"+ , Whitespace+ , Plaintext "functionality"+ , Whitespace+ , Plaintext "has"+ , Whitespace+ , Plaintext "already"+ , Whitespace+ , Plaintext "been"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Plaintext "up"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Link ".vimrc"+ , Plaintext "."+ ]+ , ListItem+ [ Plaintext "The"+ , Whitespace+ , Plaintext "mapping"+ , Whitespace+ , Plaintext "has"+ , Whitespace+ , Plaintext "been"+ , Whitespace+ , Plaintext "suppressed"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "setting"+ , Whitespace+ , Link "g:FerretMap"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "1"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "your"+ , Whitespace+ , Link ".vimrc"+ , Plaintext "."+ ]+ ]+ , SubheadingAnnotation "Mappings specific to the quickfix window"+ , Paragraph+ [ Plaintext "Additionally,"+ , Whitespace+ , Plaintext "Ferret"+ , Whitespace+ , Plaintext "will"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Plaintext "up"+ , Whitespace+ , Plaintext "special"+ , Whitespace+ , Plaintext "mappings"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Link "quickfix"+ , Whitespace+ , Plaintext "listings,"+ , Whitespace+ , Plaintext "unless"+ , Whitespace+ , Plaintext "prevented"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "doing"+ , Whitespace+ , Plaintext "so"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Link "g:FerretQFMap"+ , Plaintext ":"+ ]+ , List+ [ ListItem+ [ Code "d"+ , Whitespace+ , Plaintext "("+ , Link "visual-mode"+ , Plaintext "):"+ , Whitespace+ , Plaintext "delete"+ , Whitespace+ , Plaintext "visual"+ , Whitespace+ , Plaintext "selection"+ ]+ , ListItem+ [ Code "dd"+ , Whitespace+ , Plaintext "("+ , Link "Normal-mode"+ , Plaintext "):"+ , Whitespace+ , Plaintext "delete"+ , Whitespace+ , Plaintext "current"+ , Whitespace+ , Plaintext "line"+ ]+ , ListItem+ [ Code "d"+ , Plaintext "{motion}"+ , Whitespace+ , Plaintext "("+ , Link "Normal-mode"+ , Plaintext "):"+ , Whitespace+ , Plaintext "delete"+ , Whitespace+ , Plaintext "range"+ , Whitespace+ , Plaintext "indicated"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "{motion}"+ ]+ ]+ , MappingAnnotation "<Plug>(FerretAck)"+ , Paragraph+ [ Plaintext "Ferret"+ , Whitespace+ , Plaintext "maps"+ , Whitespace+ , Plaintext "<leader>a"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Link "<Plug>(FerretAck)"+ , Plaintext ","+ , Whitespace+ , Plaintext "which"+ , Whitespace+ , Plaintext "triggers"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link ":Ack"+ , Whitespace+ , Plaintext "command."+ , Whitespace+ , Plaintext "To"+ , Whitespace+ , Plaintext "use"+ , Whitespace+ , Plaintext "an"+ , Whitespace+ , Plaintext "alternative"+ , Whitespace+ , Plaintext "mapping"+ , Whitespace+ , Plaintext "instead,"+ , Whitespace+ , Plaintext "create"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "different"+ , Whitespace+ , Plaintext "one"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "your"+ , Whitespace+ , Link ".vimrc"+ , Whitespace+ , Plaintext "instead"+ , Whitespace+ , Plaintext "using"+ , Whitespace+ , Link ":nmap"+ , Plaintext ":"+ ]+ , Fenced+ [ "\" Instead of <leader>a, use <leader>x."+ , "nmap <leader>x <Plug>(FerretAck)"+ ]+ , MappingAnnotation "<Plug>(FerretLack)"+ , Paragraph+ [ Plaintext "Ferret"+ , Whitespace+ , Plaintext "maps"+ , Whitespace+ , Plaintext "<leader>l"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Link "<Plug>(FerretLack)"+ , Plaintext ","+ , Whitespace+ , Plaintext "which"+ , Whitespace+ , Plaintext "triggers"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link ":Lack"+ , Whitespace+ , Plaintext "command."+ , Whitespace+ , Plaintext "To"+ , Whitespace+ , Plaintext "use"+ , Whitespace+ , Plaintext "an"+ , Whitespace+ , Plaintext "alternative"+ , Whitespace+ , Plaintext "mapping"+ , Whitespace+ , Plaintext "instead,"+ , Whitespace+ , Plaintext "create"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "different"+ , Whitespace+ , Plaintext "one"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "your"+ , Whitespace+ , Link ".vimrc"+ , Whitespace+ , Plaintext "instead"+ , Whitespace+ , Plaintext "using"+ , Whitespace+ , Link ":nmap"+ , Plaintext ":"+ ]+ , Fenced+ [ "\" Instead of <leader>l, use <leader>y."+ , "nmap <leader>y <Plug>(FerretLack)"+ ]+ , MappingAnnotation "<Plug>(FerretAckWord)"+ , Paragraph+ [ Plaintext "Ferret"+ , Whitespace+ , Plaintext "maps"+ , Whitespace+ , Plaintext "<leader>s"+ , Whitespace+ , Plaintext "(mnemonix:"+ , Whitespace+ , Plaintext "\"selection)"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Link "<Plug>(FerretAckWord)"+ , Plaintext ","+ , Whitespace+ , Plaintext "which"+ , Whitespace+ , Plaintext "uses"+ , Whitespace+ , Link ":Ack"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "word"+ , Whitespace+ , Plaintext "currently"+ , Whitespace+ , Plaintext "under"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "cursor."+ , Whitespace+ , Plaintext "To"+ , Whitespace+ , Plaintext "use"+ , Whitespace+ , Plaintext "an"+ , Whitespace+ , Plaintext "alternative"+ , Whitespace+ , Plaintext "mapping"+ , Whitespace+ , Plaintext "instead,"+ , Whitespace+ , Plaintext "create"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "different"+ , Whitespace+ , Plaintext "one"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "your"+ , Whitespace+ , Link ".vimrc"+ , Whitespace+ , Plaintext "instead"+ , Whitespace+ , Plaintext "using"+ , Whitespace+ , Link ":nmap"+ , Plaintext ":"+ ]+ , Fenced+ [ "\" Instead of <leader>s, use <leader>z."+ , "nmap <leader>z <Plug>(FerretAckWord)"+ ]+ , MappingAnnotation "<Plug>(FerretAcks)"+ , Paragraph+ [ Plaintext "Ferret"+ , Whitespace+ , Plaintext "maps"+ , Whitespace+ , Plaintext "<leader>r"+ , Whitespace+ , Plaintext "(mnemonic:"+ , Whitespace+ , Plaintext "\"replace\")"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Link "<Plug>(FerretAcks)"+ , Plaintext ","+ , Whitespace+ , Plaintext "which"+ , Whitespace+ , Plaintext "triggers"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link ":Acks"+ , Whitespace+ , Plaintext "command"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "fills"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "prompt"+ , Whitespace+ , Plaintext "with"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "last"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "term"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "Ferret."+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "use"+ , Whitespace+ , Plaintext "an"+ , Whitespace+ , Plaintext "alternative"+ , Whitespace+ , Plaintext "mapping"+ , Whitespace+ , Plaintext "instead,"+ , Whitespace+ , Plaintext "create"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "different"+ , Whitespace+ , Plaintext "one"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "your"+ , Whitespace+ , Link ".vimrc"+ , Whitespace+ , Plaintext "instead"+ , Whitespace+ , Plaintext "using"+ , Whitespace+ , Link ":nmap"+ , Plaintext ":"+ ]+ , Fenced+ [ "\" Instead of <leader>r, use <leader>u."+ , "nmap <leader>u <Plug>(FerretAcks)"+ ]+ , OptionsAnnotation+ , OptionAnnotation "g:FerretDispatch" "boolean" (Just "1")+ , Paragraph+ [ Plaintext "Controls"+ , Whitespace+ , Plaintext "whether"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "use"+ , Whitespace+ , Plaintext "vim-dispatch"+ , Whitespace+ , Plaintext "(and"+ , Whitespace+ , Plaintext "specifically,"+ , Whitespace+ , Link ":Make"+ , Plaintext ")"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "run"+ , Whitespace+ , Link ":Ack"+ , Whitespace+ , Plaintext "searches"+ , Whitespace+ , Plaintext "asynchronously,"+ , Whitespace+ , Plaintext "when"+ , Whitespace+ , Plaintext "available."+ , Whitespace+ , Plaintext "To"+ , Whitespace+ , Plaintext "prevent"+ , Whitespace+ , Plaintext "vim-dispatch"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "being"+ , Whitespace+ , Plaintext "used,"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "0:"+ ]+ , Fenced [ "let g:FerretDispatch=0" ]+ , OptionAnnotation "g:FerretHlsearch" "boolean" Nothing+ , Paragraph+ [ Plaintext "Controls"+ , Whitespace+ , Plaintext "whether"+ , Whitespace+ , Plaintext "Ferret"+ , Whitespace+ , Plaintext "should"+ , Whitespace+ , Plaintext "attempt"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "highlight"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "pattern"+ , Whitespace+ , Plaintext "when"+ , Whitespace+ , Plaintext "running"+ , Whitespace+ , Link ":Ack"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Link ":Lack"+ , Plaintext "."+ , Whitespace+ , Plaintext "If"+ , Whitespace+ , Plaintext "left"+ , Whitespace+ , Plaintext "unset,"+ , Whitespace+ , Plaintext "Ferret"+ , Whitespace+ , Plaintext "will"+ , Whitespace+ , Plaintext "respect"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "current"+ , Whitespace+ , Plaintext "'hlsearch'"+ , Whitespace+ , Plaintext "setting."+ , Whitespace+ , Plaintext "To"+ , Whitespace+ , Plaintext "force"+ , Whitespace+ , Plaintext "highlighting"+ , Whitespace+ , Plaintext "on"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Plaintext "off"+ , Whitespace+ , Plaintext "irrespective"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "'hlsearch',"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Link "g:FerretHlsearch"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "1"+ , Whitespace+ , Plaintext "(on)"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Plaintext "0"+ , Whitespace+ , Plaintext "(off):"+ ]+ , Fenced [ "let g:FerretHlsearch=0" ]+ , OptionAnnotation "g:FerretQFOptions" "boolean" (Just "1")+ , Paragraph+ [ Plaintext "Controls"+ , Whitespace+ , Plaintext "whether"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Plaintext "up"+ , Whitespace+ , Plaintext "setting"+ , Whitespace+ , Plaintext "overrides"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Link "quickfix"+ , Whitespace+ , Plaintext "windows."+ , Whitespace+ , Plaintext "These"+ , Whitespace+ , Plaintext "are"+ , Whitespace+ , Plaintext "various"+ , Whitespace+ , Plaintext "settings,"+ , Whitespace+ , Plaintext "such"+ , Whitespace+ , Plaintext "as"+ , Whitespace+ , Link "norelativenumber"+ , Plaintext ","+ , Whitespace+ , Link "nolist"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Link "nowrap"+ , Plaintext ","+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "are"+ , Whitespace+ , Plaintext "intended"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "make"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link "quickfix"+ , Whitespace+ , Plaintext "window,"+ , Whitespace+ , Plaintext "which"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "typically"+ , Whitespace+ , Plaintext "very"+ , Whitespace+ , Plaintext "small"+ , Whitespace+ , Plaintext "relative"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "other"+ , Whitespace+ , Plaintext "windows,"+ , Whitespace+ , Plaintext "more"+ , Whitespace+ , Plaintext "usable."+ ]+ , Paragraph+ [ Plaintext "A"+ , Whitespace+ , Plaintext "full"+ , Whitespace+ , Plaintext "list"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "overridden"+ , Whitespace+ , Plaintext "settings"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "be"+ , Whitespace+ , Plaintext "found"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Link "ferret-overrides"+ , Plaintext "."+ ]+ , Paragraph+ [ Plaintext "To"+ , Whitespace+ , Plaintext "prevent"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "custom"+ , Whitespace+ , Plaintext "settings"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "being"+ , Whitespace+ , Plaintext "applied,"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Link "g:FerretQFOptions"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "0:"+ ]+ , Fenced [ "let g:FerretQFOptions=0" ]+ , OptionAnnotation "g:FerretQFMap" "boolean" (Just "1")+ , Paragraph+ [ Plaintext "Controls"+ , Whitespace+ , Plaintext "whether"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Plaintext "up"+ , Whitespace+ , Plaintext "mappings"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link "quickfix"+ , Whitespace+ , Plaintext "results"+ , Whitespace+ , Plaintext "window"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "deleting"+ , Whitespace+ , Plaintext "results."+ , Whitespace+ , Plaintext "The"+ , Whitespace+ , Plaintext "mappings"+ , Whitespace+ , Plaintext "include:"+ ]+ , List+ [ ListItem+ [ Code "d"+ , Whitespace+ , Plaintext "("+ , Link "visual-mode"+ , Plaintext "):"+ , Whitespace+ , Plaintext "delete"+ , Whitespace+ , Plaintext "visual"+ , Whitespace+ , Plaintext "selection"+ ]+ , ListItem+ [ Code "dd"+ , Whitespace+ , Plaintext "("+ , Link "Normal-mode"+ , Plaintext "):"+ , Whitespace+ , Plaintext "delete"+ , Whitespace+ , Plaintext "current"+ , Whitespace+ , Plaintext "line"+ ]+ , ListItem+ [ Code "d"+ , Plaintext "{motion}"+ , Whitespace+ , Plaintext "("+ , Link "Normal-mode"+ , Plaintext "):"+ , Whitespace+ , Plaintext "delete"+ , Whitespace+ , Plaintext "range"+ , Whitespace+ , Plaintext "indicated"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "{motion}"+ ]+ ]+ , Paragraph+ [ Plaintext "To"+ , Whitespace+ , Plaintext "prevent"+ , Whitespace+ , Plaintext "these"+ , Whitespace+ , Plaintext "mappings"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "being"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Plaintext "up,"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "0:"+ ]+ , Fenced [ "let g:FerretQFMap=0" ]+ , OptionAnnotation "g:FerretLoaded" "any" Nothing+ , Paragraph+ [ Plaintext "To"+ , Whitespace+ , Plaintext "prevent"+ , Whitespace+ , Plaintext "Ferret"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "being"+ , Whitespace+ , Plaintext "loaded,"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Link "g:FerretLoaded"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "any"+ , Whitespace+ , Plaintext "value"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "your"+ , Whitespace+ , Link ".vimrc"+ , Plaintext "."+ , Whitespace+ , Plaintext "For"+ , Whitespace+ , Plaintext "example:"+ ]+ , Fenced [ "let g:FerretLoaded=1" ]+ , OptionAnnotation "g:FerretMap" "boolean" (Just "1")+ , Paragraph+ [ Plaintext "Controls"+ , Whitespace+ , Plaintext "whether"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Plaintext "up"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "Ferret"+ , Whitespace+ , Plaintext "mappings,"+ , Whitespace+ , Plaintext "such"+ , Whitespace+ , Plaintext "as"+ , Whitespace+ , Link "<Plug>(FerretAck)"+ , Whitespace+ , Plaintext "(see"+ , Whitespace+ , Link "ferret-mappings"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "full"+ , Whitespace+ , Plaintext "list)."+ , Whitespace+ , Plaintext "To"+ , Whitespace+ , Plaintext "prevent"+ , Whitespace+ , Plaintext "any"+ , Whitespace+ , Plaintext "mapping"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "being"+ , Whitespace+ , Plaintext "configured,"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "0:"+ ]+ , Fenced [ "let g:FerretMap=0" ]+ , OptionAnnotation "g:FerretQFCommands" "boolean" (Just "1")+ , Paragraph+ [ Plaintext "Controls"+ , Whitespace+ , Plaintext "whether"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Plaintext "up"+ , Whitespace+ , Plaintext "custom"+ , Whitespace+ , Plaintext "versions"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link "quickfix"+ , Whitespace+ , Plaintext "commands,"+ , Whitespace+ , Link ":cn"+ , Plaintext ","+ , Whitespace+ , Link ":cnf"+ , Plaintext ","+ , Whitespace+ , Link ":cp"+ , Whitespace+ , Plaintext "an"+ , Whitespace+ , Link ":cpf"+ , Plaintext "."+ , Whitespace+ , Plaintext "These"+ , Whitespace+ , Plaintext "overrides"+ , Whitespace+ , Plaintext "vertically"+ , Whitespace+ , Plaintext "center"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "match"+ , Whitespace+ , Plaintext "within"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "viewport"+ , Whitespace+ , Plaintext "on"+ , Whitespace+ , Plaintext "each"+ , Whitespace+ , Plaintext "jump."+ , Whitespace+ , Plaintext "To"+ , Whitespace+ , Plaintext "prevent"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "custom"+ , Whitespace+ , Plaintext "versions"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "being"+ , Whitespace+ , Plaintext "configured,"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "0:"+ ]+ , Fenced [ "let g:FerretQFCommands=0" ]+ , FooterAnnotation+ , HeadingAnnotation "Custom autocommands"+ , LinkTargets [ "FerretWillWrite" , "FerretDidWrite" ]+ , Paragraph+ [ Plaintext "For"+ , Whitespace+ , Plaintext "maximum"+ , Whitespace+ , Plaintext "compatibility"+ , Whitespace+ , Plaintext "with"+ , Whitespace+ , Plaintext "other"+ , Whitespace+ , Plaintext "plug-ins,"+ , Whitespace+ , Plaintext "Ferret"+ , Whitespace+ , Plaintext "runs"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "following"+ , Whitespace+ , Plaintext "\"User\""+ , Whitespace+ , Plaintext "autocommands"+ , Whitespace+ , Plaintext "before"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "after"+ , Whitespace+ , Plaintext "running"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "file"+ , Whitespace+ , Plaintext "writing"+ , Whitespace+ , Plaintext "operations"+ , Whitespace+ , Plaintext "during"+ , Whitespace+ , Link ":Acks"+ , Plaintext ":"+ ]+ , List+ [ ListItem [ Plaintext "FerretWillWrite" ]+ , ListItem [ Plaintext "FerretDidWrite" ]+ ]+ , Paragraph+ [ Plaintext "For"+ , Whitespace+ , Plaintext "example,"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "call"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "pair"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "custom"+ , Whitespace+ , Plaintext "functions"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "response"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "these"+ , Whitespace+ , Plaintext "events,"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "might"+ , Whitespace+ , Plaintext "do:"+ ]+ , Fenced+ [ "autocmd! User FerretWillWrite"+ , "autocmd User FerretWillWrite call CustomWillWrite()"+ , "autocmd! User FerretDidWrite"+ , "autocmd User FerretDidWrite call CustomDidWrite()"+ ]+ , HeadingAnnotation "Overrides"+ , Paragraph+ [ Plaintext "Ferret"+ , Whitespace+ , Plaintext "overrides"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "'grepformat'"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "'grepprg'"+ , Whitespace+ , Plaintext "settings,"+ , Whitespace+ , Plaintext "preferentially"+ , Whitespace+ , Plaintext "setting"+ , Whitespace+ , Code "ag"+ , Plaintext ","+ , Whitespace+ , Code "ack"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Code "grep"+ , Whitespace+ , Plaintext "as"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "'grepprg'"+ , Whitespace+ , Plaintext "(in"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "order)"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "configuring"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "suitable"+ , Whitespace+ , Plaintext "'grepformat'."+ ]+ , Paragraph+ [ Plaintext "Additionally,"+ , Whitespace+ , Plaintext "Ferret"+ , Whitespace+ , Plaintext "includes"+ , Whitespace+ , Plaintext "an"+ , Whitespace+ , Link "ftplugin"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link "quickfix"+ , Whitespace+ , Plaintext "listing"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "adjusts"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "number"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "settings"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "improve"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "usability"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "results."+ ]+ , IndentAnnotation+ , LinkTargets [ "ferret-nolist" ]+ , Paragraph [ Plaintext "'nolist'" ]+ , Paragraph+ [ Plaintext "Turned"+ , Whitespace+ , Plaintext "off"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "reduce"+ , Whitespace+ , Plaintext "visual"+ , Whitespace+ , Plaintext "clutter"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "results,"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "because"+ , Whitespace+ , Plaintext "'list'"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "most"+ , Whitespace+ , Plaintext "useful"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "files"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "are"+ , Whitespace+ , Plaintext "being"+ , Whitespace+ , Plaintext "actively"+ , Whitespace+ , Plaintext "edited,"+ , Whitespace+ , Plaintext "which"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "not"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "case"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Link "quickfix"+ , Whitespace+ , Plaintext "results."+ ]+ , LinkTargets [ "ferret-norelativenumber" ]+ , Paragraph [ Plaintext "'norelativenumber'" ]+ , Paragraph+ [ Plaintext "Turned"+ , Whitespace+ , Plaintext "off,"+ , Whitespace+ , Plaintext "because"+ , Whitespace+ , Plaintext "it"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "more"+ , Whitespace+ , Plaintext "useful"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "have"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "sense"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "absolute"+ , Whitespace+ , Plaintext "progress"+ , Whitespace+ , Plaintext "through"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "results"+ , Whitespace+ , Plaintext "list"+ , Whitespace+ , Plaintext "than"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "have"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "ability"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "jump"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "nearby"+ , Whitespace+ , Plaintext "results"+ , Whitespace+ , Plaintext "(especially"+ , Whitespace+ , Plaintext "seeing"+ , Whitespace+ , Plaintext "as"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "most"+ , Whitespace+ , Plaintext "common"+ , Whitespace+ , Plaintext "operations"+ , Whitespace+ , Plaintext "are"+ , Whitespace+ , Plaintext "moving"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "next"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Plaintext "previous"+ , Whitespace+ , Plaintext "file,"+ , Whitespace+ , Plaintext "which"+ , Whitespace+ , Plaintext "are"+ , Whitespace+ , Plaintext "both"+ , Whitespace+ , Plaintext "handled"+ , Whitespace+ , Plaintext "nicely"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Link ":cnf"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Link ":cpf"+ , Whitespace+ , Plaintext "respectively)."+ ]+ , LinkTargets [ "ferret-nowrap" ]+ , Paragraph [ Plaintext "'nowrap'" ]+ , Paragraph+ [ Plaintext "Turned"+ , Whitespace+ , Plaintext "off"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "avoid"+ , Whitespace+ , Plaintext "ugly"+ , Whitespace+ , Plaintext "wrapping"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "makes"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "results"+ , Whitespace+ , Plaintext "list"+ , Whitespace+ , Plaintext "hard"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "read,"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "because"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "results,"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "most"+ , Whitespace+ , Plaintext "relevant"+ , Whitespace+ , Plaintext "information"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "filename,"+ , Whitespace+ , Plaintext "which"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "on"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "left"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "usually"+ , Whitespace+ , Plaintext "visible"+ , Whitespace+ , Plaintext "even"+ , Whitespace+ , Plaintext "without"+ , Whitespace+ , Plaintext "wrapping."+ ]+ , LinkTargets [ "ferret-number" ]+ , Paragraph [ Plaintext "'number'" ]+ , Paragraph+ [ Plaintext "Turned"+ , Whitespace+ , Plaintext "on"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "give"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "sense"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "absolute"+ , Whitespace+ , Plaintext "progress"+ , Whitespace+ , Plaintext "through"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "results."+ ]+ , LinkTargets [ "ferret-scrolloff" ]+ , Paragraph [ Plaintext "'scrolloff'" ]+ , Paragraph+ [ Plaintext "Set"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "0"+ , Whitespace+ , Plaintext "because"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link "quickfix"+ , Whitespace+ , Plaintext "listing"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "usually"+ , Whitespace+ , Plaintext "small"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "default,"+ , Whitespace+ , Plaintext "so"+ , Whitespace+ , Plaintext "trying"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "keep"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "current"+ , Whitespace+ , Plaintext "line"+ , Whitespace+ , Plaintext "away"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "edge"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "viewpoint"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "futile;"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "definition"+ , Whitespace+ , Plaintext "it"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "usually"+ , Whitespace+ , Plaintext "near"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "edge."+ ]+ , LinkTargets [ "ferret-nocursorline" ]+ , Paragraph [ Plaintext "'nocursorline'" ]+ , Paragraph+ [ Plaintext "Turned"+ , Whitespace+ , Plaintext "off"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "reduce"+ , Whitespace+ , Plaintext "visual"+ , Whitespace+ , Plaintext "clutter."+ ]+ , DedentAnnotation+ , Paragraph+ [ Plaintext "To"+ , Whitespace+ , Plaintext "prevent"+ , Whitespace+ , Plaintext "any"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "these"+ , Whitespace+ , Link "quickfix"+ , Plaintext "-specific"+ , Whitespace+ , Plaintext "overrides"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "being"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Plaintext "up,"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Link "g:FerretQFOptions"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "0"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "your"+ , Whitespace+ , Link ".vimrc"+ , Plaintext ":"+ ]+ , Fenced [ "let g:FerretQFOptions=0" ]+ , HeadingAnnotation "Troubleshooting"+ , LinkTargets [ "ferret-quotes" ]+ , SubheadingAnnotation+ "Ferret fails to find patterns containing spaces"+ , Paragraph+ [ Plaintext "As"+ , Whitespace+ , Plaintext "described"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "documentation"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Link ":Ack"+ , Plaintext ","+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "pattern"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "passed"+ , Whitespace+ , Plaintext "through"+ , Whitespace+ , Plaintext "as-is"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "underlying"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "command,"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "no"+ , Whitespace+ , Plaintext "escaping"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "required"+ , Whitespace+ , Plaintext "other"+ , Whitespace+ , Plaintext "than"+ , Whitespace+ , Plaintext "preceding"+ , Whitespace+ , Plaintext "spaces"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "single"+ , Whitespace+ , Plaintext "backslash."+ ]+ , Paragraph+ [ Plaintext "So,"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "find"+ , Whitespace+ , Plaintext "\"foo"+ , Whitespace+ , Plaintext "bar\","+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "would"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "like:"+ ]+ , Fenced [ ":Ack foo\\ bar" ]+ , Paragraph+ [ Plaintext "Unescaped"+ , Whitespace+ , Plaintext "spaces"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "are"+ , Whitespace+ , Plaintext "treated"+ , Whitespace+ , Plaintext "as"+ , Whitespace+ , Plaintext "argument"+ , Whitespace+ , Plaintext "separators,"+ , Whitespace+ , Plaintext "so"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "command"+ , Whitespace+ , Plaintext "like"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "following"+ , Whitespace+ , Plaintext "means"+ , Whitespace+ , Plaintext "pass"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Code "-w"+ , Whitespace+ , Plaintext "option"+ , Whitespace+ , Plaintext "through,"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "pattern"+ , Whitespace+ , Plaintext "\"foo\","+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "limit"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "\"bar\""+ , Whitespace+ , Plaintext "directory:"+ ]+ , Fenced [ ":Ack -w foo bar" ]+ , Paragraph+ [ Plaintext "Note"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "including"+ , Whitespace+ , Plaintext "quotes"+ , Whitespace+ , Plaintext "will"+ , Whitespace+ , Plaintext "not"+ , Whitespace+ , Plaintext "do"+ , Whitespace+ , Plaintext "what"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "intend."+ ]+ , Fenced+ [ " \" Search for '\"foo' in the 'bar\"' directory:"+ , " :Ack \"foo bar\""+ , ""+ , " \" Search for \"'foo' in the \"bar'\" directory:"+ , " :Ack 'foo bar'"+ ]+ , Paragraph+ [ Plaintext "This"+ , Whitespace+ , Plaintext "approach"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "escaping"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "taken"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "order"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "make"+ , Whitespace+ , Plaintext "it"+ , Whitespace+ , Plaintext "straightfoward"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "use"+ , Whitespace+ , Plaintext "powerful"+ , Whitespace+ , Plaintext "Perl-compatible"+ , Whitespace+ , Plaintext "regular"+ , Whitespace+ , Plaintext "expression"+ , Whitespace+ , Plaintext "syntax"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "an"+ , Whitespace+ , Plaintext "unambiguous"+ , Whitespace+ , Plaintext "way"+ , Whitespace+ , Plaintext "without"+ , Whitespace+ , Plaintext "having"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "worry"+ , Whitespace+ , Plaintext "about"+ , Whitespace+ , Plaintext "shell"+ , Whitespace+ , Plaintext "escaping"+ , Whitespace+ , Plaintext "rules:"+ ]+ , Fenced+ [ ":Ack \\blog\\((['\"]).*?\\1\\) -i --ignore-dir=src/vendor src dist build"+ ]+ , HeadingAnnotation "FAQ"+ , SubheadingAnnotation+ "Why do Ferret commands start with \"Ack\", \"Lack\" and so on?"+ , Paragraph+ [ Plaintext "Ferret"+ , Whitespace+ , Plaintext "was"+ , Whitespace+ , Plaintext "originally"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "thinnest"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "wrappers"+ , Whitespace+ , Plaintext "(7"+ , Whitespace+ , Plaintext "lines"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "code"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "my"+ , Whitespace+ , Link ".vimrc"+ , Plaintext ")"+ , Whitespace+ , Plaintext "around"+ , Whitespace+ , Code "ack"+ , Plaintext "."+ , Whitespace+ , Plaintext "The"+ , Whitespace+ , Plaintext "earliest"+ , Whitespace+ , Plaintext "traces"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "it"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "be"+ , Whitespace+ , Plaintext "seen"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "initial"+ , Whitespace+ , Plaintext "commit"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "my"+ , Whitespace+ , Plaintext "dotfiles"+ , Whitespace+ , Plaintext "repo"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "May,"+ , Whitespace+ , Plaintext "2009"+ , Whitespace+ , Plaintext "(https://wt.pe/h)."+ ]+ , Paragraph+ [ Plaintext "So,"+ , Whitespace+ , Plaintext "even"+ , Whitespace+ , Plaintext "though"+ , Whitespace+ , Plaintext "Ferret"+ , Whitespace+ , Plaintext "has"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "new"+ , Whitespace+ , Plaintext "name"+ , Whitespace+ , Plaintext "now"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "actually"+ , Whitespace+ , Plaintext "prefers"+ , Whitespace+ , Code "ag"+ , Whitespace+ , Plaintext "over"+ , Whitespace+ , Code "ack"+ , Whitespace+ , Plaintext "when"+ , Whitespace+ , Plaintext "available,"+ , Whitespace+ , Plaintext "I"+ , Whitespace+ , Plaintext "prefer"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "keep"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "command"+ , Whitespace+ , Plaintext "names"+ , Whitespace+ , Plaintext "intact"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "benefit"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "years"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "accumulated"+ , Whitespace+ , Plaintext "muscle-memory."+ ]+ , HeadingAnnotation "Related"+ , Paragraph+ [ Plaintext "Just"+ , Whitespace+ , Plaintext "as"+ , Whitespace+ , Plaintext "Ferret"+ , Whitespace+ , Plaintext "aims"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "improve"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "multi-file"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "replace"+ , Whitespace+ , Plaintext "experience,"+ , Whitespace+ , Plaintext "Loupe"+ , Whitespace+ , Plaintext "does"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "same"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "within-file"+ , Whitespace+ , Plaintext "searching:"+ ]+ , Paragraph [ Plaintext "https://github.com/wincent/loupe" ]+ , HeadingAnnotation "Website"+ , Paragraph+ [ Plaintext "The"+ , Whitespace+ , Plaintext "official"+ , Whitespace+ , Plaintext "Ferret"+ , Whitespace+ , Plaintext "source"+ , Whitespace+ , Plaintext "code"+ , Whitespace+ , Plaintext "repo"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "at:"+ ]+ , Paragraph [ Plaintext "http://git.wincent.com/ferret.git" ]+ , Paragraph+ [ Plaintext "A"+ , Whitespace+ , Plaintext "mirror"+ , Whitespace+ , Plaintext "exists"+ , Whitespace+ , Plaintext "at:"+ ]+ , Paragraph [ Plaintext "https://github.com/wincent/ferret" ]+ , Paragraph+ [ Plaintext "Official"+ , Whitespace+ , Plaintext "releases"+ , Whitespace+ , Plaintext "are"+ , Whitespace+ , Plaintext "listed"+ , Whitespace+ , Plaintext "at:"+ ]+ , Paragraph+ [ Plaintext "http://www.vim.org/scripts/script.php?script_id=5220"+ ]+ , HeadingAnnotation "License"+ , Paragraph+ [ Plaintext "Copyright"+ , Whitespace+ , Plaintext "2015-present"+ , Whitespace+ , Plaintext "Greg"+ , Whitespace+ , Plaintext "Hurrell."+ , Whitespace+ , Plaintext "All"+ , Whitespace+ , Plaintext "rights"+ , Whitespace+ , Plaintext "reserved."+ ]+ , Paragraph+ [ Plaintext "Redistribution"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "use"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "source"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "binary"+ , Whitespace+ , Plaintext "forms,"+ , Whitespace+ , Plaintext "with"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Plaintext "without"+ , Whitespace+ , Plaintext "modification,"+ , Whitespace+ , Plaintext "are"+ , Whitespace+ , Plaintext "permitted"+ , Whitespace+ , Plaintext "provided"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "following"+ , Whitespace+ , Plaintext "conditions"+ , Whitespace+ , Plaintext "are"+ , Whitespace+ , Plaintext "met:"+ ]+ , Paragraph+ [ Plaintext "1."+ , Whitespace+ , Plaintext "Redistributions"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "source"+ , Whitespace+ , Plaintext "code"+ , Whitespace+ , Plaintext "must"+ , Whitespace+ , Plaintext "retain"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "above"+ , Whitespace+ , Plaintext "copyright"+ , Whitespace+ , Plaintext "notice,"+ , Whitespace+ , Plaintext "this"+ , Whitespace+ , Plaintext "list"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "conditions"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "following"+ , Whitespace+ , Plaintext "disclaimer."+ ]+ , Paragraph+ [ Plaintext "2."+ , Whitespace+ , Plaintext "Redistributions"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "binary"+ , Whitespace+ , Plaintext "form"+ , Whitespace+ , Plaintext "must"+ , Whitespace+ , Plaintext "reproduce"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "above"+ , Whitespace+ , Plaintext "copyright"+ , Whitespace+ , Plaintext "notice,"+ , Whitespace+ , Plaintext "this"+ , Whitespace+ , Plaintext "list"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "conditions"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "following"+ , Whitespace+ , Plaintext "disclaimer"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "documentation"+ , Whitespace+ , Plaintext "and/or"+ , Whitespace+ , Plaintext "other"+ , Whitespace+ , Plaintext "materials"+ , Whitespace+ , Plaintext "provided"+ , Whitespace+ , Plaintext "with"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "distribution."+ ]+ , Paragraph+ [ Plaintext "THIS"+ , Whitespace+ , Plaintext "SOFTWARE"+ , Whitespace+ , Plaintext "IS"+ , Whitespace+ , Plaintext "PROVIDED"+ , Whitespace+ , Plaintext "BY"+ , Whitespace+ , Plaintext "THE"+ , Whitespace+ , Plaintext "COPYRIGHT"+ , Whitespace+ , Plaintext "HOLDERS"+ , Whitespace+ , Plaintext "AND"+ , Whitespace+ , Plaintext "CONTRIBUTORS"+ , Whitespace+ , Plaintext "\"AS"+ , Whitespace+ , Plaintext "IS\""+ , Whitespace+ , Plaintext "AND"+ , Whitespace+ , Plaintext "ANY"+ , Whitespace+ , Plaintext "EXPRESS"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "IMPLIED"+ , Whitespace+ , Plaintext "WARRANTIES,"+ , Whitespace+ , Plaintext "INCLUDING,"+ , Whitespace+ , Plaintext "BUT"+ , Whitespace+ , Plaintext "NOT"+ , Whitespace+ , Plaintext "LIMITED"+ , Whitespace+ , Plaintext "TO,"+ , Whitespace+ , Plaintext "THE"+ , Whitespace+ , Plaintext "IMPLIED"+ , Whitespace+ , Plaintext "WARRANTIES"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "MERCHANTABILITY"+ , Whitespace+ , Plaintext "AND"+ , Whitespace+ , Plaintext "FITNESS"+ , Whitespace+ , Plaintext "FOR"+ , Whitespace+ , Plaintext "A"+ , Whitespace+ , Plaintext "PARTICULAR"+ , Whitespace+ , Plaintext "PURPOSE"+ , Whitespace+ , Plaintext "ARE"+ , Whitespace+ , Plaintext "DISCLAIMED."+ , Whitespace+ , Plaintext "IN"+ , Whitespace+ , Plaintext "NO"+ , Whitespace+ , Plaintext "EVENT"+ , Whitespace+ , Plaintext "SHALL"+ , Whitespace+ , Plaintext "THE"+ , Whitespace+ , Plaintext "COPYRIGHT"+ , Whitespace+ , Plaintext "HOLDERS"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "CONTRIBUTORS"+ , Whitespace+ , Plaintext "BE"+ , Whitespace+ , Plaintext "LIABLE"+ , Whitespace+ , Plaintext "FOR"+ , Whitespace+ , Plaintext "ANY"+ , Whitespace+ , Plaintext "DIRECT,"+ , Whitespace+ , Plaintext "INDIRECT,"+ , Whitespace+ , Plaintext "INCIDENTAL,"+ , Whitespace+ , Plaintext "SPECIAL,"+ , Whitespace+ , Plaintext "EXEMPLARY,"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "CONSEQUENTIAL"+ , Whitespace+ , Plaintext "DAMAGES"+ , Whitespace+ , Plaintext "(INCLUDING,"+ , Whitespace+ , Plaintext "BUT"+ , Whitespace+ , Plaintext "NOT"+ , Whitespace+ , Plaintext "LIMITED"+ , Whitespace+ , Plaintext "TO,"+ , Whitespace+ , Plaintext "PROCUREMENT"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "SUBSTITUTE"+ , Whitespace+ , Plaintext "GOODS"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "SERVICES;"+ , Whitespace+ , Plaintext "LOSS"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "USE,"+ , Whitespace+ , Plaintext "DATA,"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "PROFITS;"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "BUSINESS"+ , Whitespace+ , Plaintext "INTERRUPTION)"+ , Whitespace+ , Plaintext "HOWEVER"+ , Whitespace+ , Plaintext "CAUSED"+ , Whitespace+ , Plaintext "AND"+ , Whitespace+ , Plaintext "ON"+ , Whitespace+ , Plaintext "ANY"+ , Whitespace+ , Plaintext "THEORY"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "LIABILITY,"+ , Whitespace+ , Plaintext "WHETHER"+ , Whitespace+ , Plaintext "IN"+ , Whitespace+ , Plaintext "CONTRACT,"+ , Whitespace+ , Plaintext "STRICT"+ , Whitespace+ , Plaintext "LIABILITY,"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "TORT"+ , Whitespace+ , Plaintext "(INCLUDING"+ , Whitespace+ , Plaintext "NEGLIGENCE"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "OTHERWISE)"+ , Whitespace+ , Plaintext "ARISING"+ , Whitespace+ , Plaintext "IN"+ , Whitespace+ , Plaintext "ANY"+ , Whitespace+ , Plaintext "WAY"+ , Whitespace+ , Plaintext "OUT"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "THE"+ , Whitespace+ , Plaintext "USE"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "THIS"+ , Whitespace+ , Plaintext "SOFTWARE,"+ , Whitespace+ , Plaintext "EVEN"+ , Whitespace+ , Plaintext "IF"+ , Whitespace+ , Plaintext "ADVISED"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "THE"+ , Whitespace+ , Plaintext "POSSIBILITY"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "SUCH"+ , Whitespace+ , Plaintext "DAMAGE."+ ]+ , HeadingAnnotation "Development"+ , SubheadingAnnotation "Contributing patches"+ , Paragraph+ [ Plaintext "Patches"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "be"+ , Whitespace+ , Plaintext "sent"+ , Whitespace+ , Plaintext "via"+ , Whitespace+ , Plaintext "mail"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "greg@hurrell.net,"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Plaintext "as"+ , Whitespace+ , Plaintext "GitHub"+ , Whitespace+ , Plaintext "pull"+ , Whitespace+ , Plaintext "requests"+ , Whitespace+ , Plaintext "at:"+ , Whitespace+ , Plaintext "https://github.com/wincent/ferret/pulls"+ ]+ , SubheadingAnnotation "Cutting a new release"+ , Paragraph+ [ Plaintext "At"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "moment"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "release"+ , Whitespace+ , Plaintext "process"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "manual:"+ ]+ , List+ [ ListItem+ [ Plaintext "Perform"+ , Whitespace+ , Plaintext "final"+ , Whitespace+ , Plaintext "sanity"+ , Whitespace+ , Plaintext "checks"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "manual"+ , Whitespace+ , Plaintext "testing"+ ]+ , ListItem+ [ Plaintext "Update"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link "ferret-history"+ , Whitespace+ , Plaintext "section"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "documentation"+ ]+ , ListItem+ [ Plaintext "Verify"+ , Whitespace+ , Plaintext "clean"+ , Whitespace+ , Plaintext "work"+ , Whitespace+ , Plaintext "tree:"+ ]+ ]+ , Fenced [ "git status" ]+ , List+ [ ListItem+ [ Plaintext "Tag"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "release:"+ ]+ ]+ , Fenced [ "git tag -s -m \"$VERSION release\" $VERSION" ]+ , List+ [ ListItem+ [ Plaintext "Publish"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "code:"+ ]+ ]+ , Fenced+ [ "git push origin master --follow-tags"+ , "git push github master --follow-tags"+ ]+ , List+ [ ListItem+ [ Plaintext "Produce"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "release"+ , Whitespace+ , Plaintext "archive:"+ ]+ ]+ , Fenced [ "git archive -o ferret-$VERSION.zip HEAD -- ." ]+ , List+ [ ListItem+ [ Plaintext "Upload"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "http://www.vim.org/scripts/script.php?script_id=5220"+ ]+ ]+ , HeadingAnnotation "Authors"+ , Paragraph+ [ Plaintext "Ferret"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "written"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "maintained"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "Greg"+ , Whitespace+ , Plaintext "Hurrell"+ , Whitespace+ , Plaintext "<greg@hurrell.net>."+ ]+ , Paragraph+ [ Plaintext "The"+ , Whitespace+ , Plaintext "idea"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "vim-dispatch"+ , Whitespace+ , Plaintext "integration"+ , Whitespace+ , Plaintext "was"+ , Whitespace+ , Plaintext "taken"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "Miles"+ , Whitespace+ , Plaintext "Sterrett's"+ , Whitespace+ , Plaintext "ack.vim"+ , Whitespace+ , Plaintext "plug-in"+ , Whitespace+ , Plaintext "(https://github.com/mileszs/ack.vim)."+ ]+ , Paragraph+ [ Plaintext "Other"+ , Whitespace+ , Plaintext "contributors"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "have"+ , Whitespace+ , Plaintext "submitted"+ , Whitespace+ , Plaintext "patches"+ , Whitespace+ , Plaintext "include"+ , Whitespace+ , Plaintext "(in"+ , Whitespace+ , Plaintext "alphabetical"+ , Whitespace+ , Plaintext "order):"+ ]+ , List+ [ ListItem [ Plaintext "Daniel" , Whitespace , Plaintext "Silva" ]+ , ListItem [ Plaintext "Joe" , Whitespace , Plaintext "Lencioni" ]+ , ListItem+ [ Plaintext "Nelo-Thara" , Whitespace , Plaintext "Wallus" ]+ , ListItem [ Plaintext "Vaibhav" , Whitespace , Plaintext "Sagar" ]+ ]+ , HeadingAnnotation "History"+ , SubheadingAnnotation "1.2a (16 May 2016)"+ , List+ [ ListItem+ [ Plaintext "Add"+ , Whitespace+ , Plaintext "optional"+ , Whitespace+ , Plaintext "support"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "running"+ , Whitespace+ , Plaintext "searches"+ , Whitespace+ , Plaintext "asynchronously"+ , Whitespace+ , Plaintext "using"+ , Whitespace+ , Plaintext "Vim's"+ , Whitespace+ , Link "+job"+ , Whitespace+ , Plaintext "feature"+ , Whitespace+ , Plaintext "(enabled"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "default"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "sufficiently"+ , Whitespace+ , Plaintext "recent"+ , Whitespace+ , Plaintext "versions"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "Vim);"+ , Whitespace+ , Plaintext "see"+ , Whitespace+ , Link "g:FerretJob"+ , Plaintext ","+ , Whitespace+ , Link ":FerretCancelAsync"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Link ":FerretPullAsync"+ , Plaintext "."+ ]+ ]+ , SubheadingAnnotation "1.1.1 (7 March 2016)"+ , List+ [ ListItem+ [ Plaintext "Fix"+ , Whitespace+ , Plaintext "another"+ , Whitespace+ , Plaintext "edge"+ , Whitespace+ , Plaintext "case"+ , Whitespace+ , Plaintext "when"+ , Whitespace+ , Plaintext "searching"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "patterns"+ , Whitespace+ , Plaintext "containing"+ , Whitespace+ , Plaintext "\"#\","+ , Whitespace+ , Plaintext "only"+ , Whitespace+ , Plaintext "manifesting"+ , Whitespace+ , Plaintext "under"+ , Whitespace+ , Plaintext "dispatch.vim."+ ]+ ]+ , SubheadingAnnotation "1.1 (7 March 2016)"+ , List+ [ ListItem+ [ Plaintext "Fix"+ , Whitespace+ , Plaintext "edge"+ , Whitespace+ , Plaintext "case"+ , Whitespace+ , Plaintext "when"+ , Whitespace+ , Plaintext "searching"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "strings"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "form"+ , Whitespace+ , Plaintext "\"<foo>\"."+ ]+ , ListItem+ [ Plaintext "Fix"+ , Whitespace+ , Plaintext "edge"+ , Whitespace+ , Plaintext "case"+ , Whitespace+ , Plaintext "when"+ , Whitespace+ , Plaintext "searching"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "patterns"+ , Whitespace+ , Plaintext "containing"+ , Whitespace+ , Plaintext "\"#\""+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "\"%\"."+ ]+ , ListItem+ [ Plaintext "Provide"+ , Whitespace+ , Plaintext "completion"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Code "ag"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Code "ack"+ , Whitespace+ , Plaintext "options"+ , Whitespace+ , Plaintext "when"+ , Whitespace+ , Plaintext "using"+ , Whitespace+ , Link ":Ack"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Link ":Lack"+ , Plaintext "."+ ]+ , ListItem+ [ Plaintext "Fix"+ , Whitespace+ , Plaintext "display"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "error"+ , Whitespace+ , Plaintext "messages"+ , Whitespace+ , Plaintext "under"+ , Whitespace+ , Plaintext "dispatch.vim."+ ]+ ]+ , SubheadingAnnotation "1.0 (28 December 2015)"+ , List+ [ ListItem+ [ Plaintext "Fix"+ , Whitespace+ , Plaintext "broken"+ , Whitespace+ , Link ":Qargs"+ , Whitespace+ , Plaintext "command"+ , Whitespace+ , Plaintext "(patch"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "Daniel"+ , Whitespace+ , Plaintext "Silva)."+ ]+ , ListItem+ [ Plaintext "Add"+ , Whitespace+ , Link "g:FerretQFHandler"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Link "g:FerretLLHandler"+ , Whitespace+ , Plaintext "options"+ , Whitespace+ , Plaintext "(patch"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "Daniel"+ , Whitespace+ , Plaintext "Silva)."+ ]+ , ListItem+ [ Plaintext "Make"+ , Whitespace+ , Link "<Plug>"+ , Whitespace+ , Plaintext "mappings"+ , Whitespace+ , Plaintext "accessible"+ , Whitespace+ , Plaintext "even"+ , Whitespace+ , Link "g:FerretMap"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "0."+ ]+ , ListItem+ [ Plaintext "Fix"+ , Whitespace+ , Plaintext "failure"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "report"+ , Whitespace+ , Plaintext "filename"+ , Whitespace+ , Plaintext "when"+ , Whitespace+ , Plaintext "using"+ , Whitespace+ , Code "ack"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "explicitly"+ , Whitespace+ , Plaintext "scoping"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "single"+ , Whitespace+ , Plaintext "file"+ , Whitespace+ , Plaintext "(patch"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "Daniel"+ , Whitespace+ , Plaintext "Silva)."+ ]+ , ListItem+ [ Plaintext "When"+ , Whitespace+ , Plaintext "using"+ , Whitespace+ , Code "ag"+ , Plaintext ","+ , Whitespace+ , Plaintext "report"+ , Whitespace+ , Plaintext "multiple"+ , Whitespace+ , Plaintext "matches"+ , Whitespace+ , Plaintext "per"+ , Whitespace+ , Plaintext "line"+ , Whitespace+ , Plaintext "instead"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "just"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "first"+ , Whitespace+ , Plaintext "(patch"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "Daniel"+ , Whitespace+ , Plaintext "Silva)."+ ]+ , ListItem+ [ Plaintext "Improve"+ , Whitespace+ , Plaintext "content"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "display"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "error"+ , Whitespace+ , Plaintext "messages."+ ]+ ]+ , SubheadingAnnotation "0.3 (24 July 2015)"+ , List+ [ ListItem+ [ Plaintext "Added"+ , Whitespace+ , Plaintext "highlighting"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "pattern"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "related"+ , Whitespace+ , Link "g:FerretHlsearch"+ , Whitespace+ , Plaintext "option"+ , Whitespace+ , Plaintext "(patch"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "Nelo-Thara"+ , Whitespace+ , Plaintext "Wallus)."+ ]+ , ListItem+ [ Plaintext "Add"+ , Whitespace+ , Plaintext "better"+ , Whitespace+ , Plaintext "error"+ , Whitespace+ , Plaintext "reporting"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "failed"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Plaintext "incorrect"+ , Whitespace+ , Plaintext "searches."+ ]+ ]+ , SubheadingAnnotation "0.2 (16 July 2015)"+ , List+ [ ListItem+ [ Plaintext "Added"+ , Whitespace+ , Link "FerretDidWrite"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Link "FerretWillWrite"+ , Whitespace+ , Plaintext "autocommands"+ , Whitespace+ , Plaintext "(patch"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "Joe"+ , Whitespace+ , Plaintext "Lencioni)."+ ]+ , ListItem+ [ Plaintext "Add"+ , Whitespace+ , Link "<Plug>(FerretAcks)"+ , Whitespace+ , Plaintext "mapping"+ , Whitespace+ , Plaintext "(patch"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "Nelo-Thara"+ , Whitespace+ , Plaintext "Wallus)."+ ]+ ]+ , SubheadingAnnotation "0.1 (8 July 2015)"+ , List+ [ ListItem+ [ Plaintext "Initial"+ , Whitespace+ , Plaintext "release,"+ , Whitespace+ , Plaintext "extracted"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "my"+ , Whitespace+ , Plaintext "dotfiles"+ , Whitespace+ , Plaintext "(https://github.com/wincent/wincent)."+ ]+ ]+ ]
+ tests/fixtures/integration/ferret/golden/markdown.golden view
@@ -0,0 +1,461 @@+# ferret<a name="ferret-ferret" href="#user-content-ferret-ferret"></a>++## Intro<a name="ferret-intro" href="#user-content-ferret-intro"></a>++> "ferret (verb)<br />(ferret something out) search tenaciously for and find something: she had the ability to ferret out the facts."++<p align="right"><a name="ferret-features" href="#user-content-ferret-features"><code>ferret-features</code></a></p>+Ferret improves Vim's multi-file search in four ways:++### 1. Powerful multi-file search<a name="ferret-1-powerful-multi-file-search" href="#user-content-ferret-1-powerful-multi-file-search"></a>++Ferret provides an <strong>[`:Ack`](#user-content-ack)</strong> command for searching across multiple files using The Silver Searcher (https://github.com/ggreer/the_silver_searcher), Ack (http://beyondgrep.com/), or Grep (http://www.gnu.org/software/grep/). Support for passing options through to the underlying search command exists, along with the ability to use full regular expression syntax without doing special escaping.++Shortcut mappings are provided to start an <strong>[`:Ack`](#user-content-ack)</strong> search (<leader>a) or to search for the word currently under the cursor (<leader>s).++Results are normally displayed in the <strong>`quickfix`</strong> window, but Ferret also provides a <strong>[`:Lack`](#user-content-lack)</strong> command that behaves like <strong>[`:Ack`](#user-content-ack)</strong> but uses the <strong>`location-list`</strong> instead, and a <leader>l mapping as a shortcut to <strong>[`:Lack`](#user-content-lack)</strong>.++Finally, Ferret offers integration with dispatch.vim (https://github.com/tpope/vim-dispatch), which enables asynchronous searching despite the fact that Vim itself is single-threaded.++### 2. Streamlined multi-file replace<a name="ferret-2-streamlined-multi-file-replace" href="#user-content-ferret-2-streamlined-multi-file-replace"></a>++The companion to <strong>[`:Ack`](#user-content-ack)</strong> is <strong>[`:Acks`](#user-content-acks)</strong> (mnemonic: "Ack substitute", accessible via shortcut <leader>r), which allows you to run a multi-file replace across all the files placed in the <strong>`quickfix`</strong> window by a previous invocation of <strong>[`:Ack`](#user-content-ack)</strong>.++### 3. Quickfix listing enhancements<a name="ferret-3-quickfix-listing-enhancements" href="#user-content-ferret-3-quickfix-listing-enhancements"></a>++The <strong>`quickfix`</strong> listing itself is enhanced with settings to improve its usability, and natural mappings that allow quick removal of items from the list (for example, you can reduce clutter in the listing by removing lines that you don't intend to make changes to).++Additionally, Vim's <strong>`:cn`</strong>, <strong>`:cp`</strong>, <strong>`:cnf`</strong> and <strong>`:cpf`</strong> commands are tweaked to make it easier to immediately identify matches by centering them within the viewport.++### 4. Easy operations on files in the quickfix listing<a name="ferret-4-easy-operations-on-files-in-the-quickfix-listing" href="#user-content-ferret-4-easy-operations-on-files-in-the-quickfix-listing"></a>++Finally, Ferret provides a <strong>[`:Qargs`](#user-content-qargs)</strong> command that puts the files currently in the <strong>`quickfix`</strong> listing into the <strong>`:args`</strong> list, where they can be operated on in bulk via the <strong>`:argdo`</strong> command. This is what's used under the covers by <strong>[`:Acks`](#user-content-acks)</strong> to do its work.++## Installation<a name="ferret-installation" href="#user-content-ferret-installation"></a>++To install Ferret, use your plug-in management system of choice.++If you don't have a "plug-in management system of choice", I recommend Pathogen (https://github.com/tpope/vim-pathogen) due to its simplicity and robustness. Assuming that you have Pathogen installed and configured, and that you want to install Ferret into `~/.vim/bundle`, you can do so with:++```+git clone https://github.com/wincent/ferret.git ~/.vim/bundle/ferret+```++Alternatively, if you use a Git submodule for each Vim plug-in, you could do the following after `cd`-ing into the top-level of your Git superproject:++```+git submodule add https://github.com/wincent/ferret.git ~/vim/bundle/ferret+git submodule init+```++To generate help tags under Pathogen, you can do so from inside Vim with:++```+:call pathogen#helptags()+```++## Commands<a name="ferret-commands" href="#user-content-ferret-commands"></a>++<p align="right"><a name="ack" href="#user-content-ack"><code>:Ack</code></a></p>+### `:Ack {pattern} {options}`<a name="ferret-ack-pattern-options" href="#user-content-ferret-ack-pattern-options"></a>++Searches for {pattern} in all the files under the current directory (see <strong>`:pwd`</strong>), unless otherwise overridden via {options}, and displays the results in the <strong>`quickfix`</strong> listing.++`ag` (The Silver Searcher) will be used preferentially if present on the system, because it is faster, falling back to `ack` and then `grep` as needed.++If dispatch.vim is installed the search process will run asynchronously via the <strong>`:Make`</strong> command, otherwise it will be run synchronously via <strong>`:cexpr`</strong>. Asynchronous searches are preferred because they do not block, despite the fact that Vim itself is single threaded. The <strong>`g:FerretDispatch`</strong> option can be used to prevent the use of dispatch.vim.++The {pattern} is passed through as-is to the underlying search program, and no escaping is required other than preceding spaces by a single backslash. For example, to search for "\bfoo[0-9]{2} bar\b" (ie. using `ag`'s Perl-style regular expression syntax), you could do:++```+:Ack \bfoo[0-9]{2}\ bar\b+```++Likewise, {options} are passed through. In this example, we pass the `-w` option (to search on word boundaries), and scope the search to the "foo" and "bar" subdirectories: >++```+:Ack -w something foo bar+```++As a convenience <leader>a is set-up (<strong>[`<Plug>(FerretAck)`](#user-content-plugferretack)</strong>) as a shortcut to enter <strong>`Cmdline-mode`</strong> with `:Ack` inserted on the <strong>`Cmdline`</strong>. Likewise <leader>s (<strong>[`<Plug>(FerretAckWord)`](#user-content-plugferretackword)</strong>) is a shortcut for running <strong>[`:Ack`](#user-content-ack)</strong> with the word currently under the cursor.++<p align="right"><a name="lack" href="#user-content-lack"><code>:Lack</code></a></p>+### `:Lack {pattern} {options}`<a name="ferret-lack-pattern-options" href="#user-content-ferret-lack-pattern-options"></a>++Just like <strong>[`:Ack`](#user-content-ack)</strong>, but instead of using the <strong>`quickfix`</strong> listing, which is global across an entire Vim instance, it uses the <strong>`location-list`</strong>, which is a per-window construct.++Note that <strong>[`:Lack`](#user-content-lack)</strong> always runs synchronously via <strong>`:cexpr`</strong>, because dispatch.vim doesn't currently support the <strong>`location-list`</strong>.++<p align="right"><a name="acks" href="#user-content-acks"><code>:Acks</code></a></p>+### `:Acks /{pattern}/{replacement}/`<a name="ferret-acks-patternreplacement" href="#user-content-ferret-acks-patternreplacement"></a>++Takes all of the files currently in the <strong>`quickfix`</strong> listing and performs a substitution of all instances of {pattern} (a standard Vim search <strong>`pattern`</strong>) by {replacement}.++A typical sequence consists of an <strong>[`:Ack`](#user-content-ack)</strong> invocation to populate the <strong>`quickfix`</strong> listing and then <strong>[`:Acks`](#user-content-acks)</strong> (mnemonic: "Ack substitute") to perform replacements. For example, to replace "foo" with "bar" across all files in the current directory:++```+:Ack foo+:Acks /foo/bar/+```++<p align="right"><a name="qargs" href="#user-content-qargs"><code>:Qargs</code></a></p>+### `:Qargs`<a name="ferret-qargs" href="#user-content-ferret-qargs"></a>++This is a utility function that is used by the <strong>[`:Acks`](#user-content-acks)</strong> command but is also generally useful enough to warrant being exposed publicly.++It takes the files currently in the <strong>`quickfix`</strong> listing and sets them as <strong>`:args`</strong> so that they can be operated on en masse via the <strong>`:argdo`</strong> command.++## Mappings<a name="ferret-mappings" href="#user-content-ferret-mappings"></a>++### Circumstances where mappings do not get set up<a name="ferret-circumstances-where-mappings-do-not-get-set-up" href="#user-content-ferret-circumstances-where-mappings-do-not-get-set-up"></a>++Note that Ferret will not try to set up the <leader> mappings if any of the following are true:++- A mapping for already exists.+- An alternative mapping for the same functionality has already been set up from a <strong>`.vimrc`</strong>.+- The mapping has been suppressed by setting <strong>`g:FerretMap`</strong> to 1 in your <strong>`.vimrc`</strong>.++### Mappings specific to the quickfix window<a name="ferret-mappings-specific-to-the-quickfix-window" href="#user-content-ferret-mappings-specific-to-the-quickfix-window"></a>++Additionally, Ferret will set up special mappings in <strong>`quickfix`</strong> listings, unless prevented from doing so by <strong>`g:FerretQFMap`</strong>:++- `d` (<strong>`visual-mode`</strong>): delete visual selection+- `dd` (<strong>`Normal-mode`</strong>): delete current line+- `d`{motion} (<strong>`Normal-mode`</strong>): delete range indicated by {motion}++### `<Plug>(FerretAck)`<a name="ferret-plugferretack" href="#user-content-ferret-plugferretack"></a>++Ferret maps <leader>a to <strong>[`<Plug>(FerretAck)`](#user-content-plugferretack)</strong>, which triggers the <strong>[`:Ack`](#user-content-ack)</strong> command. To use an alternative mapping instead, create a different one in your <strong>`.vimrc`</strong> instead using <strong>`:nmap`</strong>:++```+" Instead of <leader>a, use <leader>x.+nmap <leader>x <Plug>(FerretAck)+```++### `<Plug>(FerretLack)`<a name="ferret-plugferretlack" href="#user-content-ferret-plugferretlack"></a>++Ferret maps <leader>l to <strong>[`<Plug>(FerretLack)`](#user-content-plugferretlack)</strong>, which triggers the <strong>[`:Lack`](#user-content-lack)</strong> command. To use an alternative mapping instead, create a different one in your <strong>`.vimrc`</strong> instead using <strong>`:nmap`</strong>:++```+" Instead of <leader>l, use <leader>y.+nmap <leader>y <Plug>(FerretLack)+```++### `<Plug>(FerretAckWord)`<a name="ferret-plugferretackword" href="#user-content-ferret-plugferretackword"></a>++Ferret maps <leader>s (mnemonix: "selection) to <strong>[`<Plug>(FerretAckWord)`](#user-content-plugferretackword)</strong>, which uses <strong>[`:Ack`](#user-content-ack)</strong> to search for the word currently under the cursor. To use an alternative mapping instead, create a different one in your <strong>`.vimrc`</strong> instead using <strong>`:nmap`</strong>:++```+" Instead of <leader>s, use <leader>z.+nmap <leader>z <Plug>(FerretAckWord)+```++### `<Plug>(FerretAcks)`<a name="ferret-plugferretacks" href="#user-content-ferret-plugferretacks"></a>++Ferret maps <leader>r (mnemonic: "replace") to <strong>[`<Plug>(FerretAcks)`](#user-content-plugferretacks)</strong>, which triggers the <strong>[`:Acks`](#user-content-acks)</strong> command and fills the prompt with the last search term from Ferret. to use an alternative mapping instead, create a different one in your <strong>`.vimrc`</strong> instead using <strong>`:nmap`</strong>:++```+" Instead of <leader>r, use <leader>u.+nmap <leader>u <Plug>(FerretAcks)+```++## Options<a name="ferret-options" href="#user-content-ferret-options"></a>++<p align="right"><a name="gferretdispatch" href="#user-content-gferretdispatch"><code>g:FerretDispatch</code></a></p>+### `g:FerretDispatch` (boolean, default: 1)<a name="ferret-gferretdispatch-boolean-default-1" href="#user-content-ferret-gferretdispatch-boolean-default-1"></a>++Controls whether to use vim-dispatch (and specifically, <strong>`:Make`</strong>) to run <strong>[`:Ack`](#user-content-ack)</strong> searches asynchronously, when available. To prevent vim-dispatch from being used, set to 0:++```+let g:FerretDispatch=0+```++<p align="right"><a name="gferrethlsearch" href="#user-content-gferrethlsearch"><code>g:FerretHlsearch</code></a></p>+### `g:FerretHlsearch` (boolean, default: none)<a name="ferret-gferrethlsearch-boolean-default-none" href="#user-content-ferret-gferrethlsearch-boolean-default-none"></a>++Controls whether Ferret should attempt to highlight the search pattern when running <strong>[`:Ack`](#user-content-ack)</strong> or <strong>[`:Lack`](#user-content-lack)</strong>. If left unset, Ferret will respect the current 'hlsearch' setting. To force highlighting on or off irrespective of 'hlsearch', set <strong>`g:FerretHlsearch`</strong> to 1 (on) or 0 (off):++```+let g:FerretHlsearch=0+```++<p align="right"><a name="gferretqfoptions" href="#user-content-gferretqfoptions"><code>g:FerretQFOptions</code></a></p>+### `g:FerretQFOptions` (boolean, default: 1)<a name="ferret-gferretqfoptions-boolean-default-1" href="#user-content-ferret-gferretqfoptions-boolean-default-1"></a>++Controls whether to set up setting overrides for <strong>`quickfix`</strong> windows. These are various settings, such as <strong>`norelativenumber`</strong>, <strong>`nolist`</strong> and <strong>`nowrap`</strong>, that are intended to make the <strong>`quickfix`</strong> window, which is typically very small relative to other windows, more usable.++A full list of overridden settings can be found in <strong>[`ferret-overrides`](#user-content-ferret-overrides)</strong>.++To prevent the custom settings from being applied, set <strong>`g:FerretQFOptions`</strong> to 0:++```+let g:FerretQFOptions=0+```++<p align="right"><a name="gferretqfmap" href="#user-content-gferretqfmap"><code>g:FerretQFMap</code></a></p>+### `g:FerretQFMap` (boolean, default: 1)<a name="ferret-gferretqfmap-boolean-default-1" href="#user-content-ferret-gferretqfmap-boolean-default-1"></a>++Controls whether to set up mappings in the <strong>`quickfix`</strong> results window for deleting results. The mappings include:++- `d` (<strong>`visual-mode`</strong>): delete visual selection+- `dd` (<strong>`Normal-mode`</strong>): delete current line+- `d`{motion} (<strong>`Normal-mode`</strong>): delete range indicated by {motion}++To prevent these mappings from being set up, set to 0:++```+let g:FerretQFMap=0+```++<p align="right"><a name="gferretloaded" href="#user-content-gferretloaded"><code>g:FerretLoaded</code></a></p>+### `g:FerretLoaded` (any, default: none)<a name="ferret-gferretloaded-any-default-none" href="#user-content-ferret-gferretloaded-any-default-none"></a>++To prevent Ferret from being loaded, set <strong>`g:FerretLoaded`</strong> to any value in your <strong>`.vimrc`</strong>. For example:++```+let g:FerretLoaded=1+```++<p align="right"><a name="gferretmap" href="#user-content-gferretmap"><code>g:FerretMap</code></a></p>+### `g:FerretMap` (boolean, default: 1)<a name="ferret-gferretmap-boolean-default-1" href="#user-content-ferret-gferretmap-boolean-default-1"></a>++Controls whether to set up the Ferret mappings, such as <strong>[`<Plug>(FerretAck)`](#user-content-plugferretack)</strong> (see <strong>[`ferret-mappings`](#user-content-ferret-mappings)</strong> for a full list). To prevent any mapping from being configured, set to 0:++```+let g:FerretMap=0+```++<p align="right"><a name="gferretqfcommands" href="#user-content-gferretqfcommands"><code>g:FerretQFCommands</code></a></p>+### `g:FerretQFCommands` (boolean, default: 1)<a name="ferret-gferretqfcommands-boolean-default-1" href="#user-content-ferret-gferretqfcommands-boolean-default-1"></a>++Controls whether to set up custom versions of the <strong>`quickfix`</strong> commands, <strong>`:cn`</strong>, <strong>`:cnf`</strong>, <strong>`:cp`</strong> an <strong>`:cpf`</strong>. These overrides vertically center the match within the viewport on each jump. To prevent the custom versions from being configured, set to 0:++```+let g:FerretQFCommands=0+```++## Custom autocommands<a name="ferret-custom-autocommands" href="#user-content-ferret-custom-autocommands"></a>++<p align="right"><a name="ferretdidwrite" href="#user-content-ferretdidwrite"><code>FerretDidWrite</code></a> <a name="ferretwillwrite" href="#user-content-ferretwillwrite"><code>FerretWillWrite</code></a></p>+For maximum compatibility with other plug-ins, Ferret runs the following "User" autocommands before and after running the file writing operations during <strong>[`:Acks`](#user-content-acks)</strong>:++- FerretWillWrite+- FerretDidWrite++For example, to call a pair of custom functions in response to these events, you might do:++```+autocmd! User FerretWillWrite+autocmd User FerretWillWrite call CustomWillWrite()+autocmd! User FerretDidWrite+autocmd User FerretDidWrite call CustomDidWrite()+```++## Overrides<a name="ferret-overrides" href="#user-content-ferret-overrides"></a>++Ferret overrides the 'grepformat' and 'grepprg' settings, preferentially setting `ag`, `ack` or `grep` as the 'grepprg' (in that order) and configuring a suitable 'grepformat'.++Additionally, Ferret includes an <strong>`ftplugin`</strong> for the <strong>`quickfix`</strong> listing that adjusts a number of settings to improve the usability of search results.++<p align="right"><a name="ferret-nolist" href="#user-content-ferret-nolist"><code>ferret-nolist</code></a></p>+'nolist'++Turned off to reduce visual clutter in the search results, and because 'list' is most useful in files that are being actively edited, which is not the case for <strong>`quickfix`</strong> results.++<p align="right"><a name="ferret-norelativenumber" href="#user-content-ferret-norelativenumber"><code>ferret-norelativenumber</code></a></p>+'norelativenumber'++Turned off, because it is more useful to have a sense of absolute progress through the results list than to have the ability to jump to nearby results (especially seeing as the most common operations are moving to the next or previous file, which are both handled nicely by <strong>`:cnf`</strong> and <strong>`:cpf`</strong> respectively).++<p align="right"><a name="ferret-nowrap" href="#user-content-ferret-nowrap"><code>ferret-nowrap</code></a></p>+'nowrap'++Turned off to avoid ugly wrapping that makes the results list hard to read, and because in search results, the most relevant information is the filename, which is on the left and is usually visible even without wrapping.++<p align="right"><a name="ferret-number" href="#user-content-ferret-number"><code>ferret-number</code></a></p>+'number'++Turned on to give a sense of absolute progress through the results.++<p align="right"><a name="ferret-scrolloff" href="#user-content-ferret-scrolloff"><code>ferret-scrolloff</code></a></p>+'scrolloff'++Set to 0 because the <strong>`quickfix`</strong> listing is usually small by default, so trying to keep the current line away from the edge of the viewpoint is futile; by definition it is usually near the edge.++<p align="right"><a name="ferret-nocursorline" href="#user-content-ferret-nocursorline"><code>ferret-nocursorline</code></a></p>+'nocursorline'++Turned off to reduce visual clutter.++To prevent any of these <strong>`quickfix`</strong>-specific overrides from being set up, you can set <strong>`g:FerretQFOptions`</strong> to 0 in your <strong>`.vimrc`</strong>:++```+let g:FerretQFOptions=0+```++## Troubleshooting<a name="ferret-troubleshooting" href="#user-content-ferret-troubleshooting"></a>++<p align="right"><a name="ferret-quotes" href="#user-content-ferret-quotes"><code>ferret-quotes</code></a></p>+### Ferret fails to find patterns containing spaces<a name="ferret-ferret-fails-to-find-patterns-containing-spaces" href="#user-content-ferret-ferret-fails-to-find-patterns-containing-spaces"></a>++As described in the documentation for <strong>[`:Ack`](#user-content-ack)</strong>, the search pattern is passed through as-is to the underlying search command, and no escaping is required other than preceding spaces by a single backslash.++So, to find "foo bar", you would search like:++```+:Ack foo\ bar+```++Unescaped spaces in the search are treated as argument separators, so a command like the following means pass the `-w` option through, search for pattern "foo", and limit search to the "bar" directory:++```+:Ack -w foo bar+```++Note that including quotes will not do what you intend.++```+ " Search for '"foo' in the 'bar"' directory:+ :Ack "foo bar"++ " Search for "'foo' in the "bar'" directory:+ :Ack 'foo bar'+```++This approach to escaping is taken in order to make it straightfoward to use powerful Perl-compatible regular expression syntax in an unambiguous way without having to worry about shell escaping rules:++```+:Ack \blog\((['"]).*?\1\) -i --ignore-dir=src/vendor src dist build+```++## FAQ<a name="ferret-faq" href="#user-content-ferret-faq"></a>++### Why do Ferret commands start with "Ack", "Lack" and so on?<a name="ferret-why-do-ferret-commands-start-with-ack-lack-and-so-on" href="#user-content-ferret-why-do-ferret-commands-start-with-ack-lack-and-so-on"></a>++Ferret was originally the thinnest of wrappers (7 lines of code in my <strong>`.vimrc`</strong>) around `ack`. The earliest traces of it can be seen in the initial commit to my dotfiles repo in May, 2009 (https://wt.pe/h).++So, even though Ferret has a new name now and actually prefers `ag` over `ack` when available, I prefer to keep the command names intact and benefit from years of accumulated muscle-memory.++## Related<a name="ferret-related" href="#user-content-ferret-related"></a>++Just as Ferret aims to improve the multi-file search and replace experience, Loupe does the same for within-file searching:++https://github.com/wincent/loupe++## Website<a name="ferret-website" href="#user-content-ferret-website"></a>++The official Ferret source code repo is at:++http://git.wincent.com/ferret.git++A mirror exists at:++https://github.com/wincent/ferret++Official releases are listed at:++http://www.vim.org/scripts/script.php?script_id=5220++## License<a name="ferret-license" href="#user-content-ferret-license"></a>++Copyright 2015-present Greg Hurrell. All rights reserved.++Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:++1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.++2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.++## Development<a name="ferret-development" href="#user-content-ferret-development"></a>++### Contributing patches<a name="ferret-contributing-patches" href="#user-content-ferret-contributing-patches"></a>++Patches can be sent via mail to greg@hurrell.net, or as GitHub pull requests at: https://github.com/wincent/ferret/pulls++### Cutting a new release<a name="ferret-cutting-a-new-release" href="#user-content-ferret-cutting-a-new-release"></a>++At the moment the release process is manual:++- Perform final sanity checks and manual testing+- Update the <strong>[`ferret-history`](#user-content-ferret-history)</strong> section of the documentation+- Verify clean work tree:++```+git status+```++- Tag the release:++```+git tag -s -m "$VERSION release" $VERSION+```++- Publish the code:++```+git push origin master --follow-tags+git push github master --follow-tags+```++- Produce the release archive:++```+git archive -o ferret-$VERSION.zip HEAD -- .+```++- Upload to http://www.vim.org/scripts/script.php?script_id=5220++## Authors<a name="ferret-authors" href="#user-content-ferret-authors"></a>++Ferret is written and maintained by Greg Hurrell <greg@hurrell.net>.++The idea for vim-dispatch integration was taken from Miles Sterrett's ack.vim plug-in (https://github.com/mileszs/ack.vim).++Other contributors that have submitted patches include (in alphabetical order):++- Daniel Silva+- Joe Lencioni+- Nelo-Thara Wallus+- Vaibhav Sagar++## History<a name="ferret-history" href="#user-content-ferret-history"></a>++### 1.2a (16 May 2016)<a name="ferret-12a-16-may-2016" href="#user-content-ferret-12a-16-may-2016"></a>++- Add optional support for running searches asynchronously using Vim's <strong>`+job`</strong> feature (enabled by default in sufficiently recent versions of Vim); see <strong>`g:FerretJob`</strong>, <strong>`:FerretCancelAsync`</strong> and <strong>`:FerretPullAsync`</strong>.++### 1.1.1 (7 March 2016)<a name="ferret-111-7-march-2016" href="#user-content-ferret-111-7-march-2016"></a>++- Fix another edge case when searching for patterns containing "#", only manifesting under dispatch.vim.++### 1.1 (7 March 2016)<a name="ferret-11-7-march-2016" href="#user-content-ferret-11-7-march-2016"></a>++- Fix edge case when searching for strings of the form "<foo>".+- Fix edge case when searching for patterns containing "#" and "%".+- Provide completion for `ag` and `ack` options when using <strong>[`:Ack`](#user-content-ack)</strong> and <strong>[`:Lack`](#user-content-lack)</strong>.+- Fix display of error messages under dispatch.vim.++### 1.0 (28 December 2015)<a name="ferret-10-28-december-2015" href="#user-content-ferret-10-28-december-2015"></a>++- Fix broken <strong>[`:Qargs`](#user-content-qargs)</strong> command (patch from Daniel Silva).+- Add <strong>`g:FerretQFHandler`</strong> and <strong>`g:FerretLLHandler`</strong> options (patch from Daniel Silva).+- Make <strong>`<Plug>`</strong> mappings accessible even <strong>`g:FerretMap`</strong> is set to 0.+- Fix failure to report filename when using `ack` and explicitly scoping search to a single file (patch from Daniel Silva).+- When using `ag`, report multiple matches per line instead of just the first (patch from Daniel Silva).+- Improve content and display of error messages.++### 0.3 (24 July 2015)<a name="ferret-03-24-july-2015" href="#user-content-ferret-03-24-july-2015"></a>++- Added highlighting of search pattern and related <strong>`g:FerretHlsearch`</strong> option (patch from Nelo-Thara Wallus).+- Add better error reporting for failed or incorrect searches.++### 0.2 (16 July 2015)<a name="ferret-02-16-july-2015" href="#user-content-ferret-02-16-july-2015"></a>++- Added <strong>[`FerretDidWrite`](#user-content-ferretdidwrite)</strong> and <strong>[`FerretWillWrite`](#user-content-ferretwillwrite)</strong> autocommands (patch from Joe Lencioni).+- Add <strong>[`<Plug>(FerretAcks)`](#user-content-plugferretacks)</strong> mapping (patch from Nelo-Thara Wallus).++### 0.1 (8 July 2015)<a name="ferret-01-8-july-2015" href="#user-content-ferret-01-8-july-2015"></a>++- Initial release, extracted from my dotfiles (https://github.com/wincent/wincent).
+ tests/fixtures/integration/ferret/golden/plaintext.golden view
@@ -0,0 +1,569 @@+*ferret.txt* Ferret plug-in for Vim *ferret*++CONTENTS *ferret-contents*++1. Intro |ferret-intro|+2. Installation |ferret-installation|+3. Commands |ferret-commands|+4. Mappings |ferret-mappings|+5. Options |ferret-options|+6. Custom autocommands |ferret-custom-autocommands|+7. Overrides |ferret-overrides|+8. Troubleshooting |ferret-troubleshooting|+9. FAQ |ferret-faq|+10. Related |ferret-related|+11. Website |ferret-website|+12. License |ferret-license|+13. Development |ferret-development|+14. Authors |ferret-authors|+15. History |ferret-history|++INTRO *ferret-intro*++ "ferret (verb)+ (ferret something out) search tenaciously for and find something: she+ had the ability to ferret out the facts."+++ *ferret-features*+Ferret improves Vim's multi-file search in four ways:++1. Powerful multi-file search ~++Ferret provides an |:Ack| command for searching across multiple files using+The Silver Searcher (https://github.com/ggreer/the_silver_searcher), Ack+(http://beyondgrep.com/), or Grep (http://www.gnu.org/software/grep/).+Support for passing options through to the underlying search command exists,+along with the ability to use full regular expression syntax without doing+special escaping.++Shortcut mappings are provided to start an |:Ack| search (<leader>a) or to+search for the word currently under the cursor (<leader>s).++Results are normally displayed in the |quickfix| window, but Ferret also+provides a |:Lack| command that behaves like |:Ack| but uses the |location-list|+instead, and a <leader>l mapping as a shortcut to |:Lack|.++Finally, Ferret offers integration with dispatch.vim+(https://github.com/tpope/vim-dispatch), which enables asynchronous+searching despite the fact that Vim itself is single-threaded.++2. Streamlined multi-file replace ~++The companion to |:Ack| is |:Acks| (mnemonic: "Ack substitute", accessible via+shortcut <leader>r), which allows you to run a multi-file replace across all+the files placed in the |quickfix| window by a previous invocation of |:Ack|.++3. Quickfix listing enhancements ~++The |quickfix| listing itself is enhanced with settings to improve its+usability, and natural mappings that allow quick removal of items from the+list (for example, you can reduce clutter in the listing by removing lines+that you don't intend to make changes to).++Additionally, Vim's |:cn|, |:cp|, |:cnf| and |:cpf| commands are tweaked to make it+easier to immediately identify matches by centering them within the viewport.++4. Easy operations on files in the quickfix listing ~++Finally, Ferret provides a |:Qargs| command that puts the files currently in+the |quickfix| listing into the |:args| list, where they can be operated on in+bulk via the |:argdo| command. This is what's used under the covers by |:Acks|+to do its work.++INSTALLATION *ferret-installation*++To install Ferret, use your plug-in management system of choice.++If you don't have a "plug-in management system of choice", I recommend+Pathogen (https://github.com/tpope/vim-pathogen) due to its simplicity and+robustness. Assuming that you have Pathogen installed and configured, and+that you want to install Ferret into `~/.vim/bundle`, you can do so with:+>+ git clone https://github.com/wincent/ferret.git ~/.vim/bundle/ferret+<+Alternatively, if you use a Git submodule for each Vim plug-in, you could do+the following after `cd`-ing into the top-level of your Git superproject:+>+ git submodule add https://github.com/wincent/ferret.git ~/vim/bundle/ferret+ git submodule init+<+To generate help tags under Pathogen, you can do so from inside Vim with:+>+ :call pathogen#helptags()+<+COMMANDS *ferret-commands*++:Ack {pattern} {options} *:Ack*++Searches for {pattern} in all the files under the current directory (see+|:pwd|), unless otherwise overridden via {options}, and displays the results+in the |quickfix| listing.++`ag` (The Silver Searcher) will be used preferentially if present on the+system, because it is faster, falling back to `ack` and then `grep` as needed.++If dispatch.vim is installed the search process will run asynchronously via+the |:Make| command, otherwise it will be run synchronously via |:cexpr|.+Asynchronous searches are preferred because they do not block, despite the+fact that Vim itself is single threaded. The |g:FerretDispatch| option can be+used to prevent the use of dispatch.vim.++The {pattern} is passed through as-is to the underlying search program, and+no escaping is required other than preceding spaces by a single backslash.+For example, to search for "\bfoo[0-9]{2} bar\b" (ie. using `ag`'s Perl-style+regular expression syntax), you could do:+>+ :Ack \bfoo[0-9]{2}\ bar\b+<+Likewise, {options} are passed through. In this example, we pass the `-w`+option (to search on word boundaries), and scope the search to the "foo" and+"bar" subdirectories: >+>+ :Ack -w something foo bar+<+As a convenience <leader>a is set-up (|<Plug>(FerretAck)|) as a shortcut to+enter |Cmdline-mode| with `:Ack` inserted on the |Cmdline|. Likewise <leader>s+(|<Plug>(FerretAckWord)|) is a shortcut for running |:Ack| with the word+currently under the cursor.++:Lack {pattern} {options} *:Lack*++Just like |:Ack|, but instead of using the |quickfix| listing, which is global+across an entire Vim instance, it uses the |location-list|, which is a+per-window construct.++Note that |:Lack| always runs synchronously via |:cexpr|, because dispatch.vim+doesn't currently support the |location-list|.++:Acks /{pattern}/{replacement}/ *:Acks*++Takes all of the files currently in the |quickfix| listing and performs a+substitution of all instances of {pattern} (a standard Vim search |pattern|)+by {replacement}.++A typical sequence consists of an |:Ack| invocation to populate the |quickfix|+listing and then |:Acks| (mnemonic: "Ack substitute") to perform replacements.+For example, to replace "foo" with "bar" across all files in the current+directory:+>+ :Ack foo+ :Acks /foo/bar/+<+:Qargs *:Qargs*++This is a utility function that is used by the |:Acks| command but is also+generally useful enough to warrant being exposed publicly.++It takes the files currently in the |quickfix| listing and sets them as |:args|+so that they can be operated on en masse via the |:argdo| command.++MAPPINGS *ferret-mappings*++Circumstances where mappings do not get set up ~++Note that Ferret will not try to set up the <leader> mappings if any of the+following are true:++- A mapping for already exists.+- An alternative mapping for the same functionality has already been set up+ from a |.vimrc|.+- The mapping has been suppressed by setting |g:FerretMap| to 1 in your |.vimrc|.++Mappings specific to the quickfix window ~++Additionally, Ferret will set up special mappings in |quickfix| listings,+unless prevented from doing so by |g:FerretQFMap|:++- `d` (|visual-mode|): delete visual selection+- `dd` (|Normal-mode|): delete current line+- `d`{motion} (|Normal-mode|): delete range indicated by {motion}+++ *<Plug>(FerretAck)*+Ferret maps <leader>a to |<Plug>(FerretAck)|, which triggers the |:Ack| command.+To use an alternative mapping instead, create a different one in your |.vimrc|+instead using |:nmap|:+>+ " Instead of <leader>a, use <leader>x.+ nmap <leader>x <Plug>(FerretAck)+<++ *<Plug>(FerretLack)*+Ferret maps <leader>l to |<Plug>(FerretLack)|, which triggers the |:Lack|+command. To use an alternative mapping instead, create a different one in+your |.vimrc| instead using |:nmap|:+>+ " Instead of <leader>l, use <leader>y.+ nmap <leader>y <Plug>(FerretLack)+<++ *<Plug>(FerretAckWord)*+Ferret maps <leader>s (mnemonix: "selection) to |<Plug>(FerretAckWord)|, which+uses |:Ack| to search for the word currently under the cursor. To use an+alternative mapping instead, create a different one in your |.vimrc| instead+using |:nmap|:+>+ " Instead of <leader>s, use <leader>z.+ nmap <leader>z <Plug>(FerretAckWord)+<++ *<Plug>(FerretAcks)*+Ferret maps <leader>r (mnemonic: "replace") to |<Plug>(FerretAcks)|, which+triggers the |:Acks| command and fills the prompt with the last search term+from Ferret. to use an alternative mapping instead, create a different one+in your |.vimrc| instead using |:nmap|:+>+ " Instead of <leader>r, use <leader>u.+ nmap <leader>u <Plug>(FerretAcks)+<+OPTIONS *ferret-options*+++ *g:FerretDispatch*+|g:FerretDispatch| boolean (default: 1)++Controls whether to use vim-dispatch (and specifically, |:Make|) to run |:Ack|+searches asynchronously, when available. To prevent vim-dispatch from being+used, set to 0:+>+ let g:FerretDispatch=0+<++ *g:FerretHlsearch*+|g:FerretHlsearch| boolean (default: none)++Controls whether Ferret should attempt to highlight the search pattern when+running |:Ack| or |:Lack|. If left unset, Ferret will respect the current+'hlsearch' setting. To force highlighting on or off irrespective of+'hlsearch', set |g:FerretHlsearch| to 1 (on) or 0 (off):+>+ let g:FerretHlsearch=0+<++ *g:FerretQFOptions*+|g:FerretQFOptions| boolean (default: 1)++Controls whether to set up setting overrides for |quickfix| windows. These are+various settings, such as |norelativenumber|, |nolist| and |nowrap|, that are+intended to make the |quickfix| window, which is typically very small relative+to other windows, more usable.++A full list of overridden settings can be found in |ferret-overrides|.++To prevent the custom settings from being applied, set |g:FerretQFOptions| to+0:+>+ let g:FerretQFOptions=0+<++ *g:FerretQFMap*+|g:FerretQFMap| boolean (default: 1)++Controls whether to set up mappings in the |quickfix| results window for+deleting results. The mappings include:++- `d` (|visual-mode|): delete visual selection+- `dd` (|Normal-mode|): delete current line+- `d`{motion} (|Normal-mode|): delete range indicated by {motion}++To prevent these mappings from being set up, set to 0:+>+ let g:FerretQFMap=0+<++ *g:FerretLoaded*+|g:FerretLoaded| any (default: none)++To prevent Ferret from being loaded, set |g:FerretLoaded| to any value in your+|.vimrc|. For example:+>+ let g:FerretLoaded=1+<++ *g:FerretMap*+|g:FerretMap| boolean (default: 1)++Controls whether to set up the Ferret mappings, such as |<Plug>(FerretAck)|+(see |ferret-mappings| for a full list). To prevent any mapping from being+configured, set to 0:+>+ let g:FerretMap=0+<++ *g:FerretQFCommands*+|g:FerretQFCommands| boolean (default: 1)++Controls whether to set up custom versions of the |quickfix| commands, |:cn|,+|:cnf|, |:cp| an |:cpf|. These overrides vertically center the match within the+viewport on each jump. To prevent the custom versions from being configured,+set to 0:+>+ let g:FerretQFCommands=0+<+CUSTOM AUTOCOMMANDS *ferret-custom-autocommands*+++ *FerretDidWrite* *FerretWillWrite*+For maximum compatibility with other plug-ins, Ferret runs the following+"User" autocommands before and after running the file writing operations+during |:Acks|:++- FerretWillWrite+- FerretDidWrite++For example, to call a pair of custom functions in response to these events,+you might do:+>+ autocmd! User FerretWillWrite+ autocmd User FerretWillWrite call CustomWillWrite()+ autocmd! User FerretDidWrite+ autocmd User FerretDidWrite call CustomDidWrite()+<+OVERRIDES *ferret-overrides*++Ferret overrides the 'grepformat' and 'grepprg' settings, preferentially+setting `ag`, `ack` or `grep` as the 'grepprg' (in that order) and configuring a+suitable 'grepformat'.++Additionally, Ferret includes an |ftplugin| for the |quickfix| listing that+adjusts a number of settings to improve the usability of search results.+++ *ferret-nolist*+'nolist'++Turned off to reduce visual clutter in the search results, and because+'list' is most useful in files that are being actively edited, which is not+the case for |quickfix| results.+++ *ferret-norelativenumber*+'norelativenumber'++Turned off, because it is more useful to have a sense of absolute progress+through the results list than to have the ability to jump to nearby results+(especially seeing as the most common operations are moving to the next or+previous file, which are both handled nicely by |:cnf| and |:cpf| respectively).+++ *ferret-nowrap*+'nowrap'++Turned off to avoid ugly wrapping that makes the results list hard to read,+and because in search results, the most relevant information is the+filename, which is on the left and is usually visible even without wrapping.+++ *ferret-number*+'number'++Turned on to give a sense of absolute progress through the results.+++ *ferret-scrolloff*+'scrolloff'++Set to 0 because the |quickfix| listing is usually small by default, so trying+to keep the current line away from the edge of the viewpoint is futile; by+definition it is usually near the edge.+++ *ferret-nocursorline*+'nocursorline'++Turned off to reduce visual clutter.++To prevent any of these |quickfix|-specific overrides from being set up, you+can set |g:FerretQFOptions| to 0 in your |.vimrc|:+>+ let g:FerretQFOptions=0+<+TROUBLESHOOTING *ferret-troubleshooting*+++ *ferret-quotes*+Ferret fails to find patterns containing spaces ~++As described in the documentation for |:Ack|, the search pattern is passed+through as-is to the underlying search command, and no escaping is required+other than preceding spaces by a single backslash.++So, to find "foo bar", you would search like:+>+ :Ack foo\ bar+<+Unescaped spaces in the search are treated as argument separators, so a+command like the following means pass the `-w` option through, search for+pattern "foo", and limit search to the "bar" directory:+>+ :Ack -w foo bar+<+Note that including quotes will not do what you intend.+>+ " Search for '"foo' in the 'bar"' directory:+ :Ack "foo bar"++ " Search for "'foo' in the "bar'" directory:+ :Ack 'foo bar'+<+This approach to escaping is taken in order to make it straightfoward to use+powerful Perl-compatible regular expression syntax in an unambiguous way+without having to worry about shell escaping rules:+>+ :Ack \blog\((['"]).*?\1\) -i --ignore-dir=src/vendor src dist build+<+FAQ *ferret-faq*++Why do Ferret commands start with "Ack", "Lack" and so on? ~++Ferret was originally the thinnest of wrappers (7 lines of code in my+|.vimrc|) around `ack`. The earliest traces of it can be seen in the initial+commit to my dotfiles repo in May, 2009 (https://wt.pe/h).++So, even though Ferret has a new name now and actually prefers `ag` over `ack`+when available, I prefer to keep the command names intact and benefit from+years of accumulated muscle-memory.++RELATED *ferret-related*++Just as Ferret aims to improve the multi-file search and replace experience,+Loupe does the same for within-file searching:++https://github.com/wincent/loupe++WEBSITE *ferret-website*++The official Ferret source code repo is at:++http://git.wincent.com/ferret.git++A mirror exists at:++https://github.com/wincent/ferret++Official releases are listed at:++http://www.vim.org/scripts/script.php?script_id=5220++LICENSE *ferret-license*++Copyright 2015-present Greg Hurrell. All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++1. Redistributions of source code must retain the above copyright notice,+this list of conditions and the following disclaimer.++2. Redistributions in binary form must reproduce the above copyright notice,+this list of conditions and the following disclaimer in the documentation+and/or other materials provided with the distribution.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE+POSSIBILITY OF SUCH DAMAGE.++DEVELOPMENT *ferret-development*++Contributing patches ~++Patches can be sent via mail to greg@hurrell.net, or as GitHub pull requests+at: https://github.com/wincent/ferret/pulls++Cutting a new release ~++At the moment the release process is manual:++- Perform final sanity checks and manual testing+- Update the |ferret-history| section of the documentation+- Verify clean work tree:+>+ git status+<+- Tag the release:+>+ git tag -s -m "$VERSION release" $VERSION+<+- Publish the code:+>+ git push origin master --follow-tags+ git push github master --follow-tags+<+- Produce the release archive:+>+ git archive -o ferret-$VERSION.zip HEAD -- .+<+- Upload to http://www.vim.org/scripts/script.php?script_id=5220++AUTHORS *ferret-authors*++Ferret is written and maintained by Greg Hurrell <greg@hurrell.net>.++The idea for vim-dispatch integration was taken from Miles Sterrett's+ack.vim plug-in (https://github.com/mileszs/ack.vim).++Other contributors that have submitted patches include (in alphabetical+order):++- Daniel Silva+- Joe Lencioni+- Nelo-Thara Wallus+- Vaibhav Sagar++HISTORY *ferret-history*++1.2a (16 May 2016) ~++- Add optional support for running searches asynchronously using Vim's |+job|+ feature (enabled by default in sufficiently recent versions of Vim); see+ |g:FerretJob|, |:FerretCancelAsync| and |:FerretPullAsync|.++1.1.1 (7 March 2016) ~++- Fix another edge case when searching for patterns containing "#", only+ manifesting under dispatch.vim.++1.1 (7 March 2016) ~++- Fix edge case when searching for strings of the form "<foo>".+- Fix edge case when searching for patterns containing "#" and "%".+- Provide completion for `ag` and `ack` options when using |:Ack| and |:Lack|.+- Fix display of error messages under dispatch.vim.++1.0 (28 December 2015) ~++- Fix broken |:Qargs| command (patch from Daniel Silva).+- Add |g:FerretQFHandler| and |g:FerretLLHandler| options (patch from Daniel+ Silva).+- Make |<Plug>| mappings accessible even |g:FerretMap| is set to 0.+- Fix failure to report filename when using `ack` and explicitly scoping+ search to a single file (patch from Daniel Silva).+- When using `ag`, report multiple matches per line instead of just the first+ (patch from Daniel Silva).+- Improve content and display of error messages.++0.3 (24 July 2015) ~++- Added highlighting of search pattern and related |g:FerretHlsearch| option+ (patch from Nelo-Thara Wallus).+- Add better error reporting for failed or incorrect searches.++0.2 (16 July 2015) ~++- Added |FerretDidWrite| and |FerretWillWrite| autocommands (patch from Joe+ Lencioni).+- Add |<Plug>(FerretAcks)| mapping (patch from Nelo-Thara Wallus).++0.1 (8 July 2015) ~++- Initial release, extracted from my dotfiles+ (https://github.com/wincent/wincent).
+ tests/fixtures/integration/ferret/input/autoload/ferret/private.vim view
@@ -0,0 +1,454 @@+" Copyright 2015-present Greg Hurrell. All rights reserved.+" Licensed under the terms of the BSD 2-clause license.++" Remove lines a:first through a:last from the quickfix listing.+function! s:delete(first, last)+ let l:list=getqflist()+ let l:line=a:first++ while l:line >= a:first && l:line <= a:last+ " Non-dictionary items will be ignored. This effectively deletes the line.+ let l:list[l:line - 1]=0+ let l:line=l:line + 1+ endwhile+ call setqflist(l:list, 'r')++ " Go to next entry.+ execute 'cc ' . a:first++ " Move focus back to quickfix listing.+ execute "normal \<C-W>\<C-P>"+endfunction++" Returns 1 if we should/can use vim-dispatch.+function! ferret#private#dispatch() abort+ ""+ " @option g:FerretDispatch boolean 1+ "+ " Controls whether to use vim-dispatch (and specifically, |:Make|) to run+ " |:Ack| searches asynchronously, when available. To prevent vim-dispatch from+ " being used, set to 0:+ "+ " ```+ " let g:FerretDispatch=0+ " ```+ let l:dispatch=get(g:, 'FerretDispatch', 1)+ return l:dispatch && exists(':Make') == 2+endfunction++" Returns 1 if we can use Vim's built-in async primitives.+function! ferret#private#async()+ let l:async=get(g:, 'FerretJob', 1)++ " Nothing special about 1829; it's just the version I am testing with as I+ " write this.+ return l:async && has('patch-7-4-1829')+endfunction++" Use `input()` to show error output to user. Ideally, we would do this in a way+" that didn't require user interaction, but this is the only reliable mechanism+" that works for all cases. Alternatives considered:+"+" (1) Using `:echomsg`+"+" When not using vim-dispatch, the screen is getting cleared before the+" user sees it, even with a pre-emptive `:redraw!` beforehand. Note that+" we can get the message to linger on the screen by making it multi-line and+" forcing Vim to show a prompt (see `:h hit-enter-prompt`), but this is not+" reliable because the number of lines required to force the prompt will+" vary by system, depending on the value of `'cmdheight'`.+"+" When using vim-dispatch, anything we output ends up getting swallowed+" before the user sees it, because something it is doing is clearing the+" screen. This is true no matter how many lines we output.+"+" (2) Writing back into the quickfix/location list+"+" This interacts poorly with vim-dispatch. If we write back an error message+" and then call `:copen 1`, vim-dispatch ends up closing the listing before+" the user sees it.+"+" (3) Using `:echoerr`+"+" This works, but presents to the user as an exception (see `:h :echoerr`).+"+function! ferret#private#error(message) abort+ call inputsave()+ echohl ErrorMsg+ unsilent call input(a:message . ': press ENTER to continue')+ echohl NONE+ call inputrestore()+ unsilent echo+ redraw!+endfunction++" Parses arguments, extracting a search pattern (which is stored in+" g:ferret_lastsearch) and escaping space-delimited arguments for use by+" `system()`. A string containing all the escaped arguments is returned.+function! s:parse(args) abort+ if exists('g:ferret_lastsearch')+ unlet g:ferret_lastsearch+ endif++ let l:expanded_args=[]++ for l:arg in a:args+ if ferret#private#option(l:arg)+ " Options get passed through as-is.+ call add(l:expanded_args, l:arg)+ elseif exists('g:ferret_lastsearch')+ let l:file_args=glob(l:arg, 1, 1) " Ignore 'wildignore', return a list.+ if len(l:file_args)+ call extend(l:expanded_args, l:file_args)+ else+ " Let through to `ag`/`ack`/`grep`, which will throw ENOENT.+ call add(l:expanded_args, l:arg)+ endif+ else+ " First non-option arg is considered to be search pattern.+ let g:ferret_lastsearch=l:arg+ call add(l:expanded_args, l:arg)+ endif+ endfor++ if ferret#private#async()+ return l:expanded_args+ endif++ let l:each_word_shell_escaped=map(l:expanded_args, 'shellescape(v:val)')+ let l:joined=join(l:each_word_shell_escaped)+ return escape(l:joined, '<>#')+endfunction++function! ferret#private#clearautocmd() abort+ if has('autocmd')+ augroup FerretPostQF+ autocmd!+ augroup END+ endif+endfunction++function! ferret#private#post(type) abort+ call ferret#private#clearautocmd()+ let l:lastsearch = get(g:, 'ferret_lastsearch', '')+ let l:qflist = a:type == 'qf' ? getqflist() : getloclist(0)+ let l:tip = ' [see `:help ferret-quotes`]'+ if len(l:qflist) == 0+ let l:base = 'No results for search pattern `' . l:lastsearch . '`'++ " Search pattern has no spaces and is entirely enclosed in quotes;+ " eg 'foo' or "bar"+ if l:lastsearch =~ '\v^([' . "'" . '"])[^ \1]+\1$'+ call ferret#private#error(l:base . l:tip)+ else+ call ferret#private#error(l:base)+ endif+ else+ " Find any "invalid" entries in the list.+ let l:invalid = filter(copy(l:qflist), 'v:val.valid == 0')+ if len(l:invalid) == len(l:qflist)+ " Every item in the list was invalid.+ redraw!+ echohl ErrorMsg+ for l:item in l:invalid+ unsilent echomsg l:item.text+ endfor+ echohl NONE++ let l:base = 'Search for `' . l:lastsearch . '` failed'++ " When using vim-dispatch, the messages printed above get cleared, so the+ " only way to see them is with `:messages`.+ let l:suffix = a:type == 'qf' && ferret#private#dispatch() ?+ \ ' (run `:messages` to see details)' :+ \ ''++ " If search pattern looks like `'foo` or `"bar`, it means the user+ " probably tried to search for 'foo bar' or "bar baz" etc.+ if l:lastsearch =~ '\v^[' . "'" . '"].+[^' . "'" . '"]$'+ call ferret#private#error(l:base . l:tip . l:suffix)+ else+ call ferret#private#error(l:base . l:suffix)+ endif+ endif+ endif+endfunction++function! ferret#private#ack(...) abort+ let l:command=s:parse(a:000)+ call ferret#private#hlsearch()++ if empty(&grepprg)+ return+ endif++ if ferret#private#async()+ call ferret#private#async#search(l:command, 1)+ elseif ferret#private#dispatch()+ call ferret#private#dispatch#search(l:command)+ else+ call ferret#private#vanilla#search(l:command, 1)+ endif+endfunction++function! ferret#private#lack(...) abort+ let l:command=s:parse(a:000)+ call ferret#private#hlsearch()++ if empty(&grepprg)+ return+ endif++ if ferret#private#async()+ call ferret#private#async#search(l:command, 0)+ else+ call ferret#private#vanilla#search(l:command, 0)+ endif+endfunction++function! ferret#private#hlsearch() abort+ if has('extra_search')+ ""+ " @option g:FerretHlsearch boolean+ "+ " Controls whether Ferret should attempt to highlight the search pattern+ " when running |:Ack| or |:Lack|. If left unset, Ferret will respect the+ " current 'hlsearch' setting. To force highlighting on or off irrespective+ " of 'hlsearch', set |g:FerretHlsearch| to 1 (on) or 0 (off):+ "+ " ```+ " let g:FerretHlsearch=0+ " ```+ let l:hlsearch=get(g:, 'FerretHlsearch', &hlsearch)+ if l:hlsearch+ let @/=g:ferret_lastsearch+ call feedkeys(":let &hlsearch=1 | echo \<CR>", 'n')+ endif+ endif+endfunction++" Run the specified substitution command on all the files in the quickfix list+" (mnemonic: "Ack substitute").+"+" Specifically, the sequence:+"+" :Ack foo+" :Acks /foo/bar/+"+" is equivalent to:+"+" :Ack foo+" :Qargs+" :argdo %s/foo/bar/ge | update+"+" (Note: there's nothing specific to Ack in this function; it's just named this+" way for mnemonics, as it will most often be preceded by an :Ack invocation.)+function! ferret#private#acks(command) abort+ " Accept any pattern allowed by E146 (crude sanity check).+ let l:matches = matchlist(a:command, '\v\C^(([^|"\\a-zA-Z0-9]).+\2.*\2)([cgeiI]*)$')+ if !len(l:matches)+ call ferret#private#error(+ \ 'Ferret: Expected a substitution expression (/foo/bar/); got: ' .+ \ a:command+ \ )+ return+ endif++ " Pass through options `c`, `i`/`I` to `:substitute`.+ " Add options `e` and `g` if not already present.+ let l:pattern = l:matches[1]+ let l:options = l:matches[3]+ if l:options !~# 'e'+ let l:options .= 'e'+ endif+ if l:options !~# 'g'+ let l:options .= 'g'+ endif++ let l:filenames=ferret#private#qargs()+ if l:filenames ==# ''+ call ferret#private#error(+ \ 'Ferret: Quickfix filenames must be present, but there are none ' .+ \ '(must use :Ack to find files before :Acks can be used)'+ \ )+ return+ endif++ execute 'args' l:filenames++ call ferret#private#autocmd('FerretWillWrite')+ execute 'argdo' '%s' . l:pattern . l:options . ' | update'+ call ferret#private#autocmd('FerretDidWrite')+endfunction++function! ferret#private#autocmd(cmd) abort+ if v:version > 703 || v:version == 703 && has('patch438')+ execute 'silent doautocmd <nomodeline> User ' . a:cmd+ else+ execute 'silent doautocmd User ' . a:cmd+ endif+endfunction++" Split on spaces, but not backslash-escaped spaces.+function! s:split(str) abort+ " Regular expression cheatsheet:+ "+ " \%(...\) Non-capturing subgroup.+ " \@<! Zero-width negative lookbehind (like Perl `(?<!pattern)`).+ " \+ + (backslash needed due to Vim's "nomagic").+ " \| + (backslash needed due to Vim's "nomagic").+ " \zs Start match here.+ "+ " So, broken down, this means:+ "+ " - Split on any space not preceded by...+ " - a backslash at the start of the string or...+ " - a backslash preceded by a non-backslash character.+ " - Keep the separating whitespace at the end of each string+ " (allows callers to track position within overall string).+ "+ return split(a:str, '\%(\%(\%(^\|[^\\]\)\\\)\@<!\s\)\+\zs')+endfunction++function! ferret#private#ackcomplete(arglead, cmdline, cursorpos) abort+ return ferret#private#complete('Ack', a:arglead, a:cmdline, a:cursorpos)+endfunction++function! ferret#private#lackcomplete(arglead, cmdline, cursorpos) abort+ return ferret#private#complete('Lack', a:arglead, a:cmdline, a:cursorpos)+endfunction++if executable('ag')+ let s:executable='ag'+elseif executable('ack')+ let s:executable='ack'+elseif executable('grep')+ let s:executable='grep'+else+ let s:executable=''+endif++let s:options = {+ \ 'ack': [+ \ '--ignore-ack-defaults',+ \ '--ignore-case',+ \ '--ignore-dir',+ \ '--ignore-directory',+ \ '--invert-match',+ \ '--known-types',+ \ '--literal',+ \ '--no-recurse',+ \ '--recurse',+ \ '--sort-files',+ \ '--type',+ \ '--word-regexp',+ \ '-1',+ \ '-Q',+ \ '-R',+ \ '-i',+ \ '-k',+ \ '-r',+ \ '-v',+ \ '-w',+ \ ],+ \ 'ag': [+ \ '--all-types',+ \ '--all-text',+ \ '--case-sensitive',+ \ '--depth',+ \ '--follow',+ \ '--ignore',+ \ '--ignore-case',+ \ '--ignore-dir',+ \ '--invert-match',+ \ '--literal',+ \ '--max-count',+ \ '--skip-vcs-ignores',+ \ '--unrestricted',+ \ '--word-regexp',+ \ '-Q',+ \ '-U',+ \ '-a',+ \ '-i',+ \ '-m',+ \ '-s',+ \ '-t',+ \ '-u',+ \ '-v',+ \ '-w'+ \ ]+ \ }++" We provide our own custom command completion because the default+" -complete=file completion will expand special characters in the pattern (like+" "#") before we get a chance to see them, breaking the search. As a bonus, this+" means we can provide option completion for `ack` and `ag` options as well.+function! ferret#private#complete(cmd, arglead, cmdline, cursorpos) abort+ let l:args=s:split(a:cmdline[:a:cursorpos])++ let l:command_seen=0+ let l:pattern_seen=0+ let l:position=0++ for l:arg in l:args+ let l:position=l:position + len(l:arg)+ let l:stripped=substitute(l:arg, '\s\+$', '', '')++ if ferret#private#option(l:stripped)+ if a:cursorpos <= l:position+ let l:options=get(s:options, s:executable, [])+ return filter(l:options, 'match(v:val, l:stripped) == 0')+ endif+ elseif l:pattern_seen+ if a:cursorpos <= l:position+ " Assume this is a filename, and it's the one we're trying to complete.+ " Do -complete=file style completion.+ return glob(a:arglead . '*', 1, 1)+ end+ elseif l:command_seen+ " Let the pattern through unaltered.+ let l:pattern_seen=1+ elseif l:stripped ==# a:cmd+ let l:command_seen=1+ else+ " Haven't seen command yet, this must be a range or a count.+ " (Not valid, but nothing we can do about it here).+ end+ endfor++ " Didn't get to a filename; nothing to complete.+ return []+endfunction++" Returns true (1) if `str` looks like a command-line option.+function! ferret#private#option(str) abort+ return a:str =~# '^-'+endfunction++" Populate the :args list with the filenames currently in the quickfix window.+function! ferret#private#qargs() abort+ let l:buffer_numbers={}+ for l:item in getqflist()+ let l:buffer_numbers[l:item['bufnr']]=bufname(l:item['bufnr'])+ endfor+ return join(map(values(l:buffer_numbers), 'fnameescape(v:val)'))+endfunction++" Visual mode deletion and `dd` mapping (special case).+function! ferret#private#qf_delete() range+ call s:delete(a:firstline, a:lastline)+endfunction++" Motion-based deletion from quickfix listing.+function! ferret#private#qf_delete_motion(type, ...)+ " Save.+ let l:selection=&selection+ let &selection='inclusive'++ let l:firstline=line("'[")+ let l:lastline=line("']")+ call s:delete(l:firstline, l:lastline)++ " Restore.+ let &selection=l:selection+endfunction
+ tests/fixtures/integration/ferret/input/autoload/ferret/private/async.vim view
@@ -0,0 +1,152 @@+" Copyright 2015-present Greg Hurrell. All rights reserved.+" Licensed under the terms of the BSD 2-clause license.++let s:jobs={}++function! s:channel_id(channel)+ " Coerce to string, pluck out ID number.+ return matchstr(a:channel, '\d\+')+endfunction++function! s:info_from_channel(channel)+ let l:channel_id=s:channel_id(a:channel)+ if has_key(s:jobs, l:channel_id)+ return s:jobs[l:channel_id]+ endif+endfunction++function! ferret#private#async#search(command, ack) abort+ call ferret#private#async#cancel()+ call ferret#private#autocmd('FerretAsyncStart')+ let l:command_and_args = extend(split(&grepprg), a:command)+ let l:job=job_start(l:command_and_args, {+ \ 'err_cb': 'ferret#private#async#err_cb',+ \ 'out_cb': 'ferret#private#async#out_cb',+ \ 'close_cb': 'ferret#private#async#close_cb',+ \ 'err_mode': 'raw',+ \ 'out_mode': 'raw'+ \ })+ let l:channel=job_getchannel(l:job)+ let l:channel_id=s:channel_id(l:channel)+ let s:jobs[l:channel_id]={+ \ 'channel_id': l:channel_id,+ \ 'job': l:job,+ \ 'errors': [],+ \ 'output': [],+ \ 'pending_error': '',+ \ 'pending_output': '',+ \ 'pending_error_length': 0,+ \ 'pending_output_length': 0,+ \ 'ack': a:ack,+ \ 'window': win_getid()+ \ }+endfunction++let s:max_line_length=32768++function! ferret#private#async#err_cb(channel, msg)+ let l:info=s:info_from_channel(a:channel)+ if type(l:info) == 4+ let l:start=0+ while 1+ let l:idx=match(a:msg, '\n', l:start)+ if l:idx==-1+ if l:info.pending_error_length < s:max_line_length+ let l:rest=strpart(a:msg, l:start)+ let l:length=strlen(l:rest)+ let l:info.pending_error.=l:rest+ let l:info.pending_error_length+=l:length+ endif+ break+ else+ if l:info.pending_error_length < s:max_line_length+ let l:info.pending_error.=strpart(a:msg, l:start, l:idx - l:start)+ endif+ call add(l:info.errors, l:info.pending_error)+ let l:info.pending_error=''+ let l:info.pending_error_length=0+ endif+ let l:start=l:idx + 1+ endwhile+ endif+endfunction++function! ferret#private#async#out_cb(channel, msg)+ let l:info=s:info_from_channel(a:channel)+ if type(l:info) == 4+ let l:start=0+ while 1+ let l:idx=match(a:msg, '\n', l:start)+ if l:idx==-1+ if l:info.pending_output_length < s:max_line_length+ let l:rest=strpart(a:msg, l:start)+ let l:length=strlen(l:rest)+ let l:info.pending_output.=l:rest+ let l:info.pending_output_length+=l:length+ endif+ break+ else+ if l:info.pending_output_length < s:max_line_length+ let l:info.pending_output.=strpart(a:msg, l:start, l:idx - l:start)+ endif+ call add(l:info.output, l:info.pending_output)+ let l:info.pending_output=''+ let l:info.pending_output_length=0+ endif+ let l:start=l:idx + 1+ endwhile+ endif+endfunction++function! ferret#private#async#close_cb(channel) abort+ " Job may have been canceled with cancel_async. Do nothing in that case.+ let l:info=s:info_from_channel(a:channel)+ if type(l:info) == 4+ call remove(s:jobs, l:info.channel_id)+ call ferret#private#autocmd('FerretAsyncFinish')+ if !l:info.ack+ " If this is a :Lack search, try to focus appropriate window.+ call win_gotoid(l:info.window)+ endif+ call s:finalize_search(l:info.output, l:info.ack)+ for l:error in l:info.errors+ unsilent echomsg l:error+ endfor+ endif+endfunction++function! ferret#private#async#pull() abort+ for l:channel_id in keys(s:jobs)+ let l:info=s:jobs[l:channel_id]+ call s:finalize_search(l:info.output, l:info.ack)+ endfor+endfunction++function! ferret#private#async#cancel() abort+ let l:canceled=0+ for l:channel_id in keys(s:jobs)+ let l:info=s:jobs[l:channel_id]+ call job_stop(l:info.job)+ call remove(s:jobs, l:channel_id)+ let l:canceled=1+ endfor+ if l:canceled+ call ferret#private#autocmd('FerretAsyncFinish')+ endif+endfunction++function! ferret#private#async#debug() abort+ return s:jobs+endfunction++function! s:finalize_search(output, ack)+ if a:ack+ cexpr a:output+ execute get(g:, 'FerretQFHandler', 'botright cwindow')+ call ferret#private#post('qf')+ else+ lexpr a:output+ execute get(g:, 'FerretLLHandler', 'lwindow')+ call ferret#private#post('location')+ endif+endfunction
+ tests/fixtures/integration/ferret/input/autoload/ferret/private/dispatch.vim view
@@ -0,0 +1,24 @@+" Copyright 2015-present Greg Hurrell. All rights reserved.+" Licensed under the terms of the BSD 2-clause license.++function! ferret#private#dispatch#search(command) abort+ if has('autocmd')+ augroup FerretPostQF+ autocmd!+ autocmd QuickfixCmdPost cgetfile call ferret#private#post('qf')+ augroup END+ endif+ let l:original_makeprg=&l:makeprg+ let l:original_errorformat=&l:errorformat+ try+ let &l:makeprg=&grepprg . ' ' . a:command+ let &l:errorformat=&grepformat+ echomsg &l:makeprg+ Make+ catch+ call ferret#private#clearautocmd()+ finally+ let &l:makeprg=l:original_makeprg+ let &l:errorformat=l:original_errorformat+ endtry+endfunction
+ tests/fixtures/integration/ferret/input/autoload/ferret/private/vanilla.vim view
@@ -0,0 +1,19 @@+" Copyright 2015-present Greg Hurrell. All rights reserved.+" Licensed under the terms of the BSD 2-clause license.++function! s:finalize_search(output, ack)+ if a:ack+ cexpr a:output+ execute get(g:, 'FerretQFHandler', 'botright cwindow')+ call ferret#private#post('qf')+ else+ lexpr a:output+ execute get(g:, 'FerretLLHandler', 'lwindow')+ call ferret#private#post('location')+ endif+endfunction++function! ferret#private#vanilla#search(command, ack) abort+ let l:output=system(&grepprg . ' ' . a:command)+ call s:finalize_search(l:output, a:ack)+endfunction
+ tests/fixtures/integration/ferret/input/ftplugin/qf.vim view
@@ -0,0 +1,64 @@+" Copyright 2015-present Greg Hurrell. All rights reserved.+" Licensed under the terms of the BSD 2-clause license.++""+" @option g:FerretQFOptions boolean 1+"+" Controls whether to set up setting overrides for |quickfix| windows. These are+" various settings, such as |norelativenumber|, |nolist| and |nowrap|, that are+" intended to make the |quickfix| window, which is typically very small relative+" to other windows, more usable.+"+" A full list of overridden settings can be found in |ferret-overrides|.+"+" To prevent the custom settings from being applied, set |g:FerretQFOptions|+" to 0:+"+" ```+" let g:FerretQFOptions=0+" ```+let s:options=get(g:, 'FerretQFOptions', 1)+if s:options+ setlocal nolist+ if exists('+relativenumber')+ setlocal norelativenumber+ endif+ setlocal nowrap+ setlocal number++ " Want to set scrolloff only for the qf window, but it is a global option.+ let s:original_scrolloff=&scrolloff+ set scrolloff=0++ if has('autocmd')+ augroup FerretQF+ autocmd!+ autocmd BufLeave <buffer> execute 'set scrolloff=' . s:original_scrolloff+ autocmd BufEnter <buffer> set scrolloff=0 | setlocal nocursorline+ augroup END+ endif+endif++""+" @option g:FerretQFMap boolean 1+"+" Controls whether to set up mappings in the |quickfix| results window for+" deleting results. The mappings include:+"+" - `d` (|visual-mode|): delete visual selection+" - `dd` (|Normal-mode|): delete current line+" - `d`{motion} (|Normal-mode|): delete range indicated by {motion}+"+" To prevent these mappings from being set up, set to 0:+"+" ```+" let g:FerretQFMap=0+" ```+let s:map=get(g:, 'FerretQFMap', 1)+if s:map+ " Make it easy to remove entries from the quickfix listing.+ " TODO: distinguish between quickfix and location list+ nnoremap <buffer> <silent> d :set operatorfunc=ferret#private#qf_delete_motion<CR>g@+ nnoremap <buffer> <silent> dd :call ferret#private#qf_delete()<CR>+ vnoremap <buffer> <silent> d :call ferret#private#qf_delete()<CR>+endif
+ tests/fixtures/integration/ferret/input/plugin/ferret.vim view
@@ -0,0 +1,628 @@+" Copyright 2015-present Greg Hurrell. All rights reserved.+" Licensed under the terms of the BSD 2-clause license.++""+" @plugin ferret Ferret plug-in for Vim+"+" # Intro+"+" > "ferret (verb)<br />+" > (ferret something out) search tenaciously for and find something: she had+" > the ability to ferret out the facts."+"+" *ferret-features*+" Ferret improves Vim's multi-file search in four ways:+"+" ## 1. Powerful multi-file search+"+" Ferret provides an |:Ack| command for searching across multiple files using+" The Silver Searcher (https://github.com/ggreer/the_silver_searcher), Ack+" (http://beyondgrep.com/), or Grep (http://www.gnu.org/software/grep/). Support+" for passing options through to the underlying search command exists, along+" with the ability to use full regular expression syntax without doing special+" escaping.+"+" Shortcut mappings are provided to start an |:Ack| search (<leader>a) or to+" search for the word currently under the cursor (<leader>s).+"+" Results are normally displayed in the |quickfix| window, but Ferret also+" provides a |:Lack| command that behaves like |:Ack| but uses the+" |location-list| instead, and a <leader>l mapping as a shortcut to |:Lack|.+"+" Finally, Ferret offers integration with dispatch.vim+" (https://github.com/tpope/vim-dispatch), which enables asynchronous searching+" despite the fact that Vim itself is single-threaded.+"+" ## 2. Streamlined multi-file replace+"+" The companion to |:Ack| is |:Acks| (mnemonic: "Ack substitute", accessible via+" shortcut <leader>r), which allows you to run a multi-file replace across all+" the files placed in the |quickfix| window by a previous invocation of |:Ack|.+"+" ## 3. Quickfix listing enhancements+"+" The |quickfix| listing itself is enhanced with settings to improve its+" usability, and natural mappings that allow quick removal of items from the+" list (for example, you can reduce clutter in the listing by removing lines+" that you don't intend to make changes to).+"+" Additionally, Vim's |:cn|, |:cp|, |:cnf| and |:cpf| commands are tweaked to+" make it easier to immediately identify matches by centering them within the+" viewport.+"+" ## 4. Easy operations on files in the quickfix listing+"+" Finally, Ferret provides a |:Qargs| command that puts the files currently in+" the |quickfix| listing into the |:args| list, where they can be operated on in+" bulk via the |:argdo| command. This is what's used under the covers by |:Acks|+" to do its work.+"+"+" # Installation+"+" To install Ferret, use your plug-in management system of choice.+"+" If you don't have a "plug-in management system of choice", I recommend+" Pathogen (https://github.com/tpope/vim-pathogen) due to its simplicity and+" robustness. Assuming that you have Pathogen installed and configured, and that+" you want to install Ferret into `~/.vim/bundle`, you can do so with:+"+" ```+" git clone https://github.com/wincent/ferret.git ~/.vim/bundle/ferret+" ```+"+" Alternatively, if you use a Git submodule for each Vim plug-in, you could do+" the following after `cd`-ing into the top-level of your Git superproject:+"+" ```+" git submodule add https://github.com/wincent/ferret.git ~/vim/bundle/ferret+" git submodule init+" ```+"+" To generate help tags under Pathogen, you can do so from inside Vim with:+"+" ```+" :call pathogen#helptags()+" ```+"+" @mappings+"+" ## Circumstances where mappings do not get set up+"+" Note that Ferret will not try to set up the <leader> mappings if any of the+" following are true:+"+" - A mapping for already exists.+" - An alternative mapping for the same functionality has already been set up+" from a |.vimrc|.+" - The mapping has been suppressed by setting |g:FerretMap| to 1 in your+" |.vimrc|.+"+" ## Mappings specific to the quickfix window+"+" Additionally, Ferret will set up special mappings in |quickfix| listings,+" unless prevented from doing so by |g:FerretQFMap|:+"+" - `d` (|visual-mode|): delete visual selection+" - `dd` (|Normal-mode|): delete current line+" - `d`{motion} (|Normal-mode|): delete range indicated by {motion}+"+"+" @footer+"+" # Custom autocommands+"+" *FerretWillWrite* *FerretDidWrite*+" For maximum compatibility with other plug-ins, Ferret runs the following+" "User" autocommands before and after running the file writing operations+" during |:Acks|:+"+" - FerretWillWrite+" - FerretDidWrite+"+" For example, to call a pair of custom functions in response to these events,+" you might do:+"+" ```+" autocmd! User FerretWillWrite+" autocmd User FerretWillWrite call CustomWillWrite()+" autocmd! User FerretDidWrite+" autocmd User FerretDidWrite call CustomDidWrite()+" ```+"+"+" # Overrides+"+" Ferret overrides the 'grepformat' and 'grepprg' settings, preferentially+" setting `ag`, `ack` or `grep` as the 'grepprg' (in that order) and configuring+" a suitable 'grepformat'.+"+" Additionally, Ferret includes an |ftplugin| for the |quickfix| listing that+" adjusts a number of settings to improve the usability of search results.+"+" @indent+" *ferret-nolist*+" 'nolist'+"+" Turned off to reduce visual clutter in the search results, and because+" 'list' is most useful in files that are being actively edited, which is not+" the case for |quickfix| results.+"+" *ferret-norelativenumber*+" 'norelativenumber'+"+" Turned off, because it is more useful to have a sense of absolute progress+" through the results list than to have the ability to jump to nearby results+" (especially seeing as the most common operations are moving to the next or+" previous file, which are both handled nicely by |:cnf| and |:cpf|+" respectively).+"+" *ferret-nowrap*+" 'nowrap'+"+" Turned off to avoid ugly wrapping that makes the results list hard to read,+" and because in search results, the most relevant information is the+" filename, which is on the left and is usually visible even without wrapping.+"+" *ferret-number*+" 'number'+"+" Turned on to give a sense of absolute progress through the results.+"+" *ferret-scrolloff*+" 'scrolloff'+"+" Set to 0 because the |quickfix| listing is usually small by default, so+" trying to keep the current line away from the edge of the viewpoint is+" futile; by definition it is usually near the edge.+"+" *ferret-nocursorline*+" 'nocursorline'+"+" Turned off to reduce visual clutter.+"+" @dedent+"+" To prevent any of these |quickfix|-specific overrides from being set up, you+" can set |g:FerretQFOptions| to 0 in your |.vimrc|:+"+" ```+" let g:FerretQFOptions=0+" ```+"+"+" # Troubleshooting+"+" *ferret-quotes*+" ## Ferret fails to find patterns containing spaces+"+" As described in the documentation for |:Ack|, the search pattern is passed+" through as-is to the underlying search command, and no escaping is required+" other than preceding spaces by a single backslash.+"+" So, to find "foo bar", you would search like:+"+" ```+" :Ack foo\ bar+" ```+"+" Unescaped spaces in the search are treated as argument separators, so a+" command like the following means pass the `-w` option through, search for+" pattern "foo", and limit search to the "bar" directory:+"+" ```+" :Ack -w foo bar+" ```+"+" Note that including quotes will not do what you intend.+"+" ```+" " Search for '"foo' in the 'bar"' directory:+" :Ack "foo bar"+"+" " Search for "'foo' in the "bar'" directory:+" :Ack 'foo bar'+" ```+"+" This approach to escaping is taken in order to make it straightfoward to use+" powerful Perl-compatible regular expression syntax in an unambiguous way+" without having to worry about shell escaping rules:+"+" ```+" :Ack \blog\((['"]).*?\1\) -i --ignore-dir=src/vendor src dist build+" ```+"+"+" # FAQ+"+" ## Why do Ferret commands start with "Ack", "Lack" and so on?+"+" Ferret was originally the thinnest of wrappers (7 lines of code in my+" |.vimrc|) around `ack`. The earliest traces of it can be seen in the initial+" commit to my dotfiles repo in May, 2009 (https://wt.pe/h).+"+" So, even though Ferret has a new name now and actually prefers `ag` over `ack`+" when available, I prefer to keep the command names intact and benefit from+" years of accumulated muscle-memory.+"+"+"+" # Related+"+" Just as Ferret aims to improve the multi-file search and replace experience,+" Loupe does the same for within-file searching:+"+" https://github.com/wincent/loupe+"+"+" # Website+"+" The official Ferret source code repo is at:+"+" http://git.wincent.com/ferret.git+"+" A mirror exists at:+"+" https://github.com/wincent/ferret+"+" Official releases are listed at:+"+" http://www.vim.org/scripts/script.php?script_id=5220+"+"+" # License+"+" Copyright 2015-present Greg Hurrell. All rights reserved.+"+" Redistribution and use in source and binary forms, with or without+" modification, are permitted provided that the following conditions are met:+"+" 1. Redistributions of source code must retain the above copyright notice,+" this list of conditions and the following disclaimer.+"+" 2. Redistributions in binary form must reproduce the above copyright notice,+" this list of conditions and the following disclaimer in the documentation+" and/or other materials provided with the distribution.+"+" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"+" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE+" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE+" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE+" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR+" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF+" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS+" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN+" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)+" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE+" POSSIBILITY OF SUCH DAMAGE.+"+"+" # Development+"+" ## Contributing patches+"+" Patches can be sent via mail to greg@hurrell.net, or as GitHub pull requests+" at: https://github.com/wincent/ferret/pulls+"+" ## Cutting a new release+"+" At the moment the release process is manual:+"+" - Perform final sanity checks and manual testing+" - Update the |ferret-history| section of the documentation+" - Verify clean work tree:+"+" ```+" git status+" ```+"+" - Tag the release:+"+" ```+" git tag -s -m "$VERSION release" $VERSION+" ```+"+" - Publish the code:+"+" ```+" git push origin master --follow-tags+" git push github master --follow-tags+" ```+"+" - Produce the release archive:+"+" ```+" git archive -o ferret-$VERSION.zip HEAD -- .+" ```+"+" - Upload to http://www.vim.org/scripts/script.php?script_id=5220+"+"+" # Authors+"+" Ferret is written and maintained by Greg Hurrell <greg@hurrell.net>.+"+" The idea for vim-dispatch integration was taken from Miles Sterrett's ack.vim+" plug-in (https://github.com/mileszs/ack.vim).+"+" Other contributors that have submitted patches include (in alphabetical+" order):+"+" - Daniel Silva+" - Joe Lencioni+" - Nelo-Thara Wallus+" - Vaibhav Sagar+"+"+" # History+"+" ## 1.2a (16 May 2016)+"+" - Add optional support for running searches asynchronously using Vim's |+job|+" feature (enabled by default in sufficiently recent versions of Vim); see+" |g:FerretJob|, |:FerretCancelAsync| and |:FerretPullAsync|.+"+" ## 1.1.1 (7 March 2016)+"+" - Fix another edge case when searching for patterns containing "#", only+" manifesting under dispatch.vim.+"+" ## 1.1 (7 March 2016)+"+" - Fix edge case when searching for strings of the form "<foo>".+" - Fix edge case when searching for patterns containing "#" and "%".+" - Provide completion for `ag` and `ack` options when using |:Ack| and |:Lack|.+" - Fix display of error messages under dispatch.vim.+"+" ## 1.0 (28 December 2015)+"+" - Fix broken |:Qargs| command (patch from Daniel Silva).+" - Add |g:FerretQFHandler| and |g:FerretLLHandler| options (patch from Daniel+" Silva).+" - Make |<Plug>| mappings accessible even |g:FerretMap| is set to 0.+" - Fix failure to report filename when using `ack` and explicitly scoping+" search to a single file (patch from Daniel Silva).+" - When using `ag`, report multiple matches per line instead of just the first+" (patch from Daniel Silva).+" - Improve content and display of error messages.+"+" ## 0.3 (24 July 2015)+"+" - Added highlighting of search pattern and related |g:FerretHlsearch| option+" (patch from Nelo-Thara Wallus).+" - Add better error reporting for failed or incorrect searches.+"+" ## 0.2 (16 July 2015)+"+" - Added |FerretDidWrite| and |FerretWillWrite| autocommands (patch from Joe+" Lencioni).+" - Add |<Plug>(FerretAcks)| mapping (patch from Nelo-Thara Wallus).+"+" ## 0.1 (8 July 2015)+"+" - Initial release, extracted from my dotfiles+" (https://github.com/wincent/wincent).++""+" @option g:FerretLoaded any+"+" To prevent Ferret from being loaded, set |g:FerretLoaded| to any value in your+" |.vimrc|. For example:+"+" ```+" let g:FerretLoaded=1+" ```+if exists('g:FerretLoaded') || &compatible || v:version < 700+ finish+endif+let g:FerretLoaded = 1++" Temporarily set 'cpoptions' to Vim default as per `:h use-cpo-save`.+let s:cpoptions = &cpoptions+set cpoptions&vim++if executable('ag') " The Silver Searcher: faster than ack.+ let s:ackprg = 'ag --vimgrep'+elseif executable('ack') " Ack: better than grep.+ let s:ackprg = 'ack --column --with-filename'+elseif executable('grep') " Grep: it's just grep.+ let s:ackprg = &grepprg " default is: grep -n $* /dev/null+endif++if !empty(s:ackprg)+ let &grepprg=s:ackprg+ set grepformat=%f:%l:%c:%m+endif++if has('autocmd')+ augroup Ferret+ autocmd!+ autocmd QuickFixCmdPost [^l]* nested cwindow+ autocmd QuickFixCmdPost l* nested lwindow+ augroup END+endif++""+" @command :Ack {pattern} {options}+"+" Searches for {pattern} in all the files under the current directory (see+" |:pwd|), unless otherwise overridden via {options}, and displays the results+" in the |quickfix| listing.+"+" `ag` (The Silver Searcher) will be used preferentially if present on the+" system, because it is faster, falling back to `ack` and then `grep` as needed.+"+" If dispatch.vim is installed the search process will run asynchronously via+" the |:Make| command, otherwise it will be run synchronously via |:cexpr|.+" Asynchronous searches are preferred because they do not block, despite the+" fact that Vim itself is single threaded. The |g:FerretDispatch| option can be+" used to prevent the use of dispatch.vim.+"+" The {pattern} is passed through as-is to the underlying search program, and no+" escaping is required other than preceding spaces by a single backslash. For+" example, to search for "\bfoo[0-9]{2} bar\b" (ie. using `ag`'s Perl-style+" regular expression syntax), you could do:+"+" ```+" :Ack \bfoo[0-9]{2}\ bar\b+" ```+"+" Likewise, {options} are passed through. In this example, we pass the `-w`+" option (to search on word boundaries), and scope the search to the "foo" and+" "bar" subdirectories: >+"+" ```+" :Ack -w something foo bar+" ```+"+" As a convenience <leader>a is set-up (|<Plug>(FerretAck)|) as a shortcut to+" enter |Cmdline-mode| with `:Ack` inserted on the |Cmdline|. Likewise <leader>s+" (|<Plug>(FerretAckWord)|) is a shortcut for running |:Ack| with the word+" currently under the cursor.+command! -nargs=+ -complete=customlist,ferret#private#ackcomplete Ack call ferret#private#ack(<f-args>)++""+" @command :Lack {pattern} {options}+"+" Just like |:Ack|, but instead of using the |quickfix| listing, which is global+" across an entire Vim instance, it uses the |location-list|, which is a+" per-window construct.+"+" Note that |:Lack| always runs synchronously via |:cexpr|, because dispatch.vim+" doesn't currently support the |location-list|.+command! -nargs=+ -complete=customlist,ferret#private#lackcomplete Lack call ferret#private#lack(<f-args>)++""+" @command :Acks /{pattern}/{replacement}/+"+" Takes all of the files currently in the |quickfix| listing and performs a+" substitution of all instances of {pattern} (a standard Vim search |pattern|)+" by {replacement}.+"+" A typical sequence consists of an |:Ack| invocation to populate the |quickfix|+" listing and then |:Acks| (mnemonic: "Ack substitute") to perform replacements.+" For example, to replace "foo" with "bar" across all files in the current+" directory:+"+" ```+" :Ack foo+" :Acks /foo/bar/+" ```+command! -nargs=1 Acks call ferret#private#acks(<q-args>)+command! FerretCancelAsync call ferret#private#async#cancel()+command! FerretPullAsync call ferret#private#async#pull()++nnoremap <Plug>(FerretAck) :Ack<space>+nnoremap <Plug>(FerretLack) :Lack<space>+nnoremap <Plug>(FerretAckWord) :Ack <C-r><C-w><CR>+nnoremap <Plug>(FerretAcks)+ \ :Acks <c-r>=(exists('g:ferret_lastsearch') ? '/' . g:ferret_lastsearch . '//' : ' ')<CR><Left>++""+" @option g:FerretMap boolean 1+"+" Controls whether to set up the Ferret mappings, such as |<Plug>(FerretAck)|+" (see |ferret-mappings| for a full list). To prevent any mapping from being+" configured, set to 0:+"+" ```+" let g:FerretMap=0+" ```+let s:map=get(g:, 'FerretMap', 1)+if s:map+ if !hasmapto('<Plug>(FerretAck)') && maparg('<leader>a', 'n') ==# ''+ ""+ " @mapping <Plug>(FerretAck)+ "+ " Ferret maps <leader>a to |<Plug>(FerretAck)|, which triggers the |:Ack|+ " command. To use an alternative mapping instead, create a different one in+ " your |.vimrc| instead using |:nmap|:+ "+ " ```+ " " Instead of <leader>a, use <leader>x.+ " nmap <leader>x <Plug>(FerretAck)+ " ```+ nmap <unique> <leader>a <Plug>(FerretAck)+ endif++ if !hasmapto('<Plug>FerretLack') && maparg('<leader>l', 'n') ==# ''+ ""+ " @mapping <Plug>(FerretLack)+ "+ " Ferret maps <leader>l to |<Plug>(FerretLack)|, which triggers the |:Lack|+ " command. To use an alternative mapping instead, create a different one in+ " your |.vimrc| instead using |:nmap|:+ "+ " ```+ " " Instead of <leader>l, use <leader>y.+ " nmap <leader>y <Plug>(FerretLack)+ " ```+ nmap <unique> <leader>l <Plug>(FerretLack)+ endif++ if !hasmapto('<Plug>(FerretAckWord)') && maparg('<leader>s', 'n') ==# ''+ ""+ " @mapping <Plug>(FerretAckWord)+ "+ " Ferret maps <leader>s (mnemonix: "selection) to |<Plug>(FerretAckWord)|,+ " which uses |:Ack| to search for the word currently under the cursor. To+ " use an alternative mapping instead, create a different one in your+ " |.vimrc| instead using |:nmap|:+ "+ " ```+ " " Instead of <leader>s, use <leader>z.+ " nmap <leader>z <Plug>(FerretAckWord)+ " ```+ nmap <unique> <leader>s <Plug>(FerretAckWord)+ endif++ if !hasmapto('<Plug>(FerretAcks)') && maparg('<leader>r', 'n') ==# ''+ ""+ " @mapping <Plug>(FerretAcks)+ "+ " Ferret maps <leader>r (mnemonic: "replace") to |<Plug>(FerretAcks)|, which+ " triggers the |:Acks| command and fills the prompt with the last search+ " term from Ferret. to use an alternative mapping instead, create a+ " different one in your |.vimrc| instead using |:nmap|:+ "+ " ```+ " " Instead of <leader>r, use <leader>u.+ " nmap <leader>u <Plug>(FerretAcks)+ " ```+ nmap <unique> <leader>r <Plug>(FerretAcks)+ endif+endif++""+" @command :Qargs+"+" This is a utility function that is used by the |:Acks| command but is also+" generally useful enough to warrant being exposed publicly.+"+" It takes the files currently in the |quickfix| listing and sets them as+" |:args| so that they can be operated on en masse via the |:argdo| command.+command! -bar Qargs execute 'args' ferret#private#qargs()++""+" @option g:FerretQFCommands boolean 1+"+" Controls whether to set up custom versions of the |quickfix| commands, |:cn|,+" |:cnf|, |:cp| an |:cpf|. These overrides vertically center the match within+" the viewport on each jump. To prevent the custom versions from being+" configured, set to 0:+"+" ```+" let g:FerretQFCommands=0+" ```+let s:commands=get(g:, 'FerretQFCommands', 1)+if s:commands+ " Keep quickfix result centered, if possible, when jumping from result to result.+ cabbrev <silent> <expr> cn ((getcmdtype() == ':' && getcmdpos() == 3) ? 'cn <bar> normal zz' : 'cn')+ cabbrev <silent> <expr> cnf ((getcmdtype() == ':' && getcmdpos() == 4) ? 'cnf <bar> normal zz' : 'cnf')+ cabbrev <silent> <expr> cp ((getcmdtype() == ':' && getcmdpos() == 3) ? 'cp <bar> normal zz' : 'cp')+ cabbrev <silent> <expr> cpf ((getcmdtype() == ':' && getcmdpos() == 4) ? 'cpf <bar> normal zz' : 'cpf')+endif++" Restore 'cpoptions' to its former value.+let &cpoptions = s:cpoptions+unlet s:cpoptions
+ tests/fixtures/integration/loupe/golden/ast.golden view
@@ -0,0 +1,2438 @@+Project+ [ DocBlock+ [ PluginAnnotation "loupe" "Loupe plug-in for Vim"+ , TOC+ [ "Intro"+ , "Installation"+ , "Mappings"+ , "Options"+ , "Overrides"+ , "Related"+ , "Website"+ , "License"+ , "Development"+ , "Authors"+ , "History"+ ]+ ]+ , HeadingAnnotation "Intro"+ , Blockquote+ [ Paragraph+ [ Plaintext "\"loupe"+ , Whitespace+ , Plaintext "(noun)"+ , BreakTag+ , Plaintext "a"+ , Whitespace+ , Plaintext "small"+ , Whitespace+ , Plaintext "magnifying"+ , Whitespace+ , Plaintext "glass"+ , Whitespace+ , Plaintext "used"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "jewelers"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "watchmakers.\""+ ]+ ]+ , LinkTargets [ "loupe-features" ]+ , Paragraph+ [ Plaintext "Loupe"+ , Whitespace+ , Plaintext "enhances"+ , Whitespace+ , Plaintext "Vim's"+ , Whitespace+ , Link "search-commands"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "four"+ , Whitespace+ , Plaintext "ways:"+ ]+ , SubheadingAnnotation+ "1. Makes the currently selected match easier to see"+ , Paragraph+ [ Plaintext "When"+ , Whitespace+ , Plaintext "searching"+ , Whitespace+ , Plaintext "using"+ , Whitespace+ , Link "/"+ , Plaintext ","+ , Whitespace+ , Link "?"+ , Plaintext ","+ , Whitespace+ , Link "star"+ , Plaintext ","+ , Whitespace+ , Link "#"+ , Plaintext ","+ , Whitespace+ , Link "n"+ , Plaintext ","+ , Whitespace+ , Link "N"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Plaintext "similar,"+ , Whitespace+ , Plaintext "it"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "be"+ , Whitespace+ , Plaintext "hard"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "see"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "\"current\""+ , Whitespace+ , Plaintext "match"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "among"+ , Whitespace+ , Plaintext "all"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "matches"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "'hlsearch'"+ , Whitespace+ , Plaintext "highlights."+ , Whitespace+ , Plaintext "Loupe"+ , Whitespace+ , Plaintext "makes"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "currently"+ , Whitespace+ , Plaintext "selected"+ , Whitespace+ , Plaintext "match"+ , Whitespace+ , Plaintext "easier"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "see"+ , Whitespace+ , Plaintext "by:"+ ]+ , List+ [ ListItem+ [ Plaintext "Applying"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "different"+ , Whitespace+ , Link ":highlight"+ , Whitespace+ , Plaintext "group"+ , Whitespace+ , Plaintext "(by"+ , Whitespace+ , Plaintext "default,"+ , Whitespace+ , Link "hl-IncSearch"+ , Plaintext ")"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "match"+ , Whitespace+ , Plaintext "under"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "cursor."+ ]+ , ListItem+ [ Plaintext "Keeping"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "matching"+ , Whitespace+ , Plaintext "line"+ , Whitespace+ , Plaintext "centered"+ , Whitespace+ , Plaintext "within"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "window"+ , Whitespace+ , Plaintext "when"+ , Whitespace+ , Plaintext "jumping"+ , Whitespace+ , Plaintext "between"+ , Whitespace+ , Plaintext "matches"+ , Whitespace+ , Plaintext "with"+ , Whitespace+ , Link "n"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Link "N"+ , Plaintext "."+ ]+ ]+ , SubheadingAnnotation "2. Applies sane pattern syntax by default"+ , Paragraph+ [ Plaintext "Loupe"+ , Whitespace+ , Plaintext "makes"+ , Whitespace+ , Plaintext "\"very"+ , Whitespace+ , Plaintext "magic\""+ , Whitespace+ , Plaintext "("+ , Link "/\\v"+ , Plaintext ")"+ , Whitespace+ , Plaintext "syntax"+ , Whitespace+ , Plaintext "apply"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "default"+ , Whitespace+ , Plaintext "when"+ , Whitespace+ , Plaintext "searching."+ , Whitespace+ , Plaintext "This"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "true"+ , Whitespace+ , Plaintext "even"+ , Whitespace+ , Plaintext "if"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "initiate"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "via"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "novel"+ , Whitespace+ , Plaintext "means,"+ , Whitespace+ , Plaintext "such"+ , Whitespace+ , Plaintext "as"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "visual"+ , Whitespace+ , Plaintext "selection"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Plaintext "with"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "complicated"+ , Whitespace+ , Link ":range"+ , Whitespace+ , Plaintext "prefix."+ ]+ , Paragraph+ [ Plaintext "This"+ , Whitespace+ , Plaintext "means"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "use"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "pattern"+ , Whitespace+ , Plaintext "syntax"+ , Whitespace+ , Plaintext "closer"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "familiar"+ , Whitespace+ , Plaintext "regular"+ , Whitespace+ , Plaintext "expression"+ , Whitespace+ , Plaintext "syntax"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "languages"+ , Whitespace+ , Plaintext "such"+ , Whitespace+ , Plaintext "as"+ , Whitespace+ , Plaintext "Perl,"+ , Whitespace+ , Plaintext "Ruby,"+ , Whitespace+ , Plaintext "JavaScript"+ , Whitespace+ , Plaintext "(indeed,"+ , Whitespace+ , Plaintext "most"+ , Whitespace+ , Plaintext "other"+ , Whitespace+ , Plaintext "modern"+ , Whitespace+ , Plaintext "languages"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "support"+ , Whitespace+ , Plaintext "regular"+ , Whitespace+ , Plaintext "expressions)."+ ]+ , SubheadingAnnotation+ "3. Provides a shortcut to remove search highlighting"+ , Paragraph+ [ Plaintext "Loupe"+ , Whitespace+ , Plaintext "maps"+ , Whitespace+ , Plaintext "<leader>n"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "quickly"+ , Whitespace+ , Plaintext "remove"+ , Whitespace+ , Plaintext "all"+ , Whitespace+ , Plaintext "'hlsearch'"+ , Whitespace+ , Plaintext "highlighting"+ , Whitespace+ , Plaintext "(although"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "provide"+ , Whitespace+ , Plaintext "an"+ , Whitespace+ , Plaintext "alternative"+ , Whitespace+ , Plaintext "mapping"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "your"+ , Whitespace+ , Plaintext "choosing"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Plaintext "suppress"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "feature"+ , Whitespace+ , Plaintext "entirely)."+ ]+ , SubheadingAnnotation+ "4. Sensible defaults for search-related features"+ , Paragraph+ [ Plaintext "Loupe"+ , Whitespace+ , Plaintext "provides"+ , Whitespace+ , Plaintext "reasonable"+ , Whitespace+ , Plaintext "defaults"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "most"+ , Whitespace+ , Plaintext "search-related"+ , Whitespace+ , Plaintext "Vim"+ , Whitespace+ , Plaintext "settings"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "provide"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "good"+ , Whitespace+ , Plaintext "\"out"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "box\""+ , Whitespace+ , Plaintext "experience."+ , Whitespace+ , Plaintext "For"+ , Whitespace+ , Plaintext "more"+ , Whitespace+ , Plaintext "details,"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "see"+ , Whitespace+ , Plaintext "how"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "override"+ , Whitespace+ , Plaintext "Loupe's"+ , Whitespace+ , Plaintext "settings,"+ , Whitespace+ , Plaintext "see"+ , Whitespace+ , Link "loupe-overrides"+ , Plaintext "."+ ]+ , HeadingAnnotation "Installation"+ , Paragraph+ [ Plaintext "To"+ , Whitespace+ , Plaintext "install"+ , Whitespace+ , Plaintext "Loupe,"+ , Whitespace+ , Plaintext "use"+ , Whitespace+ , Plaintext "your"+ , Whitespace+ , Plaintext "plug-in"+ , Whitespace+ , Plaintext "management"+ , Whitespace+ , Plaintext "system"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "choice."+ ]+ , Paragraph+ [ Plaintext "If"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "don't"+ , Whitespace+ , Plaintext "have"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "\"plug-in"+ , Whitespace+ , Plaintext "management"+ , Whitespace+ , Plaintext "system"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "choice\","+ , Whitespace+ , Plaintext "I"+ , Whitespace+ , Plaintext "recommend"+ , Whitespace+ , Plaintext "Pathogen"+ , Whitespace+ , Plaintext "(https://github.com/tpope/vim-pathogen)"+ , Whitespace+ , Plaintext "due"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "its"+ , Whitespace+ , Plaintext "simplicity"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "robustness."+ , Whitespace+ , Plaintext "Assuming"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "have"+ , Whitespace+ , Plaintext "Pathogen"+ , Whitespace+ , Plaintext "installed"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "configured,"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "want"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "install"+ , Whitespace+ , Plaintext "Loupe"+ , Whitespace+ , Plaintext "into"+ , Whitespace+ , Code "~/.vim/bundle"+ , Plaintext ","+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "do"+ , Whitespace+ , Plaintext "so"+ , Whitespace+ , Plaintext "with:"+ ]+ , Fenced+ [ "git clone https://github.com/wincent/loupe.git ~/.vim/bundle/loupe"+ ]+ , Paragraph+ [ Plaintext "Alternatively,"+ , Whitespace+ , Plaintext "if"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "use"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "Git"+ , Whitespace+ , Plaintext "submodule"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "each"+ , Whitespace+ , Plaintext "Vim"+ , Whitespace+ , Plaintext "plug-in,"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "could"+ , Whitespace+ , Plaintext "do"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "following"+ , Whitespace+ , Plaintext "after"+ , Whitespace+ , Code "cd"+ , Plaintext "-ing"+ , Whitespace+ , Plaintext "into"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "top-level"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "your"+ , Whitespace+ , Plaintext "Git"+ , Whitespace+ , Plaintext "superproject:"+ ]+ , Fenced+ [ "git submodule add https://github.com/wincent/loupe.git ~/vim/bundle/loupe"+ , "git submodule init"+ ]+ , Paragraph+ [ Plaintext "To"+ , Whitespace+ , Plaintext "generate"+ , Whitespace+ , Plaintext "help"+ , Whitespace+ , Plaintext "tags"+ , Whitespace+ , Plaintext "under"+ , Whitespace+ , Plaintext "Pathogen,"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "do"+ , Whitespace+ , Plaintext "so"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "inside"+ , Whitespace+ , Plaintext "Vim"+ , Whitespace+ , Plaintext "with:"+ ]+ , Fenced [ ":call pathogen#helptags()" ]+ , Project+ [ Unit+ [ FunctionDeclaration+ { functionBang = True+ , functionName = "loupe#private#very_magic_slash"+ , functionArguments = ArgumentList []+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement "if getcmdtype() != ':'"+ , GenericStatement "return '/'"+ , GenericStatement "endif"+ , LetStatement { letLexpr = "l:pos" , letValue = "getcmdpos()" }+ , LetStatement { letLexpr = "l:cmd" , letValue = "getcmdline()" }+ , GenericStatement "if len(l:cmd) + 1 != l:pos"+ , GenericStatement "return '/'"+ , GenericStatement "endif"+ , GenericStatement "while 1"+ , LetStatement+ { letLexpr = "l:stripped" , letValue = "s:strip_ranges(l:cmd)" }+ , GenericStatement "if l:stripped ==# l:cmd"+ , GenericStatement "break"+ , GenericStatement "else"+ , LetStatement { letLexpr = "l:cmd" , letValue = "l:stripped" }+ , GenericStatement "endif"+ , GenericStatement "endwhile"+ , GenericStatement "if index(['g', 's', 'v'], l:cmd) != -1"+ , GenericStatement "return loupe#private#prepare_highlight('/\\v')"+ , GenericStatement "endif"+ , GenericStatement "return '/'"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "s:strip_ranges"+ , functionArguments = ArgumentList [ Argument "cmdline" ]+ , functionAttributes = []+ , functionBody =+ [ LetStatement { letLexpr = "l:cmdline" , letValue = "a:cmdline" }+ , LetStatement+ { letLexpr = "l:modifier" , letValue = "'\\([+-]\\d*\\)*'" }+ , LetStatement+ { letLexpr = "l:cmdline"+ , letValue =+ "substitute(l:cmdline, '^\\d\\+' . l:modifier, '', '') \" line number"+ }+ , LetStatement+ { letLexpr = "l:cmdline"+ , letValue =+ "substitute(l:cmdline, '^\\.' . l:modifier, '', '') \" current line"+ }+ , LetStatement+ { letLexpr = "l:cmdline"+ , letValue =+ "substitute(l:cmdline, '^$' . l:modifier, '', '') \" last line in file"+ }+ , LetStatement+ { letLexpr = "l:cmdline"+ , letValue =+ "substitute(l:cmdline, '^%' . l:modifier, '', '') \" entire file"+ }+ , LetStatement+ { letLexpr = "l:cmdline"+ , letValue =+ "substitute(l:cmdline, \"^'[a-z]\\\\c\" . l:modifier, '', '') \" mark t (or T)"+ }+ , LetStatement+ { letLexpr = "l:cmdline"+ , letValue =+ "substitute(l:cmdline, \"^'[<>]\" . l:modifier, '', '') \" visual selection marks"+ }+ , LetStatement+ { letLexpr = "l:cmdline"+ , letValue =+ "substitute(l:cmdline, '^/[^/]\\+/' . l:modifier, '', '') \" /{pattern}/"+ }+ , LetStatement+ { letLexpr = "l:cmdline"+ , letValue =+ "substitute(l:cmdline, '^?[^?]\\+?' . l:modifier, '', '') \" ?{pattern}?"+ }+ , LetStatement+ { letLexpr = "l:cmdline"+ , letValue =+ "substitute(l:cmdline, '^\\\\/' . l:modifier, '', '') \" \\/ (next match of previous pattern)"+ }+ , LetStatement+ { letLexpr = "l:cmdline"+ , letValue =+ "substitute(l:cmdline, '^\\\\?' . l:modifier, '', '') \" \\? (last match of previous pattern)"+ }+ , LetStatement+ { letLexpr = "l:cmdline"+ , letValue =+ "substitute(l:cmdline, '^\\\\&' . l:modifier, '', '') \" \\& (last match of previous substitution)"+ }+ , LetStatement+ { letLexpr = "l:cmdline"+ , letValue = "substitute(l:cmdline, '^,', '', '') \" , (separator)"+ }+ , LetStatement+ { letLexpr = "l:cmdline"+ , letValue = "substitute(l:cmdline, '^;', '', '') \" ; (separator)"+ }+ , GenericStatement "return l:cmdline"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "loupe#private#prepare_highlight"+ , functionArguments = ArgumentList [ Argument "result" ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement "if has('autocmd')"+ , GenericStatement "augroup LoupeHightlightMatch"+ , GenericStatement "autocmd!"+ , GenericStatement+ "autocmd CursorMoved * :call loupe#private#hlmatch()"+ , GenericStatement "augroup END"+ , GenericStatement "endif"+ , GenericStatement "return a:result"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "loupe#private#clear_highlight"+ , functionArguments = ArgumentList []+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement "if exists('w:loupe_hlmatch')"+ , GenericStatement "try"+ , GenericStatement "call matchdelete(w:loupe_hlmatch)"+ , GenericStatement "catch /\\v<(E802|E803)>/"+ , GenericStatement "finally"+ , UnletStatement+ { unletBang = False , unletBody = "w:loupe_hlmatch" }+ , GenericStatement "endtry"+ , GenericStatement "endif"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "loupe#private#cleanup"+ , functionArguments = ArgumentList []+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement "if !v:hlsearch"+ , GenericStatement "call loupe#private#clear_highlight()"+ , GenericStatement "endif"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "loupe#private#hlmatch"+ , functionArguments = ArgumentList []+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ Empty+ , LetStatement+ { letLexpr = "l:highlight"+ , letValue = "get(g:, 'LoupeHighlightGroup', 'IncSearch')"+ }+ , GenericStatement "if empty(l:highlight)"+ , GenericStatement "return"+ , GenericStatement "endif"+ , GenericStatement "if has('autocmd')"+ , GenericStatement "augroup LoupeHightlightMatch"+ , GenericStatement "autocmd!"+ , GenericStatement "augroup END"+ , GenericStatement "endif"+ , GenericStatement "call loupe#private#clear_highlight()"+ , LetStatement+ { letLexpr = "l:pattern" , letValue = "'\\c\\%#' . @/" }+ , GenericStatement "if exists('*matchadd')"+ , LetStatement+ { letLexpr = "w:loupe_hlmatch"+ , letValue = "matchadd(l:highlight, l:pattern)"+ }+ , GenericStatement "endif"+ ]+ }+ ]+ , Unit+ [ GenericStatement+ "if exists('g:LoupeLoaded') || &compatible || v:version < 700"+ , GenericStatement "finish"+ , GenericStatement "endif"+ , LetStatement { letLexpr = "g:LoupeLoaded" , letValue = "1" }+ , LetStatement+ { letLexpr = "s:cpoptions" , letValue = "&cpoptions" }+ , GenericStatement "set cpoptions&vim"+ , GenericStatement "if &history < 1000"+ , GenericStatement+ "set history=1000 \" Longer search and command history (default is 50)."+ , GenericStatement "endif"+ , GenericStatement "if has('extra_search')"+ , GenericStatement "set hlsearch \" Highlight search strings."+ , GenericStatement+ "set incsearch \" Incremental search (\"find as you type\")."+ , GenericStatement "endif"+ , GenericStatement "set ignorecase \" Ignore case when searching."+ , GenericStatement+ "set shortmess+=s \" Don't echo search wrap messages."+ , GenericStatement+ "set smartcase \" Case-sensitive search if search string includes a capital letter."+ , LetStatement+ { letLexpr = "s:map"+ , letValue = "get(g:, 'LoupeClearHighlightMap', 1)"+ }+ , GenericStatement "if s:map"+ , GenericStatement+ "if !hasmapto('<Plug>(LoupeClearHighlight)') && maparg('<leader>n', 'n') ==# ''"+ , GenericStatement+ "nmap <silent> <unique> <leader>n <Plug>(LoupeClearHighlight)"+ , GenericStatement "endif"+ , GenericStatement "endif"+ , GenericStatement+ "nnoremap <silent> <Plug>(LoupeClearHighlight) :nohlsearch<CR> :call loupe#private#clear_highlight()<CR>"+ , GenericStatement+ "cabbrev <silent> <expr> noh (getcmdtype() == ':' && getcmdpos() == 4 ? 'noh <bar> call loupe#private#clear_highlight()<CR>' : 'noh')"+ , GenericStatement+ "cabbrev <silent> <expr> nohl (getcmdtype() == ':' && getcmdpos() == 5 ? 'nohl <bar> call loupe#private#clear_highlight()<CR>' : 'nohl')"+ , GenericStatement+ "cabbrev <silent> <expr> nohls (getcmdtype() == ':' && getcmdpos() == 6 ? 'nohls <bar> call loupe#private#clear_highlight()<CR>' : 'nohls')"+ , GenericStatement+ "cabbrev <silent> <expr> nohlse (getcmdtype() == ':' && getcmdpos() == 7 ? 'nohlse <bar> call loupe#private#clear_highlight()<CR>' : 'nohlse')"+ , GenericStatement+ "cabbrev <silent> <expr> nohlsea (getcmdtype() == ':' && getcmdpos() == 8 ? 'nohlsea <bar> call loupe#private#clear_highlight()<CR>' : 'nohlsea')"+ , GenericStatement+ "cabbrev <silent> <expr> nohlsear (getcmdtype() == ':' && getcmdpos() == 9 ? 'nohlsear <bar> call loupe#private#clear_highlight()<CR>' : 'nohlsear')"+ , GenericStatement+ "cabbrev <silent> <expr> nohlsearc (getcmdtype() == ':' && getcmdpos() == 10 ? 'nohlsearc <bar> call loupe#private#clear_highlight()<CR>' : 'nohlsearc')"+ , GenericStatement+ "cabbrev <silent> <expr> nohlsearch (getcmdtype() == ':' && getcmdpos() == 11 ? 'nohlsearch <bar> call loupe#private#clear_highlight()<CR>' : 'nohlsearch')"+ , FunctionDeclaration+ { functionBang = False+ , functionName = "s:MagicString"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody =+ [ LetStatement+ { letLexpr = "s:magic"+ , letValue = "get(g:, 'LoupeVeryMagic', 1)"+ }+ , GenericStatement "return s:magic ? '\\v' : ''"+ ]+ }+ , GenericStatement+ "nnoremap <expr> / loupe#private#prepare_highlight('/' . <SID>MagicString())"+ , GenericStatement+ "nnoremap <expr> ? loupe#private#prepare_highlight('?' . <SID>MagicString())"+ , GenericStatement+ "xnoremap <expr> / loupe#private#prepare_highlight('/' . <SID>MagicString())"+ , GenericStatement+ "xnoremap <expr> ? loupe#private#prepare_highlight('?' . <SID>MagicString())"+ , GenericStatement "if !empty(s:MagicString())"+ , GenericStatement+ "cnoremap <expr> / loupe#private#very_magic_slash()"+ , GenericStatement "endif"+ , LetStatement+ { letLexpr = "s:center"+ , letValue = "get(g:, 'LoupeCenterResults', 1)"+ }+ , LetStatement+ { letLexpr = "s:center_string"+ , letValue = "s:center ? 'zz' : ''"+ }+ , GenericStatement+ "execute 'nnoremap <silent> # #' . s:center_string . ':call loupe#private#hlmatch()<CR>'"+ , GenericStatement+ "execute 'nnoremap <silent> * *' . s:center_string . ':call loupe#private#hlmatch()<CR>'"+ , GenericStatement+ "execute 'nnoremap <silent> N N' . s:center_string . ':call loupe#private#hlmatch()<CR>'"+ , GenericStatement+ "execute 'nnoremap <silent> g# g#' . s:center_string . ':call loupe#private#hlmatch()<CR>'"+ , GenericStatement+ "execute 'nnoremap <silent> g* g*' . s:center_string . ':call loupe#private#hlmatch()<CR>'"+ , GenericStatement+ "execute 'nnoremap <silent> n n' . s:center_string . ':call loupe#private#hlmatch()<CR>'"+ , GenericStatement "if has('autocmd') && has('extra_search')"+ , GenericStatement "augroup LoupeCleanUp"+ , GenericStatement "autocmd!"+ , GenericStatement+ "autocmd WinEnter * :call loupe#private#cleanup()"+ , GenericStatement "augroup END"+ , GenericStatement "endif"+ , LetStatement+ { letLexpr = "&cpoptions" , letValue = "s:cpoptions" }+ , UnletStatement { unletBang = False , unletBody = "s:cpoptions" }+ ]+ ]+ , MappingsAnnotation+ , MappingAnnotation "<Plug>(LoupeClearHighlight)"+ , Paragraph+ [ Plaintext "Loupe"+ , Whitespace+ , Plaintext "maps"+ , Whitespace+ , Plaintext "<leader>n"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Link "<Plug>(LoupeClearHighlight)"+ , Plaintext ","+ , Whitespace+ , Plaintext "which"+ , Whitespace+ , Plaintext "clears"+ , Whitespace+ , Plaintext "all"+ , Whitespace+ , Plaintext "visible"+ , Whitespace+ , Plaintext "highlights"+ , Whitespace+ , Plaintext "(like"+ , Whitespace+ , Link ":nohighlight"+ , Whitespace+ , Plaintext "does)."+ , Whitespace+ , Plaintext "To"+ , Whitespace+ , Plaintext "use"+ , Whitespace+ , Plaintext "an"+ , Whitespace+ , Plaintext "alternative"+ , Whitespace+ , Plaintext "mapping"+ , Whitespace+ , Plaintext "instead,"+ , Whitespace+ , Plaintext "create"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "different"+ , Whitespace+ , Plaintext "one"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "your"+ , Whitespace+ , Link ".vimrc"+ , Whitespace+ , Plaintext "instead"+ , Whitespace+ , Plaintext "using"+ , Whitespace+ , Link ":nmap"+ , Plaintext ":"+ ]+ , Fenced+ [ "\" Instead of <leader>n, use <leader>x."+ , "nmap <leader>x <Plug>(LoupeClearHighlight)"+ ]+ , Paragraph+ [ Plaintext "Note"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "Loupe"+ , Whitespace+ , Plaintext "will"+ , Whitespace+ , Plaintext "not"+ , Whitespace+ , Plaintext "try"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Plaintext "up"+ , Whitespace+ , Plaintext "its"+ , Whitespace+ , Plaintext "<leader>n"+ , Whitespace+ , Plaintext "mapping"+ , Whitespace+ , Plaintext "if"+ , Whitespace+ , Plaintext "any"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "following"+ , Whitespace+ , Plaintext "are"+ , Whitespace+ , Plaintext "true:"+ ]+ , List+ [ ListItem+ [ Plaintext "A"+ , Whitespace+ , Plaintext "mapping"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "<leader>n"+ , Whitespace+ , Plaintext "already"+ , Whitespace+ , Plaintext "exists."+ ]+ , ListItem+ [ Plaintext "An"+ , Whitespace+ , Plaintext "alternative"+ , Whitespace+ , Plaintext "mapping"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Link "<Plug>(LoupeClearHighlight)"+ , Whitespace+ , Plaintext "has"+ , Whitespace+ , Plaintext "already"+ , Whitespace+ , Plaintext "been"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Plaintext "up"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Link ".vimrc"+ , Plaintext "."+ ]+ , ListItem+ [ Plaintext "The"+ , Whitespace+ , Plaintext "mapping"+ , Whitespace+ , Plaintext "has"+ , Whitespace+ , Plaintext "been"+ , Whitespace+ , Plaintext "suppressed"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "setting"+ , Whitespace+ , Link "g:LoupeClearHighlightMap"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "1"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "your"+ , Whitespace+ , Link ".vimrc"+ , Plaintext "."+ ]+ ]+ , OptionsAnnotation+ , OptionAnnotation+ "g:LoupeHighlightGroup" "string" (Just "IncSearch")+ , Paragraph+ [ Plaintext "Specifies"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link ":highlight"+ , Whitespace+ , Plaintext "group"+ , Whitespace+ , Plaintext "used"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "emphasize"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "match"+ , Whitespace+ , Plaintext "currently"+ , Whitespace+ , Plaintext "under"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "cursor"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "current"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "pattern."+ , Whitespace+ , Plaintext "Defaults"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "\"IncSearch\""+ , Whitespace+ , Plaintext "(ie."+ , Whitespace+ , Link "hl-IncSearch"+ , Plaintext ")."+ , Whitespace+ , Plaintext "For"+ , Whitespace+ , Plaintext "example:"+ ]+ , Fenced [ "let g:LoupeHighlightGroup='Error'" ]+ , Paragraph+ [ Plaintext "To"+ , Whitespace+ , Plaintext "prevent"+ , Whitespace+ , Plaintext "any"+ , Whitespace+ , Plaintext "special"+ , Whitespace+ , Plaintext "highlighting"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "being"+ , Whitespace+ , Plaintext "applied,"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Plaintext "this"+ , Whitespace+ , Plaintext "option"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "\"\""+ , Whitespace+ , Plaintext "(ie."+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "empty"+ , Whitespace+ , Plaintext "string)."+ ]+ , OptionAnnotation "g:LoupeLoaded" "any" Nothing+ , Paragraph+ [ Plaintext "To"+ , Whitespace+ , Plaintext "prevent"+ , Whitespace+ , Plaintext "Loupe"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "being"+ , Whitespace+ , Plaintext "loaded,"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Link "g:LoupeLoaded"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "any"+ , Whitespace+ , Plaintext "value"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "your"+ , Whitespace+ , Link ".vimrc"+ , Plaintext "."+ , Whitespace+ , Plaintext "For"+ , Whitespace+ , Plaintext "example:"+ ]+ , Fenced [ "let g:LoupeLoaded=1" ]+ , OptionAnnotation "g:LoupeClearHighlightMap" "boolean" (Just "1")+ , Paragraph+ [ Plaintext "Controls"+ , Whitespace+ , Plaintext "whether"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Plaintext "up"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link "<Plug>(LoupeClearHighlight)"+ , Whitespace+ , Plaintext "mapping."+ , Whitespace+ , Plaintext "To"+ , Whitespace+ , Plaintext "prevent"+ , Whitespace+ , Plaintext "any"+ , Whitespace+ , Plaintext "mapping"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "being"+ , Whitespace+ , Plaintext "configured,"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "0:"+ ]+ , Fenced [ "let g:LoupeClearHighlightMap=0" ]+ , OptionAnnotation "g:LoupeVeryMagic" "boolean" (Just "1")+ , Paragraph+ [ Plaintext "Controls"+ , Whitespace+ , Plaintext "whether"+ , Whitespace+ , Plaintext "\"very"+ , Whitespace+ , Plaintext "magic\""+ , Whitespace+ , Plaintext "pattern"+ , Whitespace+ , Plaintext "syntax"+ , Whitespace+ , Plaintext "("+ , Link "/\\v"+ , Plaintext ")"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "applied"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "default."+ , Whitespace+ , Plaintext "To"+ , Whitespace+ , Plaintext "disable,"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "0:"+ ]+ , Fenced [ "let g:LoupeVeryMagic=0" ]+ , OptionAnnotation "g:LoupeCenterResults" "boolean" (Just "1")+ , Paragraph+ [ Plaintext "Controls"+ , Whitespace+ , Plaintext "whether"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "match's"+ , Whitespace+ , Plaintext "line"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "vertically"+ , Whitespace+ , Plaintext "centered"+ , Whitespace+ , Plaintext "within"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "window"+ , Whitespace+ , Plaintext "when"+ , Whitespace+ , Plaintext "jumping"+ , Whitespace+ , Plaintext "(via"+ , Whitespace+ , Link "n"+ , Plaintext ","+ , Whitespace+ , Link "N"+ , Whitespace+ , Plaintext "etc)."+ , Whitespace+ , Plaintext "To"+ , Whitespace+ , Plaintext "disable,"+ , Whitespace+ , Plaintext "set"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "0:"+ ]+ , Fenced [ "let g:LoupeCenterResults=0" ]+ , FooterAnnotation+ , HeadingAnnotation "Overrides"+ , Paragraph+ [ Plaintext "Loupe"+ , Whitespace+ , Plaintext "sets"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "number"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "search-related"+ , Whitespace+ , Plaintext "Vim"+ , Whitespace+ , Plaintext "settings"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "reasonable"+ , Whitespace+ , Plaintext "defaults"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "order"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "provide"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "good"+ , Whitespace+ , Plaintext "\"out"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "box\""+ , Whitespace+ , Plaintext "experience:"+ ]+ , IndentAnnotation+ , LinkTargets [ "loupe-history-override" ]+ , Paragraph [ Plaintext "'history'" ]+ , Paragraph+ [ Plaintext "Increased"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "1000,"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "increase"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "number"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "previous"+ , Whitespace+ , Plaintext "searches"+ , Whitespace+ , Plaintext "remembered."+ , Whitespace+ , Plaintext "Note"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "Loupe"+ , Whitespace+ , Plaintext "only"+ , Whitespace+ , Plaintext "applies"+ , Whitespace+ , Plaintext "this"+ , Whitespace+ , Plaintext "setting"+ , Whitespace+ , Plaintext "if"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "current"+ , Whitespace+ , Plaintext "value"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "'history'"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "less"+ , Whitespace+ , Plaintext "than"+ , Whitespace+ , Plaintext "1000."+ ]+ , LinkTargets [ "loupe-hlsearch-override" ]+ , Paragraph [ Plaintext "'hlsearch'" ]+ , Paragraph+ [ Plaintext "Turned"+ , Whitespace+ , Plaintext "on"+ , Whitespace+ , Plaintext "(when"+ , Whitespace+ , Plaintext "there"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "previous"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "pattern,"+ , Whitespace+ , Plaintext "highlight"+ , Whitespace+ , Plaintext "all"+ , Whitespace+ , Plaintext "its"+ , Whitespace+ , Plaintext "matches)."+ ]+ , LinkTargets [ "loupe-incsearch-override" ]+ , Paragraph [ Plaintext "'incsearch'" ]+ , Paragraph+ [ Plaintext "Turned"+ , Whitespace+ , Plaintext "on"+ , Whitespace+ , Plaintext "(while"+ , Whitespace+ , Plaintext "typing"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "command,"+ , Whitespace+ , Plaintext "show"+ , Whitespace+ , Plaintext "where"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "pattern"+ , Whitespace+ , Plaintext "matches,"+ , Whitespace+ , Plaintext "as"+ , Whitespace+ , Plaintext "it"+ , Whitespace+ , Plaintext "was"+ , Whitespace+ , Plaintext "typed"+ , Whitespace+ , Plaintext "so"+ , Whitespace+ , Plaintext "far)."+ ]+ , LinkTargets [ "loupe-ignorecase-override" ]+ , Paragraph [ Plaintext "'ignorecase'" ]+ , Paragraph+ [ Plaintext "Turned"+ , Whitespace+ , Plaintext "on"+ , Whitespace+ , Plaintext "(to"+ , Whitespace+ , Plaintext "ignore"+ , Whitespace+ , Plaintext "case"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "patterns)."+ ]+ , LinkTargets [ "loupe-shortmess-override" ]+ , Paragraph [ Plaintext "'shortmess'" ]+ , Paragraph+ [ Plaintext "Adds"+ , Whitespace+ , Plaintext "\"s\","+ , Whitespace+ , Plaintext "which"+ , Whitespace+ , Plaintext "suppresses"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "display"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "\"search"+ , Whitespace+ , Plaintext "hit"+ , Whitespace+ , Plaintext "BOTTOM,"+ , Whitespace+ , Plaintext "continuing"+ , Whitespace+ , Plaintext "at"+ , Whitespace+ , Plaintext "TOP\""+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "\"search"+ , Whitespace+ , Plaintext "hit"+ , Whitespace+ , Plaintext "TOP,"+ , Whitespace+ , Plaintext "continuing"+ , Whitespace+ , Plaintext "at"+ , Whitespace+ , Plaintext "BOTTOM\""+ , Whitespace+ , Plaintext "messages."+ ]+ , LinkTargets [ "loupe-smartcase-override" ]+ , Paragraph [ Plaintext "'smartcase'" ]+ , Paragraph+ [ Plaintext "Turned"+ , Whitespace+ , Plaintext "on"+ , Whitespace+ , Plaintext "(overrides"+ , Whitespace+ , Plaintext "'ignorecase',"+ , Whitespace+ , Plaintext "making"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "pattern"+ , Whitespace+ , Plaintext "case-sensitive"+ , Whitespace+ , Plaintext "whenever"+ , Whitespace+ , Plaintext "it"+ , Whitespace+ , Plaintext "containers"+ , Whitespace+ , Plaintext "uppercase"+ , Whitespace+ , Plaintext "characters)."+ ]+ , DedentAnnotation+ , Paragraph+ [ Plaintext "To"+ , Whitespace+ , Plaintext "override"+ , Whitespace+ , Plaintext "any"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "these"+ , Whitespace+ , Plaintext "choices,"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "place"+ , Whitespace+ , Plaintext "overrides"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "an"+ , Whitespace+ , Link "after-directory"+ , Whitespace+ , Plaintext "(ie."+ , Whitespace+ , Code "~/.vim/after/plugin/loupe.vim"+ , Plaintext ")."+ , Whitespace+ , Plaintext "For"+ , Whitespace+ , Plaintext "example:"+ ]+ , Fenced+ [ " \" Override Loupe's 'history' setting from 1000 to 10000."+ , " set history=10000"+ , ""+ , " \" Reset Loupe's 'incsearch' back to Vim default."+ , " set incsearch&vim"+ , ""+ , " \" Remove unwanted 's' from 'shortmess'."+ , " set shortmess-=s"+ ]+ , HeadingAnnotation "Related"+ , Paragraph+ [ Plaintext "Just"+ , Whitespace+ , Plaintext "as"+ , Whitespace+ , Plaintext "Loupe"+ , Whitespace+ , Plaintext "aims"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "improve"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "within-file"+ , Whitespace+ , Plaintext "search"+ , Whitespace+ , Plaintext "experience,"+ , Whitespace+ , Plaintext "Ferret"+ , Whitespace+ , Plaintext "does"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "same"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "multi-file"+ , Whitespace+ , Plaintext "searching"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "replacing:"+ ]+ , List+ [ ListItem [ Plaintext "https://github.com/wincent/ferret" ] ]+ , HeadingAnnotation "Website"+ , Paragraph+ [ Plaintext "The"+ , Whitespace+ , Plaintext "official"+ , Whitespace+ , Plaintext "Loupe"+ , Whitespace+ , Plaintext "source"+ , Whitespace+ , Plaintext "code"+ , Whitespace+ , Plaintext "repo"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "at:"+ ]+ , List+ [ ListItem [ Plaintext "http://git.wincent.com/loupe.git" ] ]+ , Paragraph+ [ Plaintext "A"+ , Whitespace+ , Plaintext "mirror"+ , Whitespace+ , Plaintext "exists"+ , Whitespace+ , Plaintext "at:"+ ]+ , List+ [ ListItem [ Plaintext "https://github.com/wincent/loupe" ] ]+ , Paragraph+ [ Plaintext "Official"+ , Whitespace+ , Plaintext "releases"+ , Whitespace+ , Plaintext "are"+ , Whitespace+ , Plaintext "listed"+ , Whitespace+ , Plaintext "at:"+ ]+ , List+ [ ListItem+ [ Plaintext "http://www.vim.org/scripts/script.php?script_id=5215"+ ]+ ]+ , HeadingAnnotation "License"+ , Paragraph+ [ Plaintext "Copyright"+ , Whitespace+ , Plaintext "2015-present"+ , Whitespace+ , Plaintext "Greg"+ , Whitespace+ , Plaintext "Hurrell."+ , Whitespace+ , Plaintext "All"+ , Whitespace+ , Plaintext "rights"+ , Whitespace+ , Plaintext "reserved."+ ]+ , Paragraph+ [ Plaintext "Redistribution"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "use"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "source"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "binary"+ , Whitespace+ , Plaintext "forms,"+ , Whitespace+ , Plaintext "with"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Plaintext "without"+ , Whitespace+ , Plaintext "modification,"+ , Whitespace+ , Plaintext "are"+ , Whitespace+ , Plaintext "permitted"+ , Whitespace+ , Plaintext "provided"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "following"+ , Whitespace+ , Plaintext "conditions"+ , Whitespace+ , Plaintext "are"+ , Whitespace+ , Plaintext "met:"+ ]+ , Paragraph+ [ Plaintext "1."+ , Whitespace+ , Plaintext "Redistributions"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "source"+ , Whitespace+ , Plaintext "code"+ , Whitespace+ , Plaintext "must"+ , Whitespace+ , Plaintext "retain"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "above"+ , Whitespace+ , Plaintext "copyright"+ , Whitespace+ , Plaintext "notice,"+ , Whitespace+ , Plaintext "this"+ , Whitespace+ , Plaintext "list"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "conditions"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "following"+ , Whitespace+ , Plaintext "disclaimer."+ ]+ , Paragraph+ [ Plaintext "2."+ , Whitespace+ , Plaintext "Redistributions"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "binary"+ , Whitespace+ , Plaintext "form"+ , Whitespace+ , Plaintext "must"+ , Whitespace+ , Plaintext "reproduce"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "above"+ , Whitespace+ , Plaintext "copyright"+ , Whitespace+ , Plaintext "notice,"+ , Whitespace+ , Plaintext "this"+ , Whitespace+ , Plaintext "list"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "conditions"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "following"+ , Whitespace+ , Plaintext "disclaimer"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "documentation"+ , Whitespace+ , Plaintext "and/or"+ , Whitespace+ , Plaintext "other"+ , Whitespace+ , Plaintext "materials"+ , Whitespace+ , Plaintext "provided"+ , Whitespace+ , Plaintext "with"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "distribution."+ ]+ , Paragraph+ [ Plaintext "THIS"+ , Whitespace+ , Plaintext "SOFTWARE"+ , Whitespace+ , Plaintext "IS"+ , Whitespace+ , Plaintext "PROVIDED"+ , Whitespace+ , Plaintext "BY"+ , Whitespace+ , Plaintext "THE"+ , Whitespace+ , Plaintext "COPYRIGHT"+ , Whitespace+ , Plaintext "HOLDERS"+ , Whitespace+ , Plaintext "AND"+ , Whitespace+ , Plaintext "CONTRIBUTORS"+ , Whitespace+ , Plaintext "\"AS"+ , Whitespace+ , Plaintext "IS\""+ , Whitespace+ , Plaintext "AND"+ , Whitespace+ , Plaintext "ANY"+ , Whitespace+ , Plaintext "EXPRESS"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "IMPLIED"+ , Whitespace+ , Plaintext "WARRANTIES,"+ , Whitespace+ , Plaintext "INCLUDING,"+ , Whitespace+ , Plaintext "BUT"+ , Whitespace+ , Plaintext "NOT"+ , Whitespace+ , Plaintext "LIMITED"+ , Whitespace+ , Plaintext "TO,"+ , Whitespace+ , Plaintext "THE"+ , Whitespace+ , Plaintext "IMPLIED"+ , Whitespace+ , Plaintext "WARRANTIES"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "MERCHANTABILITY"+ , Whitespace+ , Plaintext "AND"+ , Whitespace+ , Plaintext "FITNESS"+ , Whitespace+ , Plaintext "FOR"+ , Whitespace+ , Plaintext "A"+ , Whitespace+ , Plaintext "PARTICULAR"+ , Whitespace+ , Plaintext "PURPOSE"+ , Whitespace+ , Plaintext "ARE"+ , Whitespace+ , Plaintext "DISCLAIMED."+ , Whitespace+ , Plaintext "IN"+ , Whitespace+ , Plaintext "NO"+ , Whitespace+ , Plaintext "EVENT"+ , Whitespace+ , Plaintext "SHALL"+ , Whitespace+ , Plaintext "THE"+ , Whitespace+ , Plaintext "COPYRIGHT"+ , Whitespace+ , Plaintext "HOLDERS"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "CONTRIBUTORS"+ , Whitespace+ , Plaintext "BE"+ , Whitespace+ , Plaintext "LIABLE"+ , Whitespace+ , Plaintext "FOR"+ , Whitespace+ , Plaintext "ANY"+ , Whitespace+ , Plaintext "DIRECT,"+ , Whitespace+ , Plaintext "INDIRECT,"+ , Whitespace+ , Plaintext "INCIDENTAL,"+ , Whitespace+ , Plaintext "SPECIAL,"+ , Whitespace+ , Plaintext "EXEMPLARY,"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "CONSEQUENTIAL"+ , Whitespace+ , Plaintext "DAMAGES"+ , Whitespace+ , Plaintext "(INCLUDING,"+ , Whitespace+ , Plaintext "BUT"+ , Whitespace+ , Plaintext "NOT"+ , Whitespace+ , Plaintext "LIMITED"+ , Whitespace+ , Plaintext "TO,"+ , Whitespace+ , Plaintext "PROCUREMENT"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "SUBSTITUTE"+ , Whitespace+ , Plaintext "GOODS"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "SERVICES;"+ , Whitespace+ , Plaintext "LOSS"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "USE,"+ , Whitespace+ , Plaintext "DATA,"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "PROFITS;"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "BUSINESS"+ , Whitespace+ , Plaintext "INTERRUPTION)"+ , Whitespace+ , Plaintext "HOWEVER"+ , Whitespace+ , Plaintext "CAUSED"+ , Whitespace+ , Plaintext "AND"+ , Whitespace+ , Plaintext "ON"+ , Whitespace+ , Plaintext "ANY"+ , Whitespace+ , Plaintext "THEORY"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "LIABILITY,"+ , Whitespace+ , Plaintext "WHETHER"+ , Whitespace+ , Plaintext "IN"+ , Whitespace+ , Plaintext "CONTRACT,"+ , Whitespace+ , Plaintext "STRICT"+ , Whitespace+ , Plaintext "LIABILITY,"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "TORT"+ , Whitespace+ , Plaintext "(INCLUDING"+ , Whitespace+ , Plaintext "NEGLIGENCE"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "OTHERWISE)"+ , Whitespace+ , Plaintext "ARISING"+ , Whitespace+ , Plaintext "IN"+ , Whitespace+ , Plaintext "ANY"+ , Whitespace+ , Plaintext "WAY"+ , Whitespace+ , Plaintext "OUT"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "THE"+ , Whitespace+ , Plaintext "USE"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "THIS"+ , Whitespace+ , Plaintext "SOFTWARE,"+ , Whitespace+ , Plaintext "EVEN"+ , Whitespace+ , Plaintext "IF"+ , Whitespace+ , Plaintext "ADVISED"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "THE"+ , Whitespace+ , Plaintext "POSSIBILITY"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "SUCH"+ , Whitespace+ , Plaintext "DAMAGE."+ ]+ , HeadingAnnotation "Development"+ , SubheadingAnnotation "Contributing patches"+ , Paragraph+ [ Plaintext "Patches"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "be"+ , Whitespace+ , Plaintext "sent"+ , Whitespace+ , Plaintext "via"+ , Whitespace+ , Plaintext "mail"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "greg@hurrell.net,"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Plaintext "as"+ , Whitespace+ , Plaintext "GitHub"+ , Whitespace+ , Plaintext "pull"+ , Whitespace+ , Plaintext "requests"+ , Whitespace+ , Plaintext "at:"+ , Whitespace+ , Plaintext "https://github.com/wincent/loupe/pulls"+ ]+ , SubheadingAnnotation "Cutting a new release"+ , Paragraph+ [ Plaintext "At"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "moment"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "release"+ , Whitespace+ , Plaintext "process"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "manual:"+ ]+ , List+ [ ListItem+ [ Plaintext "Perform"+ , Whitespace+ , Plaintext "final"+ , Whitespace+ , Plaintext "sanity"+ , Whitespace+ , Plaintext "checks"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "manual"+ , Whitespace+ , Plaintext "testing"+ ]+ , ListItem+ [ Plaintext "Update"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link "loupe-history"+ , Whitespace+ , Plaintext "section"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "documentation"+ ]+ , ListItem+ [ Plaintext "Verify"+ , Whitespace+ , Plaintext "clean"+ , Whitespace+ , Plaintext "work"+ , Whitespace+ , Plaintext "tree:"+ ]+ ]+ , Fenced [ "git status" ]+ , List+ [ ListItem+ [ Plaintext "Tag"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "release:"+ ]+ ]+ , Fenced [ "git tag -s -m \"$VERSION release\" $VERSION" ]+ , List+ [ ListItem+ [ Plaintext "Publish"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "code:"+ ]+ ]+ , Fenced+ [ "git push origin master --follow-tags"+ , "git push github master --follow-tags"+ ]+ , List+ [ ListItem+ [ Plaintext "Produce"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "release"+ , Whitespace+ , Plaintext "archive:"+ ]+ ]+ , Fenced [ "git archive -o loupe-$VERSION.zip HEAD -- ." ]+ , List+ [ ListItem+ [ Plaintext "Upload"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "http://www.vim.org/scripts/script.php?script_id=5215"+ ]+ ]+ , HeadingAnnotation "Authors"+ , Paragraph+ [ Plaintext "Loupe"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "written"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "maintained"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "Greg"+ , Whitespace+ , Plaintext "Hurrell"+ , Whitespace+ , Plaintext "<greg@hurrell.net>."+ ]+ , Paragraph+ [ Plaintext "The"+ , Whitespace+ , Plaintext "original"+ , Whitespace+ , Plaintext "idea"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link "g:LoupeHighlightGroup"+ , Whitespace+ , Plaintext "feature"+ , Whitespace+ , Plaintext "was"+ , Whitespace+ , Plaintext "taken"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "Damian"+ , Whitespace+ , Plaintext "Conway's"+ , Whitespace+ , Plaintext "Vim"+ , Whitespace+ , Plaintext "set-up:"+ ]+ , List+ [ ListItem+ [ Plaintext+ "https://github.com/thoughtstream/Damian-Conway-s-Vim-Setup/blob/master/plugin/hlnext.vim"+ ]+ ]+ , Paragraph+ [ Plaintext "Which"+ , Whitespace+ , Plaintext "he"+ , Whitespace+ , Plaintext "discussed"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "his"+ , Whitespace+ , Plaintext "\"More"+ , Whitespace+ , Plaintext "Instantly"+ , Whitespace+ , Plaintext "Better"+ , Whitespace+ , Plaintext "Vim\""+ , Whitespace+ , Plaintext "presentation"+ , Whitespace+ , Plaintext "at"+ , Whitespace+ , Plaintext "OSCON"+ , Whitespace+ , Plaintext "2013:"+ ]+ , List+ [ ListItem+ [ Plaintext "https://www.youtube.com/watch?v=aHm36-na4-4" ]+ ]+ , HeadingAnnotation "History"+ , SubheadingAnnotation "1.0 (28 December 2015)"+ , List+ [ ListItem+ [ Plaintext "Renamed"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link "<Plug>LoupeClearHighlight"+ , Whitespace+ , Plaintext "mapping"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Link "<Plug>(LoupeClearHighlight)"+ , Plaintext "."+ ]+ ]+ , SubheadingAnnotation "0.1 (5 July 2015)"+ , List+ [ ListItem+ [ Plaintext "Initial"+ , Whitespace+ , Plaintext "release,"+ , Whitespace+ , Plaintext "extracted"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "my"+ , Whitespace+ , Plaintext "dotfiles"+ , Whitespace+ , Plaintext "(https://github.com/wincent/wincent)."+ ]+ ]+ ]
+ tests/fixtures/integration/loupe/golden/markdown.golden view
@@ -0,0 +1,258 @@+# loupe<a name="loupe-loupe" href="#user-content-loupe-loupe"></a>++## Intro<a name="loupe-intro" href="#user-content-loupe-intro"></a>++> "loupe (noun)<br />a small magnifying glass used by jewelers and watchmakers."++<p align="right"><a name="loupe-features" href="#user-content-loupe-features"><code>loupe-features</code></a></p>+Loupe enhances Vim's <strong>`search-commands`</strong> in four ways:++### 1. Makes the currently selected match easier to see<a name="loupe-1-makes-the-currently-selected-match-easier-to-see" href="#user-content-loupe-1-makes-the-currently-selected-match-easier-to-see"></a>++When searching using <strong>`/`</strong>, <strong>`?`</strong>, <strong>`star`</strong>, <strong>`#`</strong>, <strong>`n`</strong>, <strong>`N`</strong> or similar, it can be hard to see the "current" match from among all the matches that 'hlsearch' highlights. Loupe makes the currently selected match easier to see by:++- Applying a different <strong>`:highlight`</strong> group (by default, <strong>`hl-IncSearch`</strong>) to the match under the cursor.+- Keeping the matching line centered within the window when jumping between matches with <strong>`n`</strong> and <strong>`N`</strong>.++### 2. Applies sane pattern syntax by default<a name="loupe-2-applies-sane-pattern-syntax-by-default" href="#user-content-loupe-2-applies-sane-pattern-syntax-by-default"></a>++Loupe makes "very magic" (<strong>`/\v`</strong>) syntax apply by default when searching. This is true even if you initiate a search via a novel means, such as from a visual selection or with a complicated <strong>`:range`</strong> prefix.++This means that you can use a pattern syntax closer to the familiar regular expression syntax from languages such as Perl, Ruby, JavaScript (indeed, most other modern languages that support regular expressions).++### 3. Provides a shortcut to remove search highlighting<a name="loupe-3-provides-a-shortcut-to-remove-search-highlighting" href="#user-content-loupe-3-provides-a-shortcut-to-remove-search-highlighting"></a>++Loupe maps <leader>n to quickly remove all 'hlsearch' highlighting (although you can provide an alternative mapping of your choosing or suppress the feature entirely).++### 4. Sensible defaults for search-related features<a name="loupe-4-sensible-defaults-for-search-related-features" href="#user-content-loupe-4-sensible-defaults-for-search-related-features"></a>++Loupe provides reasonable defaults for most search-related Vim settings to provide a good "out of the box" experience. For more details, or to see how to override Loupe's settings, see <strong>[`loupe-overrides`](#user-content-loupe-overrides)</strong>.++## Installation<a name="loupe-installation" href="#user-content-loupe-installation"></a>++To install Loupe, use your plug-in management system of choice.++If you don't have a "plug-in management system of choice", I recommend Pathogen (https://github.com/tpope/vim-pathogen) due to its simplicity and robustness. Assuming that you have Pathogen installed and configured, and that you want to install Loupe into `~/.vim/bundle`, you can do so with:++```+git clone https://github.com/wincent/loupe.git ~/.vim/bundle/loupe+```++Alternatively, if you use a Git submodule for each Vim plug-in, you could do the following after `cd`-ing into the top-level of your Git superproject:++```+git submodule add https://github.com/wincent/loupe.git ~/vim/bundle/loupe+git submodule init+```++To generate help tags under Pathogen, you can do so from inside Vim with:++```+:call pathogen#helptags()+```++## Mappings<a name="loupe-mappings" href="#user-content-loupe-mappings"></a>++### `<Plug>(LoupeClearHighlight)`<a name="loupe-plugloupeclearhighlight" href="#user-content-loupe-plugloupeclearhighlight"></a>++Loupe maps <leader>n to <strong>[`<Plug>(LoupeClearHighlight)`](#user-content-plugloupeclearhighlight)</strong>, which clears all visible highlights (like <strong>`:nohighlight`</strong> does). To use an alternative mapping instead, create a different one in your <strong>`.vimrc`</strong> instead using <strong>`:nmap`</strong>:++```+" Instead of <leader>n, use <leader>x.+nmap <leader>x <Plug>(LoupeClearHighlight)+```++Note that Loupe will not try to set up its <leader>n mapping if any of the following are true:++- A mapping for <leader>n already exists.+- An alternative mapping for <strong>[`<Plug>(LoupeClearHighlight)`](#user-content-plugloupeclearhighlight)</strong> has already been set up from a <strong>`.vimrc`</strong>.+- The mapping has been suppressed by setting <strong>`g:LoupeClearHighlightMap`</strong> to 1 in your <strong>`.vimrc`</strong>.++## Options<a name="loupe-options" href="#user-content-loupe-options"></a>++<p align="right"><a name="gloupehighlightgroup" href="#user-content-gloupehighlightgroup"><code>g:LoupeHighlightGroup</code></a></p>+### `g:LoupeHighlightGroup` (string, default: IncSearch)<a name="loupe-gloupehighlightgroup-string-default-incsearch" href="#user-content-loupe-gloupehighlightgroup-string-default-incsearch"></a>++Specifies the <strong>`:highlight`</strong> group used to emphasize the match currently under the cursor for the current search pattern. Defaults to "IncSearch" (ie. <strong>`hl-IncSearch`</strong>). For example:++```+let g:LoupeHighlightGroup='Error'+```++To prevent any special highlighting from being applied, set this option to "" (ie. the empty string).++<p align="right"><a name="gloupeloaded" href="#user-content-gloupeloaded"><code>g:LoupeLoaded</code></a></p>+### `g:LoupeLoaded` (any, default: none)<a name="loupe-gloupeloaded-any-default-none" href="#user-content-loupe-gloupeloaded-any-default-none"></a>++To prevent Loupe from being loaded, set <strong>`g:LoupeLoaded`</strong> to any value in your <strong>`.vimrc`</strong>. For example:++```+let g:LoupeLoaded=1+```++<p align="right"><a name="gloupeclearhighlightmap" href="#user-content-gloupeclearhighlightmap"><code>g:LoupeClearHighlightMap</code></a></p>+### `g:LoupeClearHighlightMap` (boolean, default: 1)<a name="loupe-gloupeclearhighlightmap-boolean-default-1" href="#user-content-loupe-gloupeclearhighlightmap-boolean-default-1"></a>++Controls whether to set up the <strong>[`<Plug>(LoupeClearHighlight)`](#user-content-plugloupeclearhighlight)</strong> mapping. To prevent any mapping from being configured, set to 0:++```+let g:LoupeClearHighlightMap=0+```++<p align="right"><a name="gloupeverymagic" href="#user-content-gloupeverymagic"><code>g:LoupeVeryMagic</code></a></p>+### `g:LoupeVeryMagic` (boolean, default: 1)<a name="loupe-gloupeverymagic-boolean-default-1" href="#user-content-loupe-gloupeverymagic-boolean-default-1"></a>++Controls whether "very magic" pattern syntax (<strong>`/\v`</strong>) is applied by default. To disable, set to 0:++```+let g:LoupeVeryMagic=0+```++<p align="right"><a name="gloupecenterresults" href="#user-content-gloupecenterresults"><code>g:LoupeCenterResults</code></a></p>+### `g:LoupeCenterResults` (boolean, default: 1)<a name="loupe-gloupecenterresults-boolean-default-1" href="#user-content-loupe-gloupecenterresults-boolean-default-1"></a>++Controls whether the match's line is vertically centered within the window when jumping (via <strong>`n`</strong>, <strong>`N`</strong> etc). To disable, set to 0:++```+let g:LoupeCenterResults=0+```++## Overrides<a name="loupe-overrides" href="#user-content-loupe-overrides"></a>++Loupe sets a number of search-related Vim settings to reasonable defaults in order to provide a good "out of the box" experience:++<p align="right"><a name="loupe-history-override" href="#user-content-loupe-history-override"><code>loupe-history-override</code></a></p>+'history'++Increased to 1000, to increase the number of previous searches remembered. Note that Loupe only applies this setting if the current value of 'history' is less than 1000.++<p align="right"><a name="loupe-hlsearch-override" href="#user-content-loupe-hlsearch-override"><code>loupe-hlsearch-override</code></a></p>+'hlsearch'++Turned on (when there is a previous search pattern, highlight all its matches).++<p align="right"><a name="loupe-incsearch-override" href="#user-content-loupe-incsearch-override"><code>loupe-incsearch-override</code></a></p>+'incsearch'++Turned on (while typing a search command, show where the pattern matches, as it was typed so far).++<p align="right"><a name="loupe-ignorecase-override" href="#user-content-loupe-ignorecase-override"><code>loupe-ignorecase-override</code></a></p>+'ignorecase'++Turned on (to ignore case in search patterns).++<p align="right"><a name="loupe-shortmess-override" href="#user-content-loupe-shortmess-override"><code>loupe-shortmess-override</code></a></p>+'shortmess'++Adds "s", which suppresses the display of "search hit BOTTOM, continuing at TOP" and "search hit TOP, continuing at BOTTOM" messages.++<p align="right"><a name="loupe-smartcase-override" href="#user-content-loupe-smartcase-override"><code>loupe-smartcase-override</code></a></p>+'smartcase'++Turned on (overrides 'ignorecase', making the search pattern case-sensitive whenever it containers uppercase characters).++To override any of these choices, you can place overrides in an <strong>`after-directory`</strong> (ie. `~/.vim/after/plugin/loupe.vim`). For example:++```+ " Override Loupe's 'history' setting from 1000 to 10000.+ set history=10000++ " Reset Loupe's 'incsearch' back to Vim default.+ set incsearch&vim++ " Remove unwanted 's' from 'shortmess'.+ set shortmess-=s+```++## Related<a name="loupe-related" href="#user-content-loupe-related"></a>++Just as Loupe aims to improve the within-file search experience, Ferret does the same for multi-file searching and replacing:++- https://github.com/wincent/ferret++## Website<a name="loupe-website" href="#user-content-loupe-website"></a>++The official Loupe source code repo is at:++- http://git.wincent.com/loupe.git++A mirror exists at:++- https://github.com/wincent/loupe++Official releases are listed at:++- http://www.vim.org/scripts/script.php?script_id=5215++## License<a name="loupe-license" href="#user-content-loupe-license"></a>++Copyright 2015-present Greg Hurrell. All rights reserved.++Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:++1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.++2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.++## Development<a name="loupe-development" href="#user-content-loupe-development"></a>++### Contributing patches<a name="loupe-contributing-patches" href="#user-content-loupe-contributing-patches"></a>++Patches can be sent via mail to greg@hurrell.net, or as GitHub pull requests at: https://github.com/wincent/loupe/pulls++### Cutting a new release<a name="loupe-cutting-a-new-release" href="#user-content-loupe-cutting-a-new-release"></a>++At the moment the release process is manual:++- Perform final sanity checks and manual testing+- Update the <strong>[`loupe-history`](#user-content-loupe-history)</strong> section of the documentation+- Verify clean work tree:++```+git status+```++- Tag the release:++```+git tag -s -m "$VERSION release" $VERSION+```++- Publish the code:++```+git push origin master --follow-tags+git push github master --follow-tags+```++- Produce the release archive:++```+git archive -o loupe-$VERSION.zip HEAD -- .+```++- Upload to http://www.vim.org/scripts/script.php?script_id=5215++## Authors<a name="loupe-authors" href="#user-content-loupe-authors"></a>++Loupe is written and maintained by Greg Hurrell <greg@hurrell.net>.++The original idea for the <strong>`g:LoupeHighlightGroup`</strong> feature was taken from Damian Conway's Vim set-up:++- https://github.com/thoughtstream/Damian-Conway-s-Vim-Setup/blob/master/plugin/hlnext.vim++Which he discussed in his "More Instantly Better Vim" presentation at OSCON 2013:++- https://www.youtube.com/watch?v=aHm36-na4-4++## History<a name="loupe-history" href="#user-content-loupe-history"></a>++### 1.0 (28 December 2015)<a name="loupe-10-28-december-2015" href="#user-content-loupe-10-28-december-2015"></a>++- Renamed the <strong>`<Plug>LoupeClearHighlight`</strong> mapping to <strong>[`<Plug>(LoupeClearHighlight)`](#user-content-plugloupeclearhighlight)</strong>.++### 0.1 (5 July 2015)<a name="loupe-01-5-july-2015" href="#user-content-loupe-01-5-july-2015"></a>++- Initial release, extracted from my dotfiles (https://github.com/wincent/wincent).
+ tests/fixtures/integration/loupe/golden/plaintext.golden view
@@ -0,0 +1,315 @@+*loupe.txt* Loupe plug-in for Vim *loupe*++CONTENTS *loupe-contents*++1. Intro |loupe-intro|+2. Installation |loupe-installation|+3. Mappings |loupe-mappings|+4. Options |loupe-options|+5. Overrides |loupe-overrides|+6. Related |loupe-related|+7. Website |loupe-website|+8. License |loupe-license|+9. Development |loupe-development|+10. Authors |loupe-authors|+11. History |loupe-history|++INTRO *loupe-intro*++ "loupe (noun)+ a small magnifying glass used by jewelers and watchmakers."+++ *loupe-features*+Loupe enhances Vim's |search-commands| in four ways:++1. Makes the currently selected match easier to see ~++When searching using |/|, |?|, |star|, |#|, |n|, |N| or similar, it can be hard to see+the "current" match from among all the matches that 'hlsearch' highlights.+Loupe makes the currently selected match easier to see by:++- Applying a different |:highlight| group (by default, |hl-IncSearch|) to the+ match under the cursor.+- Keeping the matching line centered within the window when jumping between+ matches with |n| and |N|.++2. Applies sane pattern syntax by default ~++Loupe makes "very magic" (|/\v|) syntax apply by default when searching. This+is true even if you initiate a search via a novel means, such as from a+visual selection or with a complicated |:range| prefix.++This means that you can use a pattern syntax closer to the familiar regular+expression syntax from languages such as Perl, Ruby, JavaScript (indeed,+most other modern languages that support regular expressions).++3. Provides a shortcut to remove search highlighting ~++Loupe maps <leader>n to quickly remove all 'hlsearch' highlighting (although+you can provide an alternative mapping of your choosing or suppress the+feature entirely).++4. Sensible defaults for search-related features ~++Loupe provides reasonable defaults for most search-related Vim settings to+provide a good "out of the box" experience. For more details, or to see how+to override Loupe's settings, see |loupe-overrides|.++INSTALLATION *loupe-installation*++To install Loupe, use your plug-in management system of choice.++If you don't have a "plug-in management system of choice", I recommend+Pathogen (https://github.com/tpope/vim-pathogen) due to its simplicity and+robustness. Assuming that you have Pathogen installed and configured, and+that you want to install Loupe into `~/.vim/bundle`, you can do so with:+>+ git clone https://github.com/wincent/loupe.git ~/.vim/bundle/loupe+<+Alternatively, if you use a Git submodule for each Vim plug-in, you could do+the following after `cd`-ing into the top-level of your Git superproject:+>+ git submodule add https://github.com/wincent/loupe.git ~/vim/bundle/loupe+ git submodule init+<+To generate help tags under Pathogen, you can do so from inside Vim with:+>+ :call pathogen#helptags()+<+MAPPINGS *loupe-mappings*+++ *<Plug>(LoupeClearHighlight)*+Loupe maps <leader>n to |<Plug>(LoupeClearHighlight)|, which clears all+visible highlights (like |:nohighlight| does). To use an alternative mapping+instead, create a different one in your |.vimrc| instead using |:nmap|:+>+ " Instead of <leader>n, use <leader>x.+ nmap <leader>x <Plug>(LoupeClearHighlight)+<+Note that Loupe will not try to set up its <leader>n mapping if any of the+following are true:++- A mapping for <leader>n already exists.+- An alternative mapping for |<Plug>(LoupeClearHighlight)| has already been+ set up from a |.vimrc|.+- The mapping has been suppressed by setting |g:LoupeClearHighlightMap| to 1+ in your |.vimrc|.++OPTIONS *loupe-options*+++ *g:LoupeHighlightGroup*+|g:LoupeHighlightGroup| string (default: IncSearch)++Specifies the |:highlight| group used to emphasize the match currently under+the cursor for the current search pattern. Defaults to "IncSearch" (ie.+|hl-IncSearch|). For example:+>+ let g:LoupeHighlightGroup='Error'+<+To prevent any special highlighting from being applied, set this option to+"" (ie. the empty string).+++ *g:LoupeLoaded*+|g:LoupeLoaded| any (default: none)++To prevent Loupe from being loaded, set |g:LoupeLoaded| to any value in your+|.vimrc|. For example:+>+ let g:LoupeLoaded=1+<++ *g:LoupeClearHighlightMap*+|g:LoupeClearHighlightMap| boolean (default: 1)++Controls whether to set up the |<Plug>(LoupeClearHighlight)| mapping. To+prevent any mapping from being configured, set to 0:+>+ let g:LoupeClearHighlightMap=0+<++ *g:LoupeVeryMagic*+|g:LoupeVeryMagic| boolean (default: 1)++Controls whether "very magic" pattern syntax (|/\v|) is applied by default. To+disable, set to 0:+>+ let g:LoupeVeryMagic=0+<++ *g:LoupeCenterResults*+|g:LoupeCenterResults| boolean (default: 1)++Controls whether the match's line is vertically centered within the window+when jumping (via |n|, |N| etc). To disable, set to 0:+>+ let g:LoupeCenterResults=0+<+OVERRIDES *loupe-overrides*++Loupe sets a number of search-related Vim settings to reasonable defaults in+order to provide a good "out of the box" experience:+++ *loupe-history-override*+'history'++Increased to 1000, to increase the number of previous searches remembered.+Note that Loupe only applies this setting if the current value of 'history'+is less than 1000.+++ *loupe-hlsearch-override*+'hlsearch'++Turned on (when there is a previous search pattern, highlight all its+matches).+++ *loupe-incsearch-override*+'incsearch'++Turned on (while typing a search command, show where the pattern matches, as+it was typed so far).+++ *loupe-ignorecase-override*+'ignorecase'++Turned on (to ignore case in search patterns).+++ *loupe-shortmess-override*+'shortmess'++Adds "s", which suppresses the display of "search hit BOTTOM, continuing at+TOP" and "search hit TOP, continuing at BOTTOM" messages.+++ *loupe-smartcase-override*+'smartcase'++Turned on (overrides 'ignorecase', making the search pattern case-sensitive+whenever it containers uppercase characters).++To override any of these choices, you can place overrides in an+|after-directory| (ie. `~/.vim/after/plugin/loupe.vim`). For example:+>+ " Override Loupe's 'history' setting from 1000 to 10000.+ set history=10000++ " Reset Loupe's 'incsearch' back to Vim default.+ set incsearch&vim++ " Remove unwanted 's' from 'shortmess'.+ set shortmess-=s+<+RELATED *loupe-related*++Just as Loupe aims to improve the within-file search experience, Ferret does+the same for multi-file searching and replacing:++- https://github.com/wincent/ferret++WEBSITE *loupe-website*++The official Loupe source code repo is at:++- http://git.wincent.com/loupe.git++A mirror exists at:++- https://github.com/wincent/loupe++Official releases are listed at:++- http://www.vim.org/scripts/script.php?script_id=5215++LICENSE *loupe-license*++Copyright 2015-present Greg Hurrell. All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++1. Redistributions of source code must retain the above copyright notice,+this list of conditions and the following disclaimer.++2. Redistributions in binary form must reproduce the above copyright notice,+this list of conditions and the following disclaimer in the documentation+and/or other materials provided with the distribution.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE+POSSIBILITY OF SUCH DAMAGE.++DEVELOPMENT *loupe-development*++Contributing patches ~++Patches can be sent via mail to greg@hurrell.net, or as GitHub pull requests+at: https://github.com/wincent/loupe/pulls++Cutting a new release ~++At the moment the release process is manual:++- Perform final sanity checks and manual testing+- Update the |loupe-history| section of the documentation+- Verify clean work tree:+>+ git status+<+- Tag the release:+>+ git tag -s -m "$VERSION release" $VERSION+<+- Publish the code:+>+ git push origin master --follow-tags+ git push github master --follow-tags+<+- Produce the release archive:+>+ git archive -o loupe-$VERSION.zip HEAD -- .+<+- Upload to http://www.vim.org/scripts/script.php?script_id=5215++AUTHORS *loupe-authors*++Loupe is written and maintained by Greg Hurrell <greg@hurrell.net>.++The original idea for the |g:LoupeHighlightGroup| feature was taken from+Damian Conway's Vim set-up:++-++ https://github.com/thoughtstream/Damian-Conway-s-Vim-Setup/blob/master/plugin/hlnext.vim++Which he discussed in his "More Instantly Better Vim" presentation at OSCON+2013:++- https://www.youtube.com/watch?v=aHm36-na4-4++HISTORY *loupe-history*++1.0 (28 December 2015) ~++- Renamed the |<Plug>LoupeClearHighlight| mapping to+ |<Plug>(LoupeClearHighlight)|.++0.1 (5 July 2015) ~++- Initial release, extracted from my dotfiles+ (https://github.com/wincent/wincent).
+ tests/fixtures/integration/loupe/input/autoload/loupe/private.vim view
@@ -0,0 +1,136 @@+" Copyright 2015-present Greg Hurrell. All rights reserved.+" Licensed under the terms of the BSD 2-clause license.++" Dynamically returns "/" or "/\v" depending on the location of the just-typed+" "/" within the command-line. Only "/" that looks to be at the start of a+" command gets replaced.+"+" Doesn't handle the full list of possible range types (specified in `:h+" cmdline-ranges`), but catches the most common ones.+function! loupe#private#very_magic_slash() abort+ if getcmdtype() != ':'+ return '/'+ endif++ " For simplicity, only consider "/" typed at the end of the command-line.+ let l:pos=getcmdpos()+ let l:cmd=getcmdline()+ if len(l:cmd) + 1 != l:pos+ return '/'+ endif++ " Skip over ranges+ while 1+ let l:stripped=s:strip_ranges(l:cmd)+ if l:stripped ==# l:cmd+ break+ else+ let l:cmd=l:stripped+ endif+ endwhile++ if index(['g', 's', 'v'], l:cmd) != -1+ return loupe#private#prepare_highlight('/\v')+ endif++ return '/'+endfunction++function! s:strip_ranges(cmdline)+ let l:cmdline=a:cmdline++ " All the range tokens may be followed (several times) by '+' or '-' and an+ " optional number.+ let l:modifier='\([+-]\d*\)*'++ " Range tokens as specified in `:h cmdline-ranges`.+ let l:cmdline=substitute(l:cmdline, '^\d\+' . l:modifier, '', '') " line number+ let l:cmdline=substitute(l:cmdline, '^\.' . l:modifier, '', '') " current line+ let l:cmdline=substitute(l:cmdline, '^$' . l:modifier, '', '') " last line in file+ let l:cmdline=substitute(l:cmdline, '^%' . l:modifier, '', '') " entire file+ let l:cmdline=substitute(l:cmdline, "^'[a-z]\\c" . l:modifier, '', '') " mark t (or T)+ let l:cmdline=substitute(l:cmdline, "^'[<>]" . l:modifier, '', '') " visual selection marks+ let l:cmdline=substitute(l:cmdline, '^/[^/]\+/' . l:modifier, '', '') " /{pattern}/+ let l:cmdline=substitute(l:cmdline, '^?[^?]\+?' . l:modifier, '', '') " ?{pattern}?+ let l:cmdline=substitute(l:cmdline, '^\\/' . l:modifier, '', '') " \/ (next match of previous pattern)+ let l:cmdline=substitute(l:cmdline, '^\\?' . l:modifier, '', '') " \? (last match of previous pattern)+ let l:cmdline=substitute(l:cmdline, '^\\&' . l:modifier, '', '') " \& (last match of previous substitution)++ " Separators (see: `:h :,` and `:h :;`).+ let l:cmdline=substitute(l:cmdline, '^,', '', '') " , (separator)+ let l:cmdline=substitute(l:cmdline, '^;', '', '') " ; (separator)++ return l:cmdline+endfunction++" Prepare to highlight the match as soon as the cursor moves to it.+function! loupe#private#prepare_highlight(result) abort+ if has('autocmd')+ augroup LoupeHightlightMatch+ autocmd!+ autocmd CursorMoved * :call loupe#private#hlmatch()+ augroup END+ endif+ return a:result+endfunction++" Clear previously applied match highlighting.+function! loupe#private#clear_highlight() abort+ if exists('w:loupe_hlmatch')+ try+ call matchdelete(w:loupe_hlmatch)+ catch /\v<(E802|E803)>/+ " https://github.com/wincent/loupe/issues/1+ finally+ unlet w:loupe_hlmatch+ endtry+ endif+endfunction++" Called from WinEnter autocmd to clean up stray `matchadd()` vestiges.+" If we switch into a window and there is no 'hlsearch' in effect but we do have+" a `w:loupe_hlmatch` variable, it means that `:nohighight` was probably run+" from another window and we should clean up the straggling match and the+" window-local variable.+function! loupe#private#cleanup() abort+ if !v:hlsearch+ call loupe#private#clear_highlight()+ endif+endfunction++" Apply highlighting to the current search match.+function! loupe#private#hlmatch() abort+ ""+ " @option g:LoupeHighlightGroup string IncSearch+ " Specifies the |:highlight| group used to emphasize the match currently under+ " the cursor for the current search pattern. Defaults to "IncSearch" (ie.+ " |hl-IncSearch|). For example:+ "+ " ```+ " let g:LoupeHighlightGroup='Error'+ " ```+ "+ " To prevent any special highlighting from being applied, set this option to+ " "" (ie. the empty string).+ let l:highlight=get(g:, 'LoupeHighlightGroup', 'IncSearch')+ if empty(l:highlight)+ return+ endif++ if has('autocmd')+ augroup LoupeHightlightMatch+ autocmd!+ augroup END+ endif++ call loupe#private#clear_highlight()++ " \c case insensitive+ " \%# current cursor position+ " @/ current search pattern+ let l:pattern='\c\%#' . @/++ if exists('*matchadd')+ let w:loupe_hlmatch=matchadd(l:highlight, l:pattern)+ endif+endfunction
+ tests/fixtures/integration/loupe/input/plugin/loupe.vim view
@@ -0,0 +1,383 @@+" Copyright 2015-present Greg Hurrell. All rights reserved.+" Licensed under the terms of the BSD 2-clause license.++""+"+" @plugin loupe Loupe plug-in for Vim+"+" # Intro+"+" > "loupe (noun)<br>+" > a small magnifying glass used by jewelers and watchmakers."+"+" *loupe-features*+" Loupe enhances Vim's |search-commands| in four ways:+"+" ## 1. Makes the currently selected match easier to see+"+" When searching using |/|, |?|, |star|, |#|, |n|, |N| or similar, it can be+" hard to see the "current" match from among all the matches that 'hlsearch'+" highlights. Loupe makes the currently selected match easier to see by:+"+" - Applying a different |:highlight| group (by default, |hl-IncSearch|) to the+" match under the cursor.+" - Keeping the matching line centered within the window when jumping between+" matches with |n| and |N|.+"+" ## 2. Applies sane pattern syntax by default+"+" Loupe makes "very magic" (|/\v|) syntax apply by default when searching. This+" is true even if you initiate a search via a novel means, such as from a visual+" selection or with a complicated |:range| prefix.+"+" This means that you can use a pattern syntax closer to the familiar regular+" expression syntax from languages such as Perl, Ruby, JavaScript (indeed, most+" other modern languages that support regular expressions).+"+" ## 3. Provides a shortcut to remove search highlighting+"+" Loupe maps <leader>n to quickly remove all 'hlsearch' highlighting (although+" you can provide an alternative mapping of your choosing or suppress the+" feature entirely).+"+" ## 4. Sensible defaults for search-related features+"+" Loupe provides reasonable defaults for most search-related Vim settings to+" provide a good "out of the box" experience. For more details, or to see how to+" override Loupe's settings, see |loupe-overrides|.+"+"+" # Installation+"+" To install Loupe, use your plug-in management system of choice.+"+" If you don't have a "plug-in management system of choice", I recommend+" Pathogen (https://github.com/tpope/vim-pathogen) due to its simplicity and+" robustness. Assuming that you have Pathogen installed and configured, and that+" you want to install Loupe into `~/.vim/bundle`, you can do so with:+"+" ```+" git clone https://github.com/wincent/loupe.git ~/.vim/bundle/loupe+" ```+"+" Alternatively, if you use a Git submodule for each Vim plug-in, you could do+" the following after `cd`-ing into the top-level of your Git superproject:+"+" ```+" git submodule add https://github.com/wincent/loupe.git ~/vim/bundle/loupe+" git submodule init+" ```+"+" To generate help tags under Pathogen, you can do so from inside Vim with:+"+" ```+" :call pathogen#helptags()+" ```+"+" @footer+"+" # Overrides+"+" Loupe sets a number of search-related Vim settings to reasonable defaults in+" order to provide a good "out of the box" experience:+"+" @indent+" *loupe-history-override*+" 'history'+"+" Increased to 1000, to increase the number of previous searches remembered.+" Note that Loupe only applies this setting if the current value of 'history'+" is less than 1000.+"+" *loupe-hlsearch-override*+" 'hlsearch'+"+" Turned on (when there is a previous search pattern, highlight all its+" matches).+"+" *loupe-incsearch-override*+" 'incsearch'+"+" Turned on (while typing a search command, show where the pattern matches, as+" it was typed so far).+"+" *loupe-ignorecase-override*+" 'ignorecase'+"+" Turned on (to ignore case in search patterns).+"+" *loupe-shortmess-override*+" 'shortmess'+"+" Adds "s", which suppresses the display of "search hit BOTTOM, continuing at+" TOP" and "search hit TOP, continuing at BOTTOM" messages.+"+" *loupe-smartcase-override*+" 'smartcase'+"+" Turned on (overrides 'ignorecase', making the search pattern case-sensitive+" whenever it containers uppercase characters).+"+" @dedent+"+" To override any of these choices, you can place overrides in an+" |after-directory| (ie. `~/.vim/after/plugin/loupe.vim`). For example:+"+" ```+" " Override Loupe's 'history' setting from 1000 to 10000.+" set history=10000+"+" " Reset Loupe's 'incsearch' back to Vim default.+" set incsearch&vim+"+" " Remove unwanted 's' from 'shortmess'.+" set shortmess-=s+" ```+"+" # Related+"+" Just as Loupe aims to improve the within-file search experience, Ferret does+" the same for multi-file searching and replacing:+"+" - https://github.com/wincent/ferret+"+" # Website+"+" The official Loupe source code repo is at:+"+" - http://git.wincent.com/loupe.git+"+" A mirror exists at:+"+" - https://github.com/wincent/loupe+"+" Official releases are listed at:+"+" - http://www.vim.org/scripts/script.php?script_id=5215+"+"+" # License+"+" Copyright 2015-present Greg Hurrell. All rights reserved.+"+" Redistribution and use in source and binary forms, with or without+" modification, are permitted provided that the following conditions are met:+"+" 1. Redistributions of source code must retain the above copyright notice,+" this list of conditions and the following disclaimer.+"+" 2. Redistributions in binary form must reproduce the above copyright notice,+" this list of conditions and the following disclaimer in the documentation+" and/or other materials provided with the distribution.+"+" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"+" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE+" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE+" ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE+" LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR+" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF+" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS+" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN+" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)+" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE+" POSSIBILITY OF SUCH DAMAGE.+"+"+" # Development+"+" ## Contributing patches+"+" Patches can be sent via mail to greg@hurrell.net, or as GitHub pull requests+" at: https://github.com/wincent/loupe/pulls+"+" ## Cutting a new release+"+" At the moment the release process is manual:+"+" - Perform final sanity checks and manual testing+" - Update the |loupe-history| section of the documentation+" - Verify clean work tree:+"+" ```+" git status+" ```+"+" - Tag the release:+"+" ```+" git tag -s -m "$VERSION release" $VERSION+" ```+"+" - Publish the code:+"+" ```+" git push origin master --follow-tags+" git push github master --follow-tags+" ```+"+" - Produce the release archive:+"+" ```+" git archive -o loupe-$VERSION.zip HEAD -- .+" ```+"+" - Upload to http://www.vim.org/scripts/script.php?script_id=5215+"+" # Authors+"+" Loupe is written and maintained by Greg Hurrell <greg@hurrell.net>.+"+" The original idea for the |g:LoupeHighlightGroup| feature was taken from+" Damian Conway's Vim set-up:+"+" - https://github.com/thoughtstream/Damian-Conway-s-Vim-Setup/blob/master/plugin/hlnext.vim+"+" Which he discussed in his "More Instantly Better Vim" presentation at OSCON+" 2013:+"+" - https://www.youtube.com/watch?v=aHm36-na4-4+"+" # History+"+" ## 1.0 (28 December 2015)+"+" - Renamed the |<Plug>LoupeClearHighlight| mapping to+" |<Plug>(LoupeClearHighlight)|.+"+" ## 0.1 (5 July 2015)+"+" - Initial release, extracted from my dotfiles+" (https://github.com/wincent/wincent).++""+" @option g:LoupeLoaded any+"+" To prevent Loupe from being loaded, set |g:LoupeLoaded| to any value in your+" |.vimrc|. For example:+"+" ```+" let g:LoupeLoaded=1+" ```+if exists('g:LoupeLoaded') || &compatible || v:version < 700+ finish+endif+let g:LoupeLoaded=1++" Temporarily set 'cpoptions' to Vim default as per `:h use-cpo-save`.+let s:cpoptions=&cpoptions+set cpoptions&vim++" Reasonable defaults for search-related settings.+if &history < 1000+ set history=1000 " Longer search and command history (default is 50).+endif+if has('extra_search')+ set hlsearch " Highlight search strings.+ set incsearch " Incremental search ("find as you type").+endif+set ignorecase " Ignore case when searching.+set shortmess+=s " Don't echo search wrap messages.+set smartcase " Case-sensitive search if search string includes a capital letter.++""+" @option g:LoupeClearHighlightMap boolean 1+"+" Controls whether to set up the |<Plug>(LoupeClearHighlight)| mapping. To+" prevent any mapping from being configured, set to 0:+"+" ```+" let g:LoupeClearHighlightMap=0+" ```+let s:map=get(g:, 'LoupeClearHighlightMap', 1)+if s:map+ if !hasmapto('<Plug>(LoupeClearHighlight)') && maparg('<leader>n', 'n') ==# ''+ nmap <silent> <unique> <leader>n <Plug>(LoupeClearHighlight)+ endif+endif++""+" @mapping <Plug>(LoupeClearHighlight)+"+" Loupe maps <leader>n to |<Plug>(LoupeClearHighlight)|, which clears all+" visible highlights (like |:nohighlight| does). To use an alternative mapping+" instead, create a different one in your |.vimrc| instead using |:nmap|:+"+" ```+" " Instead of <leader>n, use <leader>x.+" nmap <leader>x <Plug>(LoupeClearHighlight)+" ```+"+" Note that Loupe will not try to set up its <leader>n mapping if any of the+" following are true:+"+" - A mapping for <leader>n already exists.+" - An alternative mapping for |<Plug>(LoupeClearHighlight)| has already been set+" up from a |.vimrc|.+" - The mapping has been suppressed by setting |g:LoupeClearHighlightMap| to 1+" in your |.vimrc|.+nnoremap <silent> <Plug>(LoupeClearHighlight)+ \ :nohlsearch<CR>+ \ :call loupe#private#clear_highlight()<CR>++" Make `:nohlsearch` behave like <Plug>(LoupeClearHighlight).+cabbrev <silent> <expr> noh (getcmdtype() == ':' && getcmdpos() == 4 ? 'noh <bar> call loupe#private#clear_highlight()<CR>' : 'noh')+cabbrev <silent> <expr> nohl (getcmdtype() == ':' && getcmdpos() == 5 ? 'nohl <bar> call loupe#private#clear_highlight()<CR>' : 'nohl')+cabbrev <silent> <expr> nohls (getcmdtype() == ':' && getcmdpos() == 6 ? 'nohls <bar> call loupe#private#clear_highlight()<CR>' : 'nohls')+cabbrev <silent> <expr> nohlse (getcmdtype() == ':' && getcmdpos() == 7 ? 'nohlse <bar> call loupe#private#clear_highlight()<CR>' : 'nohlse')+cabbrev <silent> <expr> nohlsea (getcmdtype() == ':' && getcmdpos() == 8 ? 'nohlsea <bar> call loupe#private#clear_highlight()<CR>' : 'nohlsea')+cabbrev <silent> <expr> nohlsear (getcmdtype() == ':' && getcmdpos() == 9 ? 'nohlsear <bar> call loupe#private#clear_highlight()<CR>' : 'nohlsear')+cabbrev <silent> <expr> nohlsearc (getcmdtype() == ':' && getcmdpos() == 10 ? 'nohlsearc <bar> call loupe#private#clear_highlight()<CR>' : 'nohlsearc')+cabbrev <silent> <expr> nohlsearch (getcmdtype() == ':' && getcmdpos() == 11 ? 'nohlsearch <bar> call loupe#private#clear_highlight()<CR>' : 'nohlsearch')++""+" @option g:LoupeVeryMagic boolean 1+"+" Controls whether "very magic" pattern syntax (|/\v|) is applied by default.+" To disable, set to 0:+"+" ```+" let g:LoupeVeryMagic=0+" ```+function s:MagicString()+ let s:magic=get(g:, 'LoupeVeryMagic', 1)+ return s:magic ? '\v' : ''+endfunction++nnoremap <expr> / loupe#private#prepare_highlight('/' . <SID>MagicString())+nnoremap <expr> ? loupe#private#prepare_highlight('?' . <SID>MagicString())+xnoremap <expr> / loupe#private#prepare_highlight('/' . <SID>MagicString())+xnoremap <expr> ? loupe#private#prepare_highlight('?' . <SID>MagicString())+if !empty(s:MagicString())+ cnoremap <expr> / loupe#private#very_magic_slash()+endif++""+" @option g:LoupeCenterResults boolean 1+"+" Controls whether the match's line is vertically centered within the window+" when jumping (via |n|, |N| etc). To disable, set to 0:+"+" ```+" let g:LoupeCenterResults=0+" ```+let s:center=get(g:, 'LoupeCenterResults', 1)+let s:center_string=s:center ? 'zz' : ''++execute 'nnoremap <silent> # #' . s:center_string . ':call loupe#private#hlmatch()<CR>'+execute 'nnoremap <silent> * *' . s:center_string . ':call loupe#private#hlmatch()<CR>'+execute 'nnoremap <silent> N N' . s:center_string . ':call loupe#private#hlmatch()<CR>'+execute 'nnoremap <silent> g# g#' . s:center_string . ':call loupe#private#hlmatch()<CR>'+execute 'nnoremap <silent> g* g*' . s:center_string . ':call loupe#private#hlmatch()<CR>'+execute 'nnoremap <silent> n n' . s:center_string . ':call loupe#private#hlmatch()<CR>'++" Clean-up stray `matchadd()` vestiges.+if has('autocmd') && has('extra_search')+ augroup LoupeCleanUp+ autocmd!+ autocmd WinEnter * :call loupe#private#cleanup()+ augroup END+endif++" Restore 'cpoptions' to its former value.+let &cpoptions=s:cpoptions+unlet s:cpoptions
+ tests/fixtures/integration/pinnacle/golden/ast.golden view
@@ -0,0 +1,898 @@+Project+ [ DocBlock+ [ PluginAnnotation+ "Pinnacle" "Highlight group manipulation for Vim"+ , TOC+ [ "Intro"+ , "Installation"+ , "Website"+ , "License"+ , "Development"+ , "Authors"+ , "History"+ ]+ ]+ , HeadingAnnotation "Intro"+ , Paragraph+ [ Plaintext "Pinnacle"+ , Whitespace+ , Plaintext "provides"+ , Whitespace+ , Plaintext "functions"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "manipulating"+ , Whitespace+ , Link ":highlight"+ , Whitespace+ , Plaintext "groups."+ ]+ , HeadingAnnotation "Installation"+ , Paragraph+ [ Plaintext "To"+ , Whitespace+ , Plaintext "install"+ , Whitespace+ , Plaintext "Pinnacle,"+ , Whitespace+ , Plaintext "use"+ , Whitespace+ , Plaintext "your"+ , Whitespace+ , Plaintext "plug-in"+ , Whitespace+ , Plaintext "management"+ , Whitespace+ , Plaintext "system"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "choice."+ ]+ , Paragraph+ [ Plaintext "If"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "don't"+ , Whitespace+ , Plaintext "have"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "\"plug-in"+ , Whitespace+ , Plaintext "management"+ , Whitespace+ , Plaintext "system"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "choice\","+ , Whitespace+ , Plaintext "I"+ , Whitespace+ , Plaintext "recommend"+ , Whitespace+ , Plaintext "Pathogen"+ , Whitespace+ , Plaintext "(https://github.com/tpope/vim-pathogen)"+ , Whitespace+ , Plaintext "due"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "its"+ , Whitespace+ , Plaintext "simplicity"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "robustness."+ , Whitespace+ , Plaintext "Assuming"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "have"+ , Whitespace+ , Plaintext "Pathogen"+ , Whitespace+ , Plaintext "installed"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "configured,"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "want"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "install"+ , Whitespace+ , Plaintext "vim-docvim"+ , Whitespace+ , Plaintext "into"+ , Whitespace+ , Code "~/.vim/bundle"+ , Plaintext ","+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "do"+ , Whitespace+ , Plaintext "so"+ , Whitespace+ , Plaintext "with:"+ ]+ , Fenced+ [ "git clone https://github.com/wincent/pinnacle.git ~/.vim/bundle/pinnacle"+ ]+ , Paragraph+ [ Plaintext "Alternatively,"+ , Whitespace+ , Plaintext "if"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "use"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "Git"+ , Whitespace+ , Plaintext "submodule"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "each"+ , Whitespace+ , Plaintext "Vim"+ , Whitespace+ , Plaintext "plug-in,"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "could"+ , Whitespace+ , Plaintext "do"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "following"+ , Whitespace+ , Plaintext "after"+ , Whitespace+ , Code "cd"+ , Plaintext "-ing"+ , Whitespace+ , Plaintext "into"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "top-level"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "your"+ , Whitespace+ , Plaintext "Git"+ , Whitespace+ , Plaintext "superproject:"+ ]+ , Fenced+ [ "git submodule add https://github.com/wincent/pinnacle.git ~/vim/bundle/pinnacle"+ , "git submodule init"+ ]+ , Paragraph+ [ Plaintext "To"+ , Whitespace+ , Plaintext "generate"+ , Whitespace+ , Plaintext "help"+ , Whitespace+ , Plaintext "tags"+ , Whitespace+ , Plaintext "under"+ , Whitespace+ , Plaintext "Pathogen,"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "do"+ , Whitespace+ , Plaintext "so"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "inside"+ , Whitespace+ , Plaintext "Vim"+ , Whitespace+ , Plaintext "with:"+ ]+ , Fenced [ ":call pathogen#helptags()" ]+ , HeadingAnnotation "Website"+ , Paragraph+ [ Plaintext "The"+ , Whitespace+ , Plaintext "official"+ , Whitespace+ , Plaintext "Pinnacle"+ , Whitespace+ , Plaintext "source"+ , Whitespace+ , Plaintext "code"+ , Whitespace+ , Plaintext "repo"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "at:"+ ]+ , Paragraph [ Plaintext "http://git.wincent.com/pinnacle.git" ]+ , Paragraph+ [ Plaintext "Mirrors"+ , Whitespace+ , Plaintext "exist"+ , Whitespace+ , Plaintext "at:"+ ]+ , List+ [ ListItem [ Plaintext "https://github.com/wincent/pinnacle" ]+ , ListItem [ Plaintext "https://gitlab.com/wincent/pinnacle" ]+ , ListItem [ Plaintext "https://bitbucket.org/ghurrell/pinnacle" ]+ ]+ , Paragraph+ [ Plaintext "Official"+ , Whitespace+ , Plaintext "releases"+ , Whitespace+ , Plaintext "are"+ , Whitespace+ , Plaintext "listed"+ , Whitespace+ , Plaintext "at:"+ ]+ , Paragraph+ [ Plaintext "http://www.vim.org/scripts/script.php?script_id=5360"+ ]+ , HeadingAnnotation "License"+ , Paragraph+ [ Plaintext "Copyright"+ , Whitespace+ , Plaintext "(c)"+ , Whitespace+ , Plaintext "2016-present"+ , Whitespace+ , Plaintext "Greg"+ , Whitespace+ , Plaintext "Hurrell"+ ]+ , Paragraph+ [ Plaintext "Permission"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "hereby"+ , Whitespace+ , Plaintext "granted,"+ , Whitespace+ , Plaintext "free"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "charge,"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "any"+ , Whitespace+ , Plaintext "person"+ , Whitespace+ , Plaintext "obtaining"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "copy"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "this"+ , Whitespace+ , Plaintext "software"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "associated"+ , Whitespace+ , Plaintext "documentation"+ , Whitespace+ , Plaintext "files"+ , Whitespace+ , Plaintext "(the"+ , Whitespace+ , Plaintext "\"Software\"),"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "deal"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "Software"+ , Whitespace+ , Plaintext "without"+ , Whitespace+ , Plaintext "restriction,"+ , Whitespace+ , Plaintext "including"+ , Whitespace+ , Plaintext "without"+ , Whitespace+ , Plaintext "limitation"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "rights"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "use,"+ , Whitespace+ , Plaintext "copy,"+ , Whitespace+ , Plaintext "modify,"+ , Whitespace+ , Plaintext "merge,"+ , Whitespace+ , Plaintext "publish,"+ , Whitespace+ , Plaintext "distribute,"+ , Whitespace+ , Plaintext "sublicense,"+ , Whitespace+ , Plaintext "and/or"+ , Whitespace+ , Plaintext "sell"+ , Whitespace+ , Plaintext "copies"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "Software,"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "permit"+ , Whitespace+ , Plaintext "persons"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "whom"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "Software"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "furnished"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "do"+ , Whitespace+ , Plaintext "so,"+ , Whitespace+ , Plaintext "subject"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "following"+ , Whitespace+ , Plaintext "conditions:"+ ]+ , Paragraph+ [ Plaintext "The"+ , Whitespace+ , Plaintext "above"+ , Whitespace+ , Plaintext "copyright"+ , Whitespace+ , Plaintext "notice"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "this"+ , Whitespace+ , Plaintext "permission"+ , Whitespace+ , Plaintext "notice"+ , Whitespace+ , Plaintext "shall"+ , Whitespace+ , Plaintext "be"+ , Whitespace+ , Plaintext "included"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "all"+ , Whitespace+ , Plaintext "copies"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Plaintext "substantial"+ , Whitespace+ , Plaintext "portions"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "Software."+ ]+ , Paragraph+ [ Plaintext "THE"+ , Whitespace+ , Plaintext "SOFTWARE"+ , Whitespace+ , Plaintext "IS"+ , Whitespace+ , Plaintext "PROVIDED"+ , Whitespace+ , Plaintext "\"AS"+ , Whitespace+ , Plaintext "IS\","+ , Whitespace+ , Plaintext "WITHOUT"+ , Whitespace+ , Plaintext "WARRANTY"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "ANY"+ , Whitespace+ , Plaintext "KIND,"+ , Whitespace+ , Plaintext "EXPRESS"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "IMPLIED,"+ , Whitespace+ , Plaintext "INCLUDING"+ , Whitespace+ , Plaintext "BUT"+ , Whitespace+ , Plaintext "NOT"+ , Whitespace+ , Plaintext "LIMITED"+ , Whitespace+ , Plaintext "TO"+ , Whitespace+ , Plaintext "THE"+ , Whitespace+ , Plaintext "WARRANTIES"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "MERCHANTABILITY,"+ , Whitespace+ , Plaintext "FITNESS"+ , Whitespace+ , Plaintext "FOR"+ , Whitespace+ , Plaintext "A"+ , Whitespace+ , Plaintext "PARTICULAR"+ , Whitespace+ , Plaintext "PURPOSE"+ , Whitespace+ , Plaintext "AND"+ , Whitespace+ , Plaintext "NONINFRINGEMENT."+ , Whitespace+ , Plaintext "IN"+ , Whitespace+ , Plaintext "NO"+ , Whitespace+ , Plaintext "EVENT"+ , Whitespace+ , Plaintext "SHALL"+ , Whitespace+ , Plaintext "THE"+ , Whitespace+ , Plaintext "AUTHORS"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "COPYRIGHT"+ , Whitespace+ , Plaintext "HOLDERS"+ , Whitespace+ , Plaintext "BE"+ , Whitespace+ , Plaintext "LIABLE"+ , Whitespace+ , Plaintext "FOR"+ , Whitespace+ , Plaintext "ANY"+ , Whitespace+ , Plaintext "CLAIM,"+ , Whitespace+ , Plaintext "DAMAGES"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "OTHER"+ , Whitespace+ , Plaintext "LIABILITY,"+ , Whitespace+ , Plaintext "WHETHER"+ , Whitespace+ , Plaintext "IN"+ , Whitespace+ , Plaintext "AN"+ , Whitespace+ , Plaintext "ACTION"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "CONTRACT,"+ , Whitespace+ , Plaintext "TORT"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "OTHERWISE,"+ , Whitespace+ , Plaintext "ARISING"+ , Whitespace+ , Plaintext "FROM,"+ , Whitespace+ , Plaintext "OUT"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "IN"+ , Whitespace+ , Plaintext "CONNECTION"+ , Whitespace+ , Plaintext "WITH"+ , Whitespace+ , Plaintext "THE"+ , Whitespace+ , Plaintext "SOFTWARE"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "THE"+ , Whitespace+ , Plaintext "USE"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "OTHER"+ , Whitespace+ , Plaintext "DEALINGS"+ , Whitespace+ , Plaintext "IN"+ , Whitespace+ , Plaintext "THE"+ , Whitespace+ , Plaintext "SOFTWARE."+ ]+ , HeadingAnnotation "Development"+ , SubheadingAnnotation "Contributing patches"+ , Paragraph+ [ Plaintext "Patches"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "be"+ , Whitespace+ , Plaintext "sent"+ , Whitespace+ , Plaintext "via"+ , Whitespace+ , Plaintext "mail"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "greg@hurrell.net,"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Plaintext "as"+ , Whitespace+ , Plaintext "GitHub"+ , Whitespace+ , Plaintext "pull"+ , Whitespace+ , Plaintext "requests"+ , Whitespace+ , Plaintext "at:"+ , Whitespace+ , Plaintext "https://github.com/wincent/pinnacle/pulls"+ ]+ , SubheadingAnnotation "Cutting a new release"+ , Paragraph+ [ Plaintext "At"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "moment"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "release"+ , Whitespace+ , Plaintext "process"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "manual:"+ ]+ , List+ [ ListItem+ [ Plaintext "Perform"+ , Whitespace+ , Plaintext "final"+ , Whitespace+ , Plaintext "sanity"+ , Whitespace+ , Plaintext "checks"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "manual"+ , Whitespace+ , Plaintext "testing"+ ]+ , ListItem+ [ Plaintext "Update"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link "pinnacle-history"+ , Whitespace+ , Plaintext "section"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "documentation"+ ]+ , ListItem+ [ Plaintext "Verify"+ , Whitespace+ , Plaintext "clean"+ , Whitespace+ , Plaintext "work"+ , Whitespace+ , Plaintext "tree:"+ ]+ ]+ , Fenced [ "git status" ]+ , List+ [ ListItem+ [ Plaintext "Tag"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "release:"+ ]+ ]+ , Fenced [ "git tag -s -m \"$VERSION release\" $VERSION" ]+ , List+ [ ListItem+ [ Plaintext "Publish"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "code:"+ ]+ ]+ , Fenced+ [ "git push origin master --follow-tags"+ , "git push github master --follow-tags"+ ]+ , List+ [ ListItem+ [ Plaintext "Produce"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "release"+ , Whitespace+ , Plaintext "archive:"+ ]+ ]+ , Fenced [ "git archive -o vim-docvim-$VERSION.zip HEAD -- ." ]+ , List+ [ ListItem+ [ Plaintext "Upload"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "http://www.vim.org/scripts/script.php?script_id=5360"+ ]+ ]+ , HeadingAnnotation "Authors"+ , Paragraph+ [ Plaintext "Pinnacle"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "written"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "maintained"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "Greg"+ , Whitespace+ , Plaintext "Hurrell"+ , Whitespace+ , Plaintext "<greg@hurrell.net>."+ ]+ , HeadingAnnotation "History"+ , SubheadingAnnotation "0.1 (30 March 2016)"+ , List+ [ ListItem+ [ Plaintext "Initial" , Whitespace , Plaintext "release." ]+ ]+ , Project+ [ Unit+ [ FunctionDeclaration+ { functionBang = True+ , functionName = "pinnacle#sub_newlines"+ , functionArguments = ArgumentList [ Argument "string" ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement "return tr(a:string, \"\\r\\n\", ' ')" ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "pinnacle#capture_line"+ , functionArguments = ArgumentList [ Argument "command" ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement "redir => l:capture"+ , GenericStatement "execute a:command"+ , GenericStatement "redir END"+ , GenericStatement "return pinnacle#sub_newlines(l:capture)"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "pinnacle#capture_highlight"+ , functionArguments = ArgumentList [ Argument "group" ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement+ "return pinnacle#capture_line('0verbose silent highlight ' . a:group)"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "pinnacle#extract_highlight"+ , functionArguments = ArgumentList [ Argument "group" ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ LetStatement+ { letLexpr = "l:group "+ , letValue = "pinnacle#capture_highlight(a:group)"+ }+ , GenericStatement "while l:group =~# 'links to'"+ , LetStatement+ { letLexpr = "l:index "+ , letValue = "stridx(l:group, 'links to') + len('links to')"+ }+ , LetStatement+ { letLexpr = "l:linked "+ , letValue = "strpart(l:group, l:index + 1)"+ }+ , LetStatement+ { letLexpr = "l:group "+ , letValue = "pinnacle#capture_highlight(l:linked)"+ }+ , GenericStatement "endwhile"+ , LetStatement+ { letLexpr = "l:matches "+ , letValue = "matchlist(l:group, '\\<xxx\\>\\s\\+\\(.*\\)')"+ }+ , LetStatement+ { letLexpr = "l:original " , letValue = "l:matches[1]" }+ , GenericStatement "return l:original"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "pinnacle#italicize"+ , functionArguments = ArgumentList [ Argument "group" ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement "return pinnacle#decorate('italic', a:group)" ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "pinnacle#embolden"+ , functionArguments = ArgumentList [ Argument "group" ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement "return pinnacle#decorate('bold', a:group)" ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "pinnacle#decorate"+ , functionArguments =+ ArgumentList [ Argument "style" , Argument "group" ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ LetStatement+ { letLexpr = "l:original "+ , letValue = "pinnacle#extract_highlight(a:group)"+ }+ , GenericStatement "for l:lhs in ['gui', 'term', 'cterm']"+ , LetStatement+ { letLexpr = "l:matches " , letValue = "matchlist(" }+ , GenericStatement+ "\\ l:original, '^\\([^ ]\\+ \\)\\?' . '\\(' . l:lhs . '=[^ ]\\+\\)' . '\\( .\\+\\)\\?$' )"+ , GenericStatement "if l:matches == []"+ , LetStatement+ { letLexpr = "l:original ."+ , letValue = "' ' . l:lhs . '=' . a:style"+ }+ , GenericStatement "else"+ , LetStatement+ { letLexpr = "l:start " , letValue = "l:matches[1]" }+ , LetStatement+ { letLexpr = "l:value " , letValue = "l:matches[2]" }+ , LetStatement { letLexpr = "l:end " , letValue = "l:matches[3]" }+ , GenericStatement "if l:value =~# '.*' . a:style . '.*'"+ , GenericStatement "continue"+ , GenericStatement "else"+ , LetStatement+ { letLexpr = "l:original "+ , letValue = "l:start . l:value . ',' . a:style . l:end"+ }+ , GenericStatement "endif"+ , GenericStatement "endif"+ , GenericStatement "endfor"+ , GenericStatement "return pinnacle#sub_newlines(l:original)"+ ]+ }+ ]+ ]+ ]
+ tests/fixtures/integration/pinnacle/golden/markdown.golden view
@@ -0,0 +1,103 @@+# Pinnacle<a name="pinnacle-pinnacle" href="#user-content-pinnacle-pinnacle"></a>++## Intro<a name="pinnacle-intro" href="#user-content-pinnacle-intro"></a>++Pinnacle provides functions for manipulating <strong>`:highlight`</strong> groups.++## Installation<a name="pinnacle-installation" href="#user-content-pinnacle-installation"></a>++To install Pinnacle, use your plug-in management system of choice.++If you don't have a "plug-in management system of choice", I recommend Pathogen (https://github.com/tpope/vim-pathogen) due to its simplicity and robustness. Assuming that you have Pathogen installed and configured, and that you want to install vim-docvim into `~/.vim/bundle`, you can do so with:++```+git clone https://github.com/wincent/pinnacle.git ~/.vim/bundle/pinnacle+```++Alternatively, if you use a Git submodule for each Vim plug-in, you could do the following after `cd`-ing into the top-level of your Git superproject:++```+git submodule add https://github.com/wincent/pinnacle.git ~/vim/bundle/pinnacle+git submodule init+```++To generate help tags under Pathogen, you can do so from inside Vim with:++```+:call pathogen#helptags()+```++## Website<a name="pinnacle-website" href="#user-content-pinnacle-website"></a>++The official Pinnacle source code repo is at:++http://git.wincent.com/pinnacle.git++Mirrors exist at:++- https://github.com/wincent/pinnacle+- https://gitlab.com/wincent/pinnacle+- https://bitbucket.org/ghurrell/pinnacle++Official releases are listed at:++http://www.vim.org/scripts/script.php?script_id=5360++## License<a name="pinnacle-license" href="#user-content-pinnacle-license"></a>++Copyright (c) 2016-present Greg Hurrell++Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.++## Development<a name="pinnacle-development" href="#user-content-pinnacle-development"></a>++### Contributing patches<a name="pinnacle-contributing-patches" href="#user-content-pinnacle-contributing-patches"></a>++Patches can be sent via mail to greg@hurrell.net, or as GitHub pull requests at: https://github.com/wincent/pinnacle/pulls++### Cutting a new release<a name="pinnacle-cutting-a-new-release" href="#user-content-pinnacle-cutting-a-new-release"></a>++At the moment the release process is manual:++- Perform final sanity checks and manual testing+- Update the <strong>[`pinnacle-history`](#user-content-pinnacle-history)</strong> section of the documentation+- Verify clean work tree:++```+git status+```++- Tag the release:++```+git tag -s -m "$VERSION release" $VERSION+```++- Publish the code:++```+git push origin master --follow-tags+git push github master --follow-tags+```++- Produce the release archive:++```+git archive -o vim-docvim-$VERSION.zip HEAD -- .+```++- Upload to http://www.vim.org/scripts/script.php?script_id=5360++## Authors<a name="pinnacle-authors" href="#user-content-pinnacle-authors"></a>++Pinnacle is written and maintained by Greg Hurrell <greg@hurrell.net>.++## History<a name="pinnacle-history" href="#user-content-pinnacle-history"></a>++### 0.1 (30 March 2016)<a name="pinnacle-01-30-march-2016" href="#user-content-pinnacle-01-30-march-2016"></a>++- Initial release.
+ tests/fixtures/integration/pinnacle/golden/plaintext.golden view
@@ -0,0 +1,116 @@+*pinnacle.txt* Highlight group manipulation for Vim *pinnacle*++CONTENTS *pinnacle-contents*++1. Intro |pinnacle-intro|+2. Installation |pinnacle-installation|+3. Website |pinnacle-website|+4. License |pinnacle-license|+5. Development |pinnacle-development|+6. Authors |pinnacle-authors|+7. History |pinnacle-history|++INTRO *pinnacle-intro*++Pinnacle provides functions for manipulating |:highlight| groups.++INSTALLATION *pinnacle-installation*++To install Pinnacle, use your plug-in management system of choice.++If you don't have a "plug-in management system of choice", I recommend+Pathogen (https://github.com/tpope/vim-pathogen) due to its simplicity and+robustness. Assuming that you have Pathogen installed and configured, and+that you want to install vim-docvim into `~/.vim/bundle`, you can do so with:+>+ git clone https://github.com/wincent/pinnacle.git ~/.vim/bundle/pinnacle+<+Alternatively, if you use a Git submodule for each Vim plug-in, you could do+the following after `cd`-ing into the top-level of your Git superproject:+>+ git submodule add https://github.com/wincent/pinnacle.git ~/vim/bundle/pinnacle+ git submodule init+<+To generate help tags under Pathogen, you can do so from inside Vim with:+>+ :call pathogen#helptags()+<+WEBSITE *pinnacle-website*++The official Pinnacle source code repo is at:++http://git.wincent.com/pinnacle.git++Mirrors exist at:++- https://github.com/wincent/pinnacle+- https://gitlab.com/wincent/pinnacle+- https://bitbucket.org/ghurrell/pinnacle++Official releases are listed at:++http://www.vim.org/scripts/script.php?script_id=5360++LICENSE *pinnacle-license*++Copyright (c) 2016-present Greg Hurrell++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to+deal in the Software without restriction, including without limitation the+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or+sell copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in+all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS+IN THE SOFTWARE.++DEVELOPMENT *pinnacle-development*++Contributing patches ~++Patches can be sent via mail to greg@hurrell.net, or as GitHub pull requests+at: https://github.com/wincent/pinnacle/pulls++Cutting a new release ~++At the moment the release process is manual:++- Perform final sanity checks and manual testing+- Update the |pinnacle-history| section of the documentation+- Verify clean work tree:+>+ git status+<+- Tag the release:+>+ git tag -s -m "$VERSION release" $VERSION+<+- Publish the code:+>+ git push origin master --follow-tags+ git push github master --follow-tags+<+- Produce the release archive:+>+ git archive -o vim-docvim-$VERSION.zip HEAD -- .+<+- Upload to http://www.vim.org/scripts/script.php?script_id=5360++AUTHORS *pinnacle-authors*++Pinnacle is written and maintained by Greg Hurrell <greg@hurrell.net>.++HISTORY *pinnacle-history*++0.1 (30 March 2016) ~++- Initial release.
+ tests/fixtures/integration/pinnacle/input/autoload/pinnacle.vim view
@@ -0,0 +1,210 @@+""+" @plugin Pinnacle Highlight group manipulation for Vim+"+" # Intro+"+" Pinnacle provides functions for manipulating |:highlight| groups.+"+"+" # Installation+"+" To install Pinnacle, use your plug-in management system of choice.+"+" If you don't have a "plug-in management system of choice", I recommend+" Pathogen (https://github.com/tpope/vim-pathogen) due to its simplicity and+" robustness. Assuming that you have Pathogen installed and configured, and that+" you want to install vim-docvim into `~/.vim/bundle`, you can do so with:+"+" ```+" git clone https://github.com/wincent/pinnacle.git ~/.vim/bundle/pinnacle+" ```+"+" Alternatively, if you use a Git submodule for each Vim plug-in, you could do+" the following after `cd`-ing into the top-level of your Git superproject:+"+" ```+" git submodule add https://github.com/wincent/pinnacle.git ~/vim/bundle/pinnacle+" git submodule init+" ```+"+" To generate help tags under Pathogen, you can do so from inside Vim with:+"+" ```+" :call pathogen#helptags()+" ```+"+"+" # Website+"+" The official Pinnacle source code repo is at:+"+" http://git.wincent.com/pinnacle.git+"+" Mirrors exist at:+"+" - https://github.com/wincent/pinnacle+" - https://gitlab.com/wincent/pinnacle+" - https://bitbucket.org/ghurrell/pinnacle+"+" Official releases are listed at:+"+" http://www.vim.org/scripts/script.php?script_id=5360+"+"+" # License+"+" Copyright (c) 2016-present Greg Hurrell+"+" Permission is hereby granted, free of charge, to any person obtaining+" a copy of this software and associated documentation files (the+" "Software"), to deal in the Software without restriction, including+" without limitation the rights to use, copy, modify, merge, publish,+" distribute, sublicense, and/or sell copies of the Software, and to+" permit persons to whom the Software is furnished to do so, subject to+" the following conditions:+"+" The above copyright notice and this permission notice shall be+" included in all copies or substantial portions of the Software.+"+" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF+" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND+" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE+" LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION+" OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION+" WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.+"+"+" # Development+"+" ## Contributing patches+"+" Patches can be sent via mail to greg@hurrell.net, or as GitHub pull requests+" at: https://github.com/wincent/pinnacle/pulls+"+" ## Cutting a new release+"+" At the moment the release process is manual:+"+" - Perform final sanity checks and manual testing+" - Update the |pinnacle-history| section of the documentation+" - Verify clean work tree:+"+" ```+" git status+" ```+"+" - Tag the release:+"+" ```+" git tag -s -m "$VERSION release" $VERSION+" ```+"+" - Publish the code:+"+" ```+" git push origin master --follow-tags+" git push github master --follow-tags+" ```+"+" - Produce the release archive:+"+" ```+" git archive -o vim-docvim-$VERSION.zip HEAD -- .+" ```+"+" - Upload to http://www.vim.org/scripts/script.php?script_id=5360+"+"+" # Authors+"+" Pinnacle is written and maintained by Greg Hurrell <greg@hurrell.net>.+"+"+" # History+"+" ## 0.1 (30 March 2016)+"+" - Initial release.++" Replaces newlines with spaces.+function! pinnacle#sub_newlines(string) abort+ return tr(a:string, "\r\n", ' ')+endfunction++" Runs a command and returns the captured output as a single line.+"+" Useful when we don't want to let long lines on narrow windows produce unwanted+" embedded newlines.+function! pinnacle#capture_line(command) abort+ redir => l:capture+ execute a:command+ redir END++ return pinnacle#sub_newlines(l:capture)+endfunction++" Gets the current value of a highlight group.+function! pinnacle#capture_highlight(group) abort+ return pinnacle#capture_line('0verbose silent highlight ' . a:group)+endfunction++" Extracts a highlight string from a group, recursively traversing linked+" groups, and returns a string suitable for passing to `:highlight`.+function! pinnacle#extract_highlight(group) abort+ let l:group = pinnacle#capture_highlight(a:group)++ " Traverse links back to authoritative group.+ while l:group =~# 'links to'+ let l:index = stridx(l:group, 'links to') + len('links to')+ let l:linked = strpart(l:group, l:index + 1)+ let l:group = pinnacle#capture_highlight(l:linked)+ endwhile++ " Extract the highlighting details (the bit after "xxx")+ let l:matches = matchlist(l:group, '\<xxx\>\s\+\(.*\)')+ let l:original = l:matches[1]+ return l:original+endfunction++" Returns an italicized copy of `group` suitable for passing to `:highlight`.+function! pinnacle#italicize(group) abort+ return pinnacle#decorate('italic', a:group)+endfunction++" Returns a bold copy of `group` suitable for passing to `:highlight`.+function! pinnacle#embolden(group) abort+ return pinnacle#decorate('bold', a:group)+endfunction++" Returns a copy of `group` decorated with `style` (eg. "bold", "italic" etc)+" suitable for passing to `:highlight`.+function! pinnacle#decorate(style, group) abort+ let l:original = pinnacle#extract_highlight(a:group)++ for l:lhs in ['gui', 'term', 'cterm']+ " Check for existing setting.+ let l:matches = matchlist(+ \ l:original,+ \ '^\([^ ]\+ \)\?' .+ \ '\(' . l:lhs . '=[^ ]\+\)' .+ \ '\( .\+\)\?$'+ \ )+ if l:matches == []+ " No setting, add one with just a:style in it+ let l:original .= ' ' . l:lhs . '=' . a:style+ else+ " Existing setting; check whether a:style is already in it.+ let l:start = l:matches[1]+ let l:value = l:matches[2]+ let l:end = l:matches[3]+ if l:value =~# '.*' . a:style . '.*'+ continue+ else+ let l:original = l:start . l:value . ',' . a:style . l:end+ endif+ endif+ endfor++ return pinnacle#sub_newlines(l:original)+endfunction
+ tests/fixtures/integration/scalpel/golden/ast.golden view
@@ -0,0 +1,1521 @@+Project+ [ DocBlock+ [ PluginAnnotation "scalpel" "Scalpel plug-in for Vim"+ , TOC+ [ "Intro"+ , "Installation"+ , "Website"+ , "License"+ , "Development"+ , "Authors"+ , "History"+ ]+ ]+ , HeadingAnnotation "Intro"+ , Paragraph+ [ Plaintext "Scalpel"+ , Whitespace+ , Plaintext "provides"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "streamlined"+ , Whitespace+ , Plaintext "shortcut"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "replacing"+ , Whitespace+ , Plaintext "all"+ , Whitespace+ , Plaintext "instances"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "word"+ , Whitespace+ , Plaintext "currently"+ , Whitespace+ , Plaintext "under"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "cursor"+ , Whitespace+ , Plaintext "throughout"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "file."+ ]+ , Paragraph+ [ Plaintext "In"+ , Whitespace+ , Plaintext "normal"+ , Whitespace+ , Plaintext "mode"+ , Whitespace+ , Plaintext "pressing"+ , Whitespace+ , Code "<Leader>e"+ , Whitespace+ , Plaintext "(mnemonic:"+ , Whitespace+ , Plaintext "\"edit\")"+ , Whitespace+ , Plaintext "will"+ , Whitespace+ , Plaintext "display"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "prompt"+ , Whitespace+ , Plaintext "pre-populated"+ , Whitespace+ , Plaintext "with"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "current"+ , Whitespace+ , Plaintext "word"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "with"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "cursor"+ , Whitespace+ , Plaintext "placed"+ , Whitespace+ , Plaintext "so"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "start"+ , Whitespace+ , Plaintext "typing"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "desired"+ , Whitespace+ , Plaintext "replacement:"+ ]+ , Fenced [ ":Scalpel/\\v<foo>//" ]+ , Paragraph+ [ Plaintext "Press"+ , Whitespace+ , Code "<Enter>"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "Scalpel"+ , Whitespace+ , Plaintext "will"+ , Whitespace+ , Plaintext "prompt"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "confirm"+ , Whitespace+ , Plaintext "each"+ , Whitespace+ , Plaintext "substitution,"+ , Whitespace+ , Plaintext "starting"+ , Whitespace+ , Plaintext "at"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "current"+ , Whitespace+ , Plaintext "word"+ , Whitespace+ , Plaintext "(unlike"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "normal"+ , Whitespace+ , Code ":%s"+ , Whitespace+ , Plaintext "command,"+ , Whitespace+ , Plaintext "which"+ , Whitespace+ , Plaintext "starts"+ , Whitespace+ , Plaintext "at"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "top"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "file)."+ ]+ , Paragraph+ [ Plaintext "Scalpel"+ , Whitespace+ , Plaintext "works"+ , Whitespace+ , Plaintext "similarly"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "visual"+ , Whitespace+ , Plaintext "mode,"+ , Whitespace+ , Plaintext "except"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "it"+ , Whitespace+ , Plaintext "scopes"+ , Whitespace+ , Plaintext "itself"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "current"+ , Whitespace+ , Plaintext "visual"+ , Whitespace+ , Plaintext "selection"+ , Whitespace+ , Plaintext "rather"+ , Whitespace+ , Plaintext "than"+ , Whitespace+ , Plaintext "operating"+ , Whitespace+ , Plaintext "over"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "entire"+ , Whitespace+ , Plaintext "file."+ ]+ , Paragraph+ [ Plaintext "Note"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Code ":Scalpel"+ , Whitespace+ , Plaintext "just"+ , Whitespace+ , Plaintext "calls"+ , Whitespace+ , Plaintext "through"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "an"+ , Whitespace+ , Plaintext "underlying"+ , Whitespace+ , Code "scalpel#substitute"+ , Whitespace+ , Plaintext "function"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "does"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "real"+ , Whitespace+ , Plaintext "work,"+ , Whitespace+ , Plaintext "ultimately"+ , Whitespace+ , Plaintext "calling"+ , Whitespace+ , Plaintext "Vim's"+ , Whitespace+ , Plaintext "own"+ , Whitespace+ , Code ":substitute"+ , Plaintext "."+ , Whitespace+ , Plaintext "As"+ , Whitespace+ , Plaintext "such,"+ , Whitespace+ , Plaintext "be"+ , Whitespace+ , Plaintext "aware"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "whatever"+ , Whitespace+ , Plaintext "changes"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "make"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "command-line"+ , Whitespace+ , Plaintext "prior"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "pressing"+ , Whitespace+ , Code "<Enter>"+ , Whitespace+ , Plaintext "must"+ , Whitespace+ , Plaintext "keep"+ , Whitespace+ , Plaintext "it"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "valid"+ , Whitespace+ , Plaintext "pattern,"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Plaintext "bad"+ , Whitespace+ , Plaintext "things"+ , Whitespace+ , Plaintext "will"+ , Whitespace+ , Plaintext "happen."+ ]+ , Paragraph+ [ Plaintext "The"+ , Whitespace+ , Plaintext "mapping"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "be"+ , Whitespace+ , Plaintext "suppressed"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "setting:"+ ]+ , Fenced [ "let g:ScalpelMap=0" ]+ , Paragraph+ [ Plaintext "Or" , Whitespace , Plaintext "overridden:" ]+ , Fenced+ [ "\" Use <Leader>s instead of default <Leader>e:"+ , "nmap <Leader>s <Plug>(Scalpel)"+ ]+ , Paragraph+ [ Plaintext "In"+ , Whitespace+ , Plaintext "any"+ , Whitespace+ , Plaintext "case,"+ , Whitespace+ , Plaintext "Scalpel"+ , Whitespace+ , Plaintext "won't"+ , Whitespace+ , Plaintext "overwrite"+ , Whitespace+ , Plaintext "any"+ , Whitespace+ , Plaintext "pre-existing"+ , Whitespace+ , Plaintext "mapping"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "might"+ , Whitespace+ , Plaintext "have"+ , Whitespace+ , Plaintext "defined"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Code "<Leader>e"+ , Plaintext ","+ , Whitespace+ , Plaintext "nor"+ , Whitespace+ , Plaintext "will"+ , Whitespace+ , Plaintext "it"+ , Whitespace+ , Plaintext "create"+ , Whitespace+ , Plaintext "an"+ , Whitespace+ , Plaintext "unnecessary"+ , Whitespace+ , Plaintext "redundant"+ , Whitespace+ , Plaintext "mapping"+ , Whitespace+ , Plaintext "if"+ , Whitespace+ , Plaintext "you've"+ , Whitespace+ , Plaintext "already"+ , Whitespace+ , Plaintext "mapped"+ , Whitespace+ , Plaintext "something"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Code "<Plug>(Scalpel)"+ , Plaintext "."+ ]+ , Paragraph+ [ Plaintext "The"+ , Whitespace+ , Code ":Scalpel"+ , Whitespace+ , Plaintext "command"+ , Whitespace+ , Plaintext "name"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "be"+ , Whitespace+ , Plaintext "overridden"+ , Whitespace+ , Plaintext "if"+ , Whitespace+ , Plaintext "desired."+ , Whitespace+ , Plaintext "For"+ , Whitespace+ , Plaintext "example,"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "could"+ , Whitespace+ , Plaintext "shorten"+ , Whitespace+ , Plaintext "it"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Code ":S"+ , Whitespace+ , Plaintext "with:"+ ]+ , Fenced [ "let g:ScalpelCommand='S'" ]+ , Paragraph+ [ Plaintext "Then"+ , Whitespace+ , Plaintext "your"+ , Whitespace+ , Plaintext "Scalpel"+ , Whitespace+ , Plaintext "prompt"+ , Whitespace+ , Plaintext "would"+ , Whitespace+ , Plaintext "look"+ , Whitespace+ , Plaintext "like:"+ ]+ , Fenced [ ":S/\\v<foo>//" ]+ , Paragraph+ [ Plaintext "The"+ , Whitespace+ , Plaintext "command"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "be"+ , Whitespace+ , Plaintext "entirely"+ , Whitespace+ , Plaintext "suppressed"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "setting"+ , Whitespace+ , Code "g:ScalpelCommand"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "an"+ , Whitespace+ , Plaintext "empty"+ , Whitespace+ , Plaintext "string:"+ ]+ , Fenced [ "let g:ScalpelCommand=''" ]+ , Paragraph+ [ Plaintext "Finally,"+ , Whitespace+ , Plaintext "all"+ , Whitespace+ , Plaintext "plug-in"+ , Whitespace+ , Plaintext "functionality"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "be"+ , Whitespace+ , Plaintext "deactivated"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "setting:"+ ]+ , Fenced [ "let g:ScalpelLoaded=1" ]+ , Paragraph+ [ Plaintext "in"+ , Whitespace+ , Plaintext "your"+ , Whitespace+ , Code "~/.vimrc"+ , Plaintext "."+ ]+ , HeadingAnnotation "Installation"+ , Paragraph+ [ Plaintext "To"+ , Whitespace+ , Plaintext "install"+ , Whitespace+ , Plaintext "Scalpel,"+ , Whitespace+ , Plaintext "use"+ , Whitespace+ , Plaintext "your"+ , Whitespace+ , Plaintext "plug-in"+ , Whitespace+ , Plaintext "management"+ , Whitespace+ , Plaintext "system"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "choice."+ ]+ , Paragraph+ [ Plaintext "If"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "don't"+ , Whitespace+ , Plaintext "have"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "\"plug-in"+ , Whitespace+ , Plaintext "management"+ , Whitespace+ , Plaintext "system"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "choice\""+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "your"+ , Whitespace+ , Plaintext "version"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "Vim"+ , Whitespace+ , Plaintext "has"+ , Whitespace+ , Code "packages"+ , Whitespace+ , Plaintext "support"+ , Whitespace+ , Plaintext "(ie."+ , Whitespace+ , Code "+packages"+ , Whitespace+ , Plaintext "appears"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "output"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Code ":version"+ , Plaintext ")"+ , Whitespace+ , Plaintext "then"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "simply"+ , Whitespace+ , Plaintext "place"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "plugin"+ , Whitespace+ , Plaintext "at"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "location"+ , Whitespace+ , Plaintext "under"+ , Whitespace+ , Plaintext "your"+ , Whitespace+ , Code "'packpath'"+ , Whitespace+ , Plaintext "(eg."+ , Whitespace+ , Code "~/.vim/pack/bundle/start/scalpel"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Plaintext "similar)."+ ]+ , Paragraph+ [ Plaintext "For"+ , Whitespace+ , Plaintext "older"+ , Whitespace+ , Plaintext "versions"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "Vim,"+ , Whitespace+ , Plaintext "I"+ , Whitespace+ , Plaintext "recommend"+ , Whitespace+ , Plaintext "[Pathogen](https://github.com/tpope/vim-pathogen)"+ , Whitespace+ , Plaintext "due"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "its"+ , Whitespace+ , Plaintext "simplicity"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "robustness."+ , Whitespace+ , Plaintext "Assuming"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "have"+ , Whitespace+ , Plaintext "Pathogen"+ , Whitespace+ , Plaintext "installed"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "configured,"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "want"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "install"+ , Whitespace+ , Plaintext "Scalpel"+ , Whitespace+ , Plaintext "into"+ , Whitespace+ , Code "~/.vim/bundle"+ , Plaintext ","+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "do"+ , Whitespace+ , Plaintext "so"+ , Whitespace+ , Plaintext "with:"+ ]+ , Fenced+ [ "git clone https://github.com/wincent/scalpel.git ~/.vim/bundle/scalpel"+ ]+ , Paragraph+ [ Plaintext "Alternatively,"+ , Whitespace+ , Plaintext "if"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "use"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "Git"+ , Whitespace+ , Plaintext "submodule"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "each"+ , Whitespace+ , Plaintext "Vim"+ , Whitespace+ , Plaintext "plug-in,"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "could"+ , Whitespace+ , Plaintext "do"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "following"+ , Whitespace+ , Plaintext "after"+ , Whitespace+ , Code "cd"+ , Plaintext "-ing"+ , Whitespace+ , Plaintext "into"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "top-level"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "your"+ , Whitespace+ , Plaintext "Git"+ , Whitespace+ , Plaintext "superproject:"+ ]+ , Fenced+ [ "git submodule add https://github.com/wincent/scalpel.git ~/vim/bundle/scalpel"+ , "git submodule init"+ ]+ , Paragraph+ [ Plaintext "To"+ , Whitespace+ , Plaintext "generate"+ , Whitespace+ , Plaintext "help"+ , Whitespace+ , Plaintext "tags"+ , Whitespace+ , Plaintext "under"+ , Whitespace+ , Plaintext "Pathogen,"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "do"+ , Whitespace+ , Plaintext "so"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "inside"+ , Whitespace+ , Plaintext "Vim"+ , Whitespace+ , Plaintext "with:"+ ]+ , Fenced [ ":call pathogen#helptags()" ]+ , HeadingAnnotation "Website"+ , Paragraph+ [ Plaintext "The"+ , Whitespace+ , Plaintext "official"+ , Whitespace+ , Plaintext "Scalpel"+ , Whitespace+ , Plaintext "source"+ , Whitespace+ , Plaintext "code"+ , Whitespace+ , Plaintext "repo"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "at:"+ ]+ , Paragraph [ Plaintext "http://git.wincent.com/scalpel.git" ]+ , Paragraph+ [ Plaintext "Mirrors"+ , Whitespace+ , Plaintext "exist"+ , Whitespace+ , Plaintext "at:"+ ]+ , List+ [ ListItem [ Plaintext "https://github.com/wincent/scalpel" ]+ , ListItem [ Plaintext "https://gitlab.com/wincent/scalpel" ]+ , ListItem [ Plaintext "https://bitbucket.org/ghurrell/scalpel" ]+ ]+ , Paragraph+ [ Plaintext "Official"+ , Whitespace+ , Plaintext "releases"+ , Whitespace+ , Plaintext "are"+ , Whitespace+ , Plaintext "listed"+ , Whitespace+ , Plaintext "at:"+ ]+ , Paragraph+ [ Plaintext "http://www.vim.org/scripts/script.php?script_id=5381"+ ]+ , HeadingAnnotation "License"+ , Paragraph+ [ Plaintext "Copyright"+ , Whitespace+ , Plaintext "(c)"+ , Whitespace+ , Plaintext "2016-present"+ , Whitespace+ , Plaintext "Greg"+ , Whitespace+ , Plaintext "Hurrell"+ ]+ , Paragraph+ [ Plaintext "Permission"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "hereby"+ , Whitespace+ , Plaintext "granted,"+ , Whitespace+ , Plaintext "free"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "charge,"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "any"+ , Whitespace+ , Plaintext "person"+ , Whitespace+ , Plaintext "obtaining"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "copy"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "this"+ , Whitespace+ , Plaintext "software"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "associated"+ , Whitespace+ , Plaintext "documentation"+ , Whitespace+ , Plaintext "files"+ , Whitespace+ , Plaintext "(the"+ , Whitespace+ , Plaintext "\"Software\"),"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "deal"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "Software"+ , Whitespace+ , Plaintext "without"+ , Whitespace+ , Plaintext "restriction,"+ , Whitespace+ , Plaintext "including"+ , Whitespace+ , Plaintext "without"+ , Whitespace+ , Plaintext "limitation"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "rights"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "use,"+ , Whitespace+ , Plaintext "copy,"+ , Whitespace+ , Plaintext "modify,"+ , Whitespace+ , Plaintext "merge,"+ , Whitespace+ , Plaintext "publish,"+ , Whitespace+ , Plaintext "distribute,"+ , Whitespace+ , Plaintext "sublicense,"+ , Whitespace+ , Plaintext "and/or"+ , Whitespace+ , Plaintext "sell"+ , Whitespace+ , Plaintext "copies"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "Software,"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "permit"+ , Whitespace+ , Plaintext "persons"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "whom"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "Software"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "furnished"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "do"+ , Whitespace+ , Plaintext "so,"+ , Whitespace+ , Plaintext "subject"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "following"+ , Whitespace+ , Plaintext "conditions:"+ ]+ , Paragraph+ [ Plaintext "The"+ , Whitespace+ , Plaintext "above"+ , Whitespace+ , Plaintext "copyright"+ , Whitespace+ , Plaintext "notice"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "this"+ , Whitespace+ , Plaintext "permission"+ , Whitespace+ , Plaintext "notice"+ , Whitespace+ , Plaintext "shall"+ , Whitespace+ , Plaintext "be"+ , Whitespace+ , Plaintext "included"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "all"+ , Whitespace+ , Plaintext "copies"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Plaintext "substantial"+ , Whitespace+ , Plaintext "portions"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "Software."+ ]+ , Paragraph+ [ Plaintext "THE"+ , Whitespace+ , Plaintext "SOFTWARE"+ , Whitespace+ , Plaintext "IS"+ , Whitespace+ , Plaintext "PROVIDED"+ , Whitespace+ , Plaintext "\"AS"+ , Whitespace+ , Plaintext "IS\","+ , Whitespace+ , Plaintext "WITHOUT"+ , Whitespace+ , Plaintext "WARRANTY"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "ANY"+ , Whitespace+ , Plaintext "KIND,"+ , Whitespace+ , Plaintext "EXPRESS"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "IMPLIED,"+ , Whitespace+ , Plaintext "INCLUDING"+ , Whitespace+ , Plaintext "BUT"+ , Whitespace+ , Plaintext "NOT"+ , Whitespace+ , Plaintext "LIMITED"+ , Whitespace+ , Plaintext "TO"+ , Whitespace+ , Plaintext "THE"+ , Whitespace+ , Plaintext "WARRANTIES"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "MERCHANTABILITY,"+ , Whitespace+ , Plaintext "FITNESS"+ , Whitespace+ , Plaintext "FOR"+ , Whitespace+ , Plaintext "A"+ , Whitespace+ , Plaintext "PARTICULAR"+ , Whitespace+ , Plaintext "PURPOSE"+ , Whitespace+ , Plaintext "AND"+ , Whitespace+ , Plaintext "NONINFRINGEMENT."+ , Whitespace+ , Plaintext "IN"+ , Whitespace+ , Plaintext "NO"+ , Whitespace+ , Plaintext "EVENT"+ , Whitespace+ , Plaintext "SHALL"+ , Whitespace+ , Plaintext "THE"+ , Whitespace+ , Plaintext "AUTHORS"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "COPYRIGHT"+ , Whitespace+ , Plaintext "HOLDERS"+ , Whitespace+ , Plaintext "BE"+ , Whitespace+ , Plaintext "LIABLE"+ , Whitespace+ , Plaintext "FOR"+ , Whitespace+ , Plaintext "ANY"+ , Whitespace+ , Plaintext "CLAIM,"+ , Whitespace+ , Plaintext "DAMAGES"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "OTHER"+ , Whitespace+ , Plaintext "LIABILITY,"+ , Whitespace+ , Plaintext "WHETHER"+ , Whitespace+ , Plaintext "IN"+ , Whitespace+ , Plaintext "AN"+ , Whitespace+ , Plaintext "ACTION"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "CONTRACT,"+ , Whitespace+ , Plaintext "TORT"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "OTHERWISE,"+ , Whitespace+ , Plaintext "ARISING"+ , Whitespace+ , Plaintext "FROM,"+ , Whitespace+ , Plaintext "OUT"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "IN"+ , Whitespace+ , Plaintext "CONNECTION"+ , Whitespace+ , Plaintext "WITH"+ , Whitespace+ , Plaintext "THE"+ , Whitespace+ , Plaintext "SOFTWARE"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "THE"+ , Whitespace+ , Plaintext "USE"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "OTHER"+ , Whitespace+ , Plaintext "DEALINGS"+ , Whitespace+ , Plaintext "IN"+ , Whitespace+ , Plaintext "THE"+ , Whitespace+ , Plaintext "SOFTWARE."+ ]+ , HeadingAnnotation "Development"+ , SubheadingAnnotation "Contributing patches"+ , Paragraph+ [ Plaintext "Patches"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "be"+ , Whitespace+ , Plaintext "sent"+ , Whitespace+ , Plaintext "via"+ , Whitespace+ , Plaintext "mail"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "greg@hurrell.net,"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Plaintext "as"+ , Whitespace+ , Plaintext "GitHub"+ , Whitespace+ , Plaintext "pull"+ , Whitespace+ , Plaintext "requests"+ , Whitespace+ , Plaintext "at:"+ , Whitespace+ , Plaintext "https://github.com/wincent/scalpel/pulls"+ ]+ , SubheadingAnnotation "Cutting a new release"+ , Paragraph+ [ Plaintext "At"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "moment"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "release"+ , Whitespace+ , Plaintext "process"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "manual:"+ ]+ , List+ [ ListItem+ [ Plaintext "Perform"+ , Whitespace+ , Plaintext "final"+ , Whitespace+ , Plaintext "sanity"+ , Whitespace+ , Plaintext "checks"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "manual"+ , Whitespace+ , Plaintext "testing."+ ]+ , ListItem+ [ Plaintext "Update"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "[scalpel-history](#user-content-scalpel-history)"+ , Whitespace+ , Plaintext "section"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "documentation."+ ]+ , ListItem+ [ Plaintext "Regenerate"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "documentation:"+ ]+ ]+ , Fenced [ "docvim README.md doc/scalpel.txt" ]+ , List+ [ ListItem+ [ Plaintext "Verify"+ , Whitespace+ , Plaintext "clean"+ , Whitespace+ , Plaintext "work"+ , Whitespace+ , Plaintext "tree:"+ ]+ ]+ , Fenced [ "git status" ]+ , List+ [ ListItem+ [ Plaintext "Tag"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "release:"+ ]+ ]+ , Fenced [ "git tag -s -m \"$VERSION release\" $VERSION" ]+ , List+ [ ListItem+ [ Plaintext "Publish"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "code:"+ ]+ ]+ , Fenced+ [ "git push origin master --follow-tags"+ , "git push github master --follow-tags"+ ]+ , List+ [ ListItem+ [ Plaintext "Produce"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "release"+ , Whitespace+ , Plaintext "archive:"+ ]+ ]+ , Fenced [ "git archive -o scalpel-$VERSION.zip HEAD -- ." ]+ , List+ [ ListItem+ [ Plaintext "Upload"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "http://www.vim.org/scripts/script.php?script_id=5381"+ ]+ ]+ , HeadingAnnotation "Authors"+ , Paragraph+ [ Plaintext "Scalpel"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "written"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "maintained"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "Greg"+ , Whitespace+ , Plaintext "Hurrell"+ , Whitespace+ , Plaintext "<greg@hurrell.net>."+ ]+ , HeadingAnnotation "History"+ , SubheadingAnnotation "0.2 (not yet released)"+ , List+ [ ListItem+ [ Plaintext "Support"+ , Whitespace+ , Plaintext "visual"+ , Whitespace+ , Plaintext "mode."+ ]+ ]+ , SubheadingAnnotation "0.1 (29 April 2016)"+ , List+ [ ListItem+ [ Plaintext "Initial" , Whitespace , Plaintext "release." ]+ ]+ , Project+ [ Unit+ [ FunctionDeclaration+ { functionBang = True+ , functionName = "scalpel#cword"+ , functionArguments = ArgumentList [ Argument "curpos" ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ LetStatement+ { letLexpr = "l:line" , letValue = "getline(a:curpos[1])" }+ , LetStatement { letLexpr = "l:col" , letValue = "a:curpos[2]" }+ , LetStatement+ { letLexpr = "l:chars" , letValue = "split(l:line, '\\zs')" }+ , LetStatement { letLexpr = "l:word" , letValue = "[]" }+ , GenericStatement "for l:char in l:chars[l:col:]"+ , GenericStatement "if match(l:char, '\\k') != -1"+ , GenericStatement "call add(l:word, l:char)"+ , GenericStatement "else"+ , GenericStatement "break"+ , GenericStatement "endif"+ , GenericStatement "endfor"+ , GenericStatement "for l:char in reverse(l:chars[:l:col - 1])"+ , GenericStatement "if match(l:char, '\\k') != -1"+ , GenericStatement "call insert(l:word, l:char, 0)"+ , GenericStatement "else"+ , GenericStatement "break"+ , GenericStatement "endif"+ , GenericStatement "endfor"+ , GenericStatement "return join(l:word, '')"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "scalpel#substitute"+ , functionArguments =+ ArgumentList+ [ Argument "patterns"+ , Argument "line1"+ , Argument "line2"+ , Argument "count"+ ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement "if a:count == -1"+ , LetStatement+ { letLexpr = "l:currentline" , letValue = "a:line1" }+ , LetStatement { letLexpr = "l:firstline" , letValue = "1" }+ , LetStatement { letLexpr = "l:lastline" , letValue = "line('$')" }+ , GenericStatement "else"+ , LetStatement+ { letLexpr = "l:firstline"+ , letValue = "a:line1 <= a:line2 ? a:line1 : a:line2"+ }+ , LetStatement+ { letLexpr = "l:lastline"+ , letValue = "a:line2 >= a:line2 ? a:line2 : a:line1"+ }+ , LetStatement+ { letLexpr = "l:currentline" , letValue = "l:firstline" }+ , GenericStatement "endif"+ , GenericStatement+ "if match(a:patterns, '\\v^/[^/]*/[^/]*/$') != 0"+ , GenericStatement "echomsg 'Invalid patterns: ' . a:patterns"+ , GenericStatement+ "echomsg 'Expected patterns of the form \"/foo/bar/\".'"+ , GenericStatement "return"+ , GenericStatement "endif"+ , GenericStatement "if getregtype('s') != ''"+ , LetStatement+ { letLexpr = "l:register" , letValue = "getreg('s')" }+ , GenericStatement "endif"+ , GenericStatement "normal! qs"+ , GenericStatement "redir => l:replacements"+ , GenericStatement "try"+ , GenericStatement+ "execute l:currentline . ',' . l:lastline . 's' . a:patterns . 'gce#'"+ , GenericStatement "catch /^Vim:Interrupt$/"+ , GenericStatement "return"+ , GenericStatement "finally"+ , GenericStatement "normal! q"+ , LetStatement+ { letLexpr = "l:transcript" , letValue = "getreg('s')" }+ , GenericStatement "if exists('l:register')"+ , GenericStatement "call setreg('s', l:register)"+ , GenericStatement "endif"+ , GenericStatement "endtry"+ , GenericStatement "redir END"+ , GenericStatement "if len(l:replacements) > 0"+ , LetStatement+ { letLexpr = "l:last"+ , letValue = "strpart(l:transcript, len(l:transcript) - 1)"+ }+ , GenericStatement+ "if l:last ==# 'l' || l:last ==# 'q' || l:last ==# '\ESC'"+ , GenericStatement "return"+ , GenericStatement "elseif l:last ==# 'a'"+ , GenericStatement "if l:currentline > l:firstline"+ , GenericStatement+ "execute l:firstline . ',' . l:currentline . '-&gce'"+ , GenericStatement "endif"+ , GenericStatement "return"+ , GenericStatement "endif"+ , GenericStatement "endif"+ , GenericStatement "if l:currentline > l:firstline"+ , GenericStatement+ "execute l:firstline . ',' . l:currentline . '-&gce'"+ , GenericStatement "endif"+ ]+ }+ ]+ , Unit+ [ GenericStatement+ "if exists('g:ScalpelLoaded') || &compatible || v:version < 700"+ , GenericStatement "finish"+ , GenericStatement "endif"+ , LetStatement { letLexpr = "g:ScalpelLoaded " , letValue = "1" }+ , LetStatement+ { letLexpr = "s:cpoptions " , letValue = "&cpoptions" }+ , GenericStatement "set cpoptions&vim"+ , LetStatement+ { letLexpr = "s:command"+ , letValue = "get(g:, 'ScalpelCommand', 'Scalpel')"+ }+ , GenericStatement "if s:command ==# ''"+ , GenericStatement "finish"+ , GenericStatement+ "elseif match(s:command, '\\v\\C^[A-Z][A-Za-z]*$') == -1"+ , GenericStatement+ "echoerr 'g:ScalpelCommand must contain only letters and start with a ' . 'capital letter'"+ , GenericStatement "finish"+ , GenericStatement "endif"+ , GenericStatement+ "execute 'command! -nargs=1 -range ' . s:command . ' call scalpel#substitute(<q-args>, <line1>, <line2>, <count>)'"+ , LetStatement { letLexpr = "s:curpos" , letValue = "getcurpos()" }+ , GenericStatement "augroup Scalpel"+ , GenericStatement "autocmd!"+ , GenericStatement "autocmd CursorMoved * let s:curpos=getcurpos()"+ , GenericStatement "augroup END"+ , FunctionDeclaration+ { functionBang = True+ , functionName = "s:GetCurpos"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody = [ GenericStatement "return s:curpos" ]+ }+ , GenericStatement+ "execute 'nnoremap <Plug>(Scalpel) :' . s:command . \"/\\\\v<<C-R>=expand('<cword>')<CR>>//<Left>\""+ , GenericStatement+ "execute 'vnoremap <Plug>(ScalpelVisual) :' . s:command . \"/\\\\v<<C-R>=scalpel#cword(<SID>GetCurpos())<CR>>//<Left>\""+ , LetStatement+ { letLexpr = "s:map" , letValue = "get(g:, 'ScalpelMap', 1)" }+ , GenericStatement "if s:map"+ , GenericStatement+ "if !hasmapto('<Plug>(Scalpel)') && maparg('<leader>e', 'n') ==# ''"+ , GenericStatement "nmap <unique> <Leader>e <Plug>(Scalpel)"+ , GenericStatement "endif"+ , GenericStatement+ "if !hasmapto('<Plug>(ScalpelVisual)') && maparg('<leader>e', 'v') ==# ''"+ , GenericStatement "vmap <unique> <Leader>e <Plug>(ScalpelVisual)"+ , GenericStatement "endif"+ , GenericStatement "endif"+ , LetStatement+ { letLexpr = "&cpoptions " , letValue = "s:cpoptions" }+ , UnletStatement { unletBang = False , unletBody = "s:cpoptions" }+ ]+ ]+ ]
+ tests/fixtures/integration/scalpel/golden/markdown.golden view
@@ -0,0 +1,168 @@+# scalpel<a name="scalpel-scalpel" href="#user-content-scalpel-scalpel"></a>++## Intro<a name="scalpel-intro" href="#user-content-scalpel-intro"></a>++Scalpel provides a streamlined shortcut for replacing all instances of the word currently under the cursor throughout a file.++In normal mode pressing `<Leader>e` (mnemonic: "edit") will display a prompt pre-populated with the current word and with the cursor placed so that you can start typing the desired replacement:++```+:Scalpel/\v<foo>//+```++Press `<Enter>` and Scalpel will prompt to confirm each substitution, starting at the current word (unlike a normal `:%s` command, which starts at the top of the file).++Scalpel works similarly in visual mode, except that it scopes itself to the current visual selection rather than operating over the entire file.++Note that `:Scalpel` just calls through to an underlying `scalpel#substitute` function that does the real work, ultimately calling Vim's own `:substitute`. As such, be aware that whatever changes you make to the command-line prior to pressing `<Enter>` must keep it a valid pattern, or bad things will happen.++The mapping can be suppressed by setting:++```+let g:ScalpelMap=0+```++Or overridden:++```+" Use <Leader>s instead of default <Leader>e:+nmap <Leader>s <Plug>(Scalpel)+```++In any case, Scalpel won't overwrite any pre-existing mapping that you might have defined for `<Leader>e`, nor will it create an unnecessary redundant mapping if you've already mapped something to `<Plug>(Scalpel)`.++The `:Scalpel` command name can be overridden if desired. For example, you could shorten it to `:S` with:++```+let g:ScalpelCommand='S'+```++Then your Scalpel prompt would look like:++```+:S/\v<foo>//+```++The command can be entirely suppressed by setting `g:ScalpelCommand` to an empty string:++```+let g:ScalpelCommand=''+```++Finally, all plug-in functionality can be deactivated by setting:++```+let g:ScalpelLoaded=1+```++in your `~/.vimrc`.++## Installation<a name="scalpel-installation" href="#user-content-scalpel-installation"></a>++To install Scalpel, use your plug-in management system of choice.++If you don't have a "plug-in management system of choice" and your version of Vim has `packages` support (ie. `+packages` appears in the output of `:version`) then you can simply place the plugin at a location under your `'packpath'` (eg. `~/.vim/pack/bundle/start/scalpel` or similar).++For older versions of Vim, I recommend [Pathogen](https://github.com/tpope/vim-pathogen) due to its simplicity and robustness. Assuming that you have Pathogen installed and configured, and that you want to install Scalpel into `~/.vim/bundle`, you can do so with:++```+git clone https://github.com/wincent/scalpel.git ~/.vim/bundle/scalpel+```++Alternatively, if you use a Git submodule for each Vim plug-in, you could do the following after `cd`-ing into the top-level of your Git superproject:++```+git submodule add https://github.com/wincent/scalpel.git ~/vim/bundle/scalpel+git submodule init+```++To generate help tags under Pathogen, you can do so from inside Vim with:++```+:call pathogen#helptags()+```++## Website<a name="scalpel-website" href="#user-content-scalpel-website"></a>++The official Scalpel source code repo is at:++http://git.wincent.com/scalpel.git++Mirrors exist at:++- https://github.com/wincent/scalpel+- https://gitlab.com/wincent/scalpel+- https://bitbucket.org/ghurrell/scalpel++Official releases are listed at:++http://www.vim.org/scripts/script.php?script_id=5381++## License<a name="scalpel-license" href="#user-content-scalpel-license"></a>++Copyright (c) 2016-present Greg Hurrell++Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.++## Development<a name="scalpel-development" href="#user-content-scalpel-development"></a>++### Contributing patches<a name="scalpel-contributing-patches" href="#user-content-scalpel-contributing-patches"></a>++Patches can be sent via mail to greg@hurrell.net, or as GitHub pull requests at: https://github.com/wincent/scalpel/pulls++### Cutting a new release<a name="scalpel-cutting-a-new-release" href="#user-content-scalpel-cutting-a-new-release"></a>++At the moment the release process is manual:++- Perform final sanity checks and manual testing.+- Update the [scalpel-history](#user-content-scalpel-history) section of the documentation.+- Regenerate the documentation:++```+docvim README.md doc/scalpel.txt+```++- Verify clean work tree:++```+git status+```++- Tag the release:++```+git tag -s -m "$VERSION release" $VERSION+```++- Publish the code:++```+git push origin master --follow-tags+git push github master --follow-tags+```++- Produce the release archive:++```+git archive -o scalpel-$VERSION.zip HEAD -- .+```++- Upload to http://www.vim.org/scripts/script.php?script_id=5381++## Authors<a name="scalpel-authors" href="#user-content-scalpel-authors"></a>++Scalpel is written and maintained by Greg Hurrell <greg@hurrell.net>.++## History<a name="scalpel-history" href="#user-content-scalpel-history"></a>++### 0.2 (not yet released)<a name="scalpel-02-not-yet-released" href="#user-content-scalpel-02-not-yet-released"></a>++- Support visual mode.++### 0.1 (29 April 2016)<a name="scalpel-01-29-april-2016" href="#user-content-scalpel-01-29-april-2016"></a>++- Initial release.
+ tests/fixtures/integration/scalpel/golden/plaintext.golden view
@@ -0,0 +1,182 @@+*scalpel.txt* Scalpel plug-in for Vim *scalpel*++CONTENTS *scalpel-contents*++1. Intro |scalpel-intro|+2. Installation |scalpel-installation|+3. Website |scalpel-website|+4. License |scalpel-license|+5. Development |scalpel-development|+6. Authors |scalpel-authors|+7. History |scalpel-history|++INTRO *scalpel-intro*++Scalpel provides a streamlined shortcut for replacing all instances of the+word currently under the cursor throughout a file.++In normal mode pressing `<Leader>e` (mnemonic: "edit") will display a prompt+pre-populated with the current word and with the cursor placed so that you+can start typing the desired replacement:+>+ :Scalpel/\v<foo>//+<+Press `<Enter>` and Scalpel will prompt to confirm each substitution, starting+at the current word (unlike a normal `:%s` command, which starts at the top of+the file).++Scalpel works similarly in visual mode, except that it scopes itself to the+current visual selection rather than operating over the entire file.++Note that `:Scalpel` just calls through to an underlying `scalpel#substitute`+function that does the real work, ultimately calling Vim's own `:substitute`.+As such, be aware that whatever changes you make to the command-line prior+to pressing `<Enter>` must keep it a valid pattern, or bad things will happen.++The mapping can be suppressed by setting:+>+ let g:ScalpelMap=0+<+Or overridden:+>+ " Use <Leader>s instead of default <Leader>e:+ nmap <Leader>s <Plug>(Scalpel)+<+In any case, Scalpel won't overwrite any pre-existing mapping that you might+have defined for `<Leader>e`, nor will it create an unnecessary redundant+mapping if you've already mapped something to `<Plug>(Scalpel)`.++The `:Scalpel` command name can be overridden if desired. For example, you+could shorten it to `:S` with:+>+ let g:ScalpelCommand='S'+<+Then your Scalpel prompt would look like:+>+ :S/\v<foo>//+<+The command can be entirely suppressed by setting `g:ScalpelCommand` to an+empty string:+>+ let g:ScalpelCommand=''+<+Finally, all plug-in functionality can be deactivated by setting:+>+ let g:ScalpelLoaded=1+<+in your `~/.vimrc`.++INSTALLATION *scalpel-installation*++To install Scalpel, use your plug-in management system of choice.++If you don't have a "plug-in management system of choice" and your version+of Vim has `packages` support (ie. `+packages` appears in the output of+`:version`) then you can simply place the plugin at a location under your+`'packpath'` (eg. `~/.vim/pack/bundle/start/scalpel` or similar).++For older versions of Vim, I recommend+[Pathogen](https://github.com/tpope/vim-pathogen) due to its simplicity and+robustness. Assuming that you have Pathogen installed and configured, and+that you want to install Scalpel into `~/.vim/bundle`, you can do so with:+>+ git clone https://github.com/wincent/scalpel.git ~/.vim/bundle/scalpel+<+Alternatively, if you use a Git submodule for each Vim plug-in, you could do+the following after `cd`-ing into the top-level of your Git superproject:+>+ git submodule add https://github.com/wincent/scalpel.git ~/vim/bundle/scalpel+ git submodule init+<+To generate help tags under Pathogen, you can do so from inside Vim with:+>+ :call pathogen#helptags()+<+WEBSITE *scalpel-website*++The official Scalpel source code repo is at:++http://git.wincent.com/scalpel.git++Mirrors exist at:++- https://github.com/wincent/scalpel+- https://gitlab.com/wincent/scalpel+- https://bitbucket.org/ghurrell/scalpel++Official releases are listed at:++http://www.vim.org/scripts/script.php?script_id=5381++LICENSE *scalpel-license*++Copyright (c) 2016-present Greg Hurrell++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to+deal in the Software without restriction, including without limitation the+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or+sell copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in+all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS+IN THE SOFTWARE.++DEVELOPMENT *scalpel-development*++Contributing patches ~++Patches can be sent via mail to greg@hurrell.net, or as GitHub pull requests+at: https://github.com/wincent/scalpel/pulls++Cutting a new release ~++At the moment the release process is manual:++- Perform final sanity checks and manual testing.+- Update the [scalpel-history](#user-content-scalpel-history) section of the+ documentation.+- Regenerate the documentation:+>+ docvim README.md doc/scalpel.txt+<+- Verify clean work tree:+>+ git status+<+- Tag the release:+>+ git tag -s -m "$VERSION release" $VERSION+<+- Publish the code:+>+ git push origin master --follow-tags+ git push github master --follow-tags+<+- Produce the release archive:+>+ git archive -o scalpel-$VERSION.zip HEAD -- .+<+- Upload to http://www.vim.org/scripts/script.php?script_id=5381++AUTHORS *scalpel-authors*++Scalpel is written and maintained by Greg Hurrell <greg@hurrell.net>.++HISTORY *scalpel-history*++0.2 (not yet released) ~++- Support visual mode.++0.1 (29 April 2016) ~++- Initial release.
+ tests/fixtures/integration/scalpel/input/autoload/scalpel.vim view
@@ -0,0 +1,88 @@+" Copyright 2016-present Greg Hurrell. All rights reserved.+" Licensed under the terms of the MIT license.++function! scalpel#cword(curpos) abort+ " <cword> Doesn't work usefully in visual mode (always returns first word),+ " so fake it.+ let l:line=getline(a:curpos[1])+ let l:col=a:curpos[2]+ let l:chars=split(l:line, '\zs')+ let l:word=[]++ " Look for keyword characters rightwards.+ for l:char in l:chars[l:col:]+ if match(l:char, '\k') != -1+ call add(l:word, l:char)+ else+ break+ endif+ endfor++ " Look for keyword characters leftwards.+ for l:char in reverse(l:chars[:l:col - 1])+ if match(l:char, '\k') != -1+ call insert(l:word, l:char, 0)+ else+ break+ endif+ endfor++ return join(l:word, '')+endfunction++function! scalpel#substitute(patterns, line1, line2, count) abort+ if a:count == -1+ " No range supplied, operate on whole buffer.+ let l:currentline=a:line1+ let l:firstline=1+ let l:lastline=line('$')+ else+ let l:firstline=a:line1 <= a:line2 ? a:line1 : a:line2+ let l:lastline=a:line2 >= a:line2 ? a:line2 : a:line1+ let l:currentline=l:firstline+ endif+ if match(a:patterns, '\v^/[^/]*/[^/]*/$') != 0+ echomsg 'Invalid patterns: ' . a:patterns+ echomsg 'Expected patterns of the form "/foo/bar/".'+ return+ endif+ if getregtype('s') != ''+ let l:register=getreg('s')+ endif+ normal! qs+ redir => l:replacements+ try+ execute l:currentline . ',' . l:lastline . 's' . a:patterns . 'gce#'+ catch /^Vim:Interrupt$/+ return+ finally+ normal! q+ let l:transcript=getreg('s')+ if exists('l:register')+ call setreg('s', l:register)+ endif+ endtry+ redir END+ if len(l:replacements) > 0+ " At least one instance of pattern was found.+ let l:last=strpart(l:transcript, len(l:transcript) - 1)+ if l:last ==# 'l' || l:last ==# 'q' || l:last ==# ''+ " User bailed.+ return+ elseif l:last ==# 'a'+ " Loop around to top of range/file and continue.+ " Avoid unwanted "Backwards range given, OK to swap (y/n)?" messages.+ if l:currentline > l:firstline+ " Drop c flag.+ execute l:firstline . ',' . l:currentline . '-&gce'+ endif+ return+ endif+ endif++ " Loop around to top of range/file and continue.+ " Avoid unwanted "Backwards range given, OK to swap (y/n)?" messages.+ if l:currentline > l:firstline+ execute l:firstline . ',' . l:currentline . '-&gce'+ endif+endfunction
+ tests/fixtures/integration/scalpel/input/plugin/scalpel.vim view
@@ -0,0 +1,264 @@+" Copyright 2016-present Greg Hurrell. All rights reserved.+" Licensed under the terms of the MIT license.++""+" @plugin scalpel Scalpel plug-in for Vim+"+" # Intro+"+" Scalpel provides a streamlined shortcut for replacing all instances of the+" word currently under the cursor throughout a file.+"+" In normal mode pressing `<Leader>e` (mnemonic: "edit") will display a prompt+" pre-populated with the current word and with the cursor placed so that you can+" start typing the desired replacement:+"+"+" ```+" :Scalpel/\v<foo>//+" ```+"+" Press `<Enter>` and Scalpel will prompt to confirm each substitution, starting+" at the current word (unlike a normal `:%s` command, which starts at the top of+" the file).+"+" Scalpel works similarly in visual mode, except that it scopes itself to the+" current visual selection rather than operating over the entire file.+"+" Note that `:Scalpel` just calls through to an underlying `scalpel#substitute`+" function that does the real work, ultimately calling Vim's own `:substitute`.+" As such, be aware that whatever changes you make to the command-line prior to+" pressing `<Enter>` must keep it a valid pattern, or bad things will happen.+"+" The mapping can be suppressed by setting:+"+" ```+" let g:ScalpelMap=0+" ```+"+" Or overridden:+"+" ```+" " Use <Leader>s instead of default <Leader>e:+" nmap <Leader>s <Plug>(Scalpel)+" ```+"+" In any case, Scalpel won't overwrite any pre-existing mapping that you might+" have defined for `<Leader>e`, nor will it create an unnecessary redundant+" mapping if you've already mapped something to `<Plug>(Scalpel)`.+"+" The `:Scalpel` command name can be overridden if desired. For example, you+" could shorten it to `:S` with:+"+" ```+" let g:ScalpelCommand='S'+" ```+"+" Then your Scalpel prompt would look like:+"+" ```+" :S/\v<foo>//+" ```+"+" The command can be entirely suppressed by setting `g:ScalpelCommand` to an+" empty string:+"+" ```+" let g:ScalpelCommand=''+" ```+"+" Finally, all plug-in functionality can be deactivated by setting:+"+" ```+" let g:ScalpelLoaded=1+" ```+"+" in your `~/.vimrc`.+"+" # Installation+"+" To install Scalpel, use your plug-in management system of choice.+"+" If you don't have a "plug-in management system of choice" and your version of+" Vim has `packages` support (ie. `+packages` appears in the output of+" `:version`) then you can simply place the plugin at a location under your+" `'packpath'` (eg. `~/.vim/pack/bundle/start/scalpel` or similar).+"+" For older versions of Vim, I recommend+" [Pathogen](https://github.com/tpope/vim-pathogen) due to its simplicity and+" robustness. Assuming that you have Pathogen installed and configured, and that+" you want to install Scalpel into `~/.vim/bundle`, you can do so with:+"+" ```+" git clone https://github.com/wincent/scalpel.git ~/.vim/bundle/scalpel+" ```+"+" Alternatively, if you use a Git submodule for each Vim plug-in, you could do+" the following after `cd`-ing into the top-level of your Git superproject:+"+" ```+" git submodule add https://github.com/wincent/scalpel.git ~/vim/bundle/scalpel+" git submodule init+" ```+"+" To generate help tags under Pathogen, you can do so from inside Vim with:+"+" ```+" :call pathogen#helptags()+" ```+"+" # Website+"+" The official Scalpel source code repo is at:+"+" http://git.wincent.com/scalpel.git+"+" Mirrors exist at:+"+" - https://github.com/wincent/scalpel+" - https://gitlab.com/wincent/scalpel+" - https://bitbucket.org/ghurrell/scalpel+"+" Official releases are listed at:+"+" http://www.vim.org/scripts/script.php?script_id=5381+"+" # License+"+" Copyright (c) 2016-present Greg Hurrell+"+" Permission is hereby granted, free of charge, to any person obtaining a copy+" of this software and associated documentation files (the "Software"), to deal+" in the Software without restriction, including without limitation the rights+" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+" copies of the Software, and to permit persons to whom the Software is+" furnished to do so, subject to the following conditions:+"+" The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.+"+" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+" SOFTWARE.+"+" # Development+"+" ## Contributing patches+"+" Patches can be sent via mail to greg@hurrell.net, or as GitHub pull requests+" at: https://github.com/wincent/scalpel/pulls+"+" ## Cutting a new release+"+" At the moment the release process is manual:+"+" - Perform final sanity checks and manual testing.+" - Update the [scalpel-history](#user-content-scalpel-history) section of the documentation.+" - Regenerate the documentation:+"+" ```+" docvim README.md doc/scalpel.txt+" ```+"+" - Verify clean work tree:+"+" ```+" git status+" ```+"+" - Tag the release:+"+" ```+" git tag -s -m "$VERSION release" $VERSION+" ```+"+" - Publish the code:+"+" ```+" git push origin master --follow-tags+" git push github master --follow-tags+" ```+"+" - Produce the release archive:+"+" ```+" git archive -o scalpel-$VERSION.zip HEAD -- .+" ```+"+" - Upload to http://www.vim.org/scripts/script.php?script_id=5381+"+" # Authors+"+" Scalpel is written and maintained by Greg Hurrell <greg@hurrell.net>.+"+" # History+"+" ## 0.2 (not yet released)+"+" - Support visual mode.+"+" ## 0.1 (29 April 2016)+"+" - Initial release.++" Provide users with means to prevent loading, as recommended in `:h+" write-plugin`.+if exists('g:ScalpelLoaded') || &compatible || v:version < 700+ finish+endif+let g:ScalpelLoaded = 1++" Temporarily set 'cpoptions' to Vim default as per `:h use-cpo-save`.+let s:cpoptions = &cpoptions+set cpoptions&vim++let s:command=get(g:, 'ScalpelCommand', 'Scalpel')+if s:command ==# ''+ finish+elseif match(s:command, '\v\C^[A-Z][A-Za-z]*$') == -1+ echoerr 'g:ScalpelCommand must contain only letters and start with a ' .+ \ 'capital letter'+ finish+endif+execute 'command! -nargs=1 -range '+ \ . s:command+ \ . ' call scalpel#substitute(<q-args>, <line1>, <line2>, <count>)'++" Need to remember last-seen cursor position because `getcurpos()` is not useful+" in VISUAL modes.+let s:curpos=getcurpos()+augroup Scalpel+ autocmd!+ autocmd CursorMoved * let s:curpos=getcurpos()+augroup END++" Local accessor so that we can reference the script-local variable from inside+" a mapping (as per http://superuser.com/questions/566720).+function! s:GetCurpos()+ return s:curpos+endfunction++" Change all instances of current word (mnemonic: edit).+execute 'nnoremap <Plug>(Scalpel) :' .+ \ s:command .+ \ "/\\v<<C-R>=expand('<cword>')<CR>>//<Left>"+execute 'vnoremap <Plug>(ScalpelVisual) :' .+ \ s:command .+ \ "/\\v<<C-R>=scalpel#cword(<SID>GetCurpos())<CR>>//<Left>"++let s:map=get(g:, 'ScalpelMap', 1)+if s:map+ if !hasmapto('<Plug>(Scalpel)') && maparg('<leader>e', 'n') ==# ''+ nmap <unique> <Leader>e <Plug>(Scalpel)+ endif+ if !hasmapto('<Plug>(ScalpelVisual)') && maparg('<leader>e', 'v') ==# ''+ vmap <unique> <Leader>e <Plug>(ScalpelVisual)+ endif+endif++" Restore 'cpoptions' to its former value.+let &cpoptions = s:cpoptions+unlet s:cpoptions
+ tests/fixtures/integration/terminus/golden/ast.golden view
@@ -0,0 +1,281 @@+Project+ [ Project+ [ Unit+ [ FunctionDeclaration+ { functionBang = True+ , functionName = "s:escape"+ , functionArguments = ArgumentList [ Argument "string" ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement+ "return substitute(a:string, \"\\<Esc>\", \"\\<Esc>\\<Esc>\", 'g')"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "terminus#private#wrap"+ , functionArguments = ArgumentList [ Argument "string" ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement "if strlen(a:string) == 0"+ , GenericStatement "return ''"+ , GenericStatement "end"+ , LetStatement+ { letLexpr = "l:tmux_begin" , letValue = "\"\\<Esc>Ptmux;\"" }+ , LetStatement+ { letLexpr = "l:tmux_end" , letValue = "\"\\<Esc>\\\\\"" }+ , GenericStatement+ "return l:tmux_begin . s:escape(a:string) . l:tmux_end"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "terminus#private#focus_lost"+ , functionArguments = ArgumentList []+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ LetStatement+ { letLexpr = "l:cmdline" , letValue = "getcmdline()" }+ , LetStatement { letLexpr = "l:cmdpos" , letValue = "getcmdpos()" }+ , GenericStatement "silent doautocmd FocusLost %"+ , GenericStatement "call setcmdpos(l:cmdpos)"+ , GenericStatement "return l:cmdline"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "terminus#private#focus_gained"+ , functionArguments = ArgumentList []+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ LetStatement+ { letLexpr = "l:cmdline" , letValue = "getcmdline()" }+ , LetStatement { letLexpr = "l:cmdpos" , letValue = "getcmdpos()" }+ , GenericStatement "silent! doautocmd FocusGained %"+ , GenericStatement "call setcmdpos(l:cmdpos)"+ , GenericStatement "return l:cmdline"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "terminus#private#paste"+ , functionArguments = ArgumentList [ Argument "ret" ]+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement "set paste" , GenericStatement "return a:ret" ]+ }+ ]+ , Unit+ [ GenericStatement+ "if exists('g:TerminusLoaded') || &compatible || v:version < 700"+ , GenericStatement "finish"+ , GenericStatement "endif"+ , LetStatement { letLexpr = "g:TerminusLoaded" , letValue = "1" }+ , LetStatement+ { letLexpr = "s:cpoptions" , letValue = "&cpoptions" }+ , GenericStatement "set cpoptions&vim"+ , GenericStatement+ "set autoread \" if not changed in Vim, automatically pick up changes after \"git checkout\" etc"+ , GenericStatement+ "if &ttimeoutlen == -1 && &timeoutlen > 50 || &ttimeoutlen > 50"+ , GenericStatement+ "set ttimeoutlen=50 \" speed up O etc in the Terminal"+ , GenericStatement "endif"+ , LetStatement+ { letLexpr = "s:iterm" , letValue = "exists('$ITERM_PROFILE') ||" }+ , GenericStatement+ "\\ exists('$ITERM_SESSION_ID') || exists('$KONSOLE_DBUS_SESSION') || exists('$KONSOLE_PROFILE_NAME') || exists('g:TerminusAssumeITerm') || filereadable(expand('~/.vim/.assume-iterm'))"+ , LetStatement+ { letLexpr = "s:screenish"+ , letValue = "&term =~# 'screen\\|tmux'"+ }+ , LetStatement+ { letLexpr = "s:tmux" , letValue = "exists('$TMUX')" }+ , LetStatement+ { letLexpr = "s:xterm" , letValue = "&term =~# 'xterm'" }+ , LetStatement+ { letLexpr = "s:shape"+ , letValue = "get(g:, 'TerminusCursorShape', 1)"+ }+ , GenericStatement "if s:shape"+ , LetStatement+ { letLexpr = "s:insert_shape"+ , letValue = "+get(g:, 'TerminusInsertCursorShape', 1)"+ }+ , LetStatement+ { letLexpr = "s:replace_shape"+ , letValue = "+get(g:, 'TerminusReplaceCursorShape', 2)"+ }+ , LetStatement+ { letLexpr = "s:normal_shape"+ , letValue = "+get(g:, 'TerminusNormalCursorShape', 0)"+ }+ , GenericStatement "if s:iterm"+ , LetStatement+ { letLexpr = "s:start_insert"+ , letValue =+ "\"\\<Esc>]50;CursorShape=\" . s:insert_shape . \"\\x7\""+ }+ , LetStatement+ { letLexpr = "s:start_replace"+ , letValue =+ "\"\\<Esc>]50;CursorShape=\" . s:replace_shape . \"\\x7\""+ }+ , LetStatement+ { letLexpr = "s:end_insert"+ , letValue =+ "\"\\<Esc>]50;CursorShape=\" . s:normal_shape . \"\\x7\""+ }+ , GenericStatement "else"+ , LetStatement+ { letLexpr = "s:cursor_shape_to_vte_shape"+ , letValue = "{1: 6, 2: 4, 0: 2}"+ }+ , LetStatement+ { letLexpr = "s:insert_shape"+ , letValue = "s:cursor_shape_to_vte_shape[s:insert_shape]"+ }+ , LetStatement+ { letLexpr = "s:replace_shape"+ , letValue = "s:cursor_shape_to_vte_shape[s:replace_shape]"+ }+ , LetStatement+ { letLexpr = "s:normal_shape"+ , letValue = "s:cursor_shape_to_vte_shape[s:normal_shape]"+ }+ , LetStatement+ { letLexpr = "s:start_insert"+ , letValue = "\"\\<Esc>[\" . s:insert_shape . ' q'"+ }+ , LetStatement+ { letLexpr = "s:start_replace"+ , letValue = "\"\\<Esc>[\" . s:replace_shape . ' q'"+ }+ , LetStatement+ { letLexpr = "s:end_insert"+ , letValue = "\"\\<Esc>[\" . s:normal_shape . ' q'"+ }+ , GenericStatement "endif"+ , GenericStatement "if s:tmux"+ , LetStatement+ { letLexpr = "s:start_insert"+ , letValue = "terminus#private#wrap(s:start_insert)"+ }+ , LetStatement+ { letLexpr = "s:start_replace"+ , letValue = "terminus#private#wrap(s:start_replace)"+ }+ , LetStatement+ { letLexpr = "s:end_insert"+ , letValue = "terminus#private#wrap(s:end_insert)"+ }+ , GenericStatement "endif"+ , LetStatement { letLexpr = "&t_SI" , letValue = "s:start_insert" }+ , GenericStatement+ "if v:version > 704 || v:version == 704 && has('patch687')"+ , LetStatement+ { letLexpr = "&t_SR" , letValue = "s:start_replace" }+ , GenericStatement "end"+ , LetStatement { letLexpr = "&t_EI" , letValue = "s:end_insert" }+ , GenericStatement "endif"+ , LetStatement+ { letLexpr = "s:mouse" , letValue = "get(g:, 'TerminusMouse', 1)" }+ , GenericStatement "if s:mouse"+ , GenericStatement "if has('mouse')"+ , GenericStatement "set mouse=a"+ , GenericStatement "if s:screenish || s:xterm"+ , GenericStatement "if !has('nvim')"+ , GenericStatement "if has('mouse_sgr')"+ , GenericStatement "set ttymouse=sgr"+ , GenericStatement "else"+ , GenericStatement "set ttymouse=xterm2"+ , GenericStatement "endif"+ , GenericStatement "endif"+ , GenericStatement "endif"+ , GenericStatement "endif"+ , GenericStatement "endif"+ , LetStatement+ { letLexpr = "s:focus"+ , letValue = "get(g:, 'TerminusFocusReporting', 1)"+ }+ , GenericStatement "if s:focus"+ , GenericStatement "if has('autocmd')"+ , GenericStatement "augroup Terminus"+ , GenericStatement "autocmd!"+ , GenericStatement "autocmd FocusGained * checktime"+ , GenericStatement "augroup END"+ , GenericStatement "endif"+ , LetStatement+ { letLexpr = "&t_ti." , letValue = "\"\\e[?1004h\"" }+ , LetStatement+ { letLexpr = "&t_te" , letValue = "\"\\e[?1004l\" . &t_te" }+ , GenericStatement "execute \"set <f20>=\\<Esc>[O\""+ , GenericStatement "execute \"set <f21>=\\<Esc>[I\""+ , GenericStatement+ "cnoremap <silent> <f20> <c-\\>eterminus#private#focus_lost()<cr>"+ , GenericStatement+ "cnoremap <silent> <f21> <c-\\>eterminus#private#focus_gained()<cr>"+ , GenericStatement+ "if v:version > 703 || v:version == 703 && has('patch438')"+ , GenericStatement+ "inoremap <silent> <f20> <c-o>:silent doautocmd <nomodeline> FocusLost %<cr>"+ , GenericStatement+ "inoremap <silent> <f21> <c-o>:silent doautocmd <nomodeline> FocusGained %<cr>"+ , GenericStatement+ "nnoremap <silent> <f20> :silent doautocmd <nomodeline> FocusLost %<cr>"+ , GenericStatement+ "nnoremap <silent> <f21> :silent doautocmd <nomodeline> FocusGained %<cr>"+ , GenericStatement+ "onoremap <silent> <f20> <Esc>:silent doautocmd <nomodeline> FocusLost %<cr>"+ , GenericStatement+ "onoremap <silent> <f21> <Esc>:silent doautocmd <nomodeline> FocusGained %<cr>"+ , GenericStatement+ "vnoremap <silent> <f20> <Esc>:silent doautocmd <nomodeline> FocusLost %<cr>gv"+ , GenericStatement+ "vnoremap <silent> <f21> <Esc>:silent doautocmd <nomodeline> FocusGained %<cr>gv"+ , GenericStatement "else"+ , GenericStatement+ "inoremap <silent> <f20> <c-o>:silent doautocmd FocusLost %<cr>"+ , GenericStatement+ "inoremap <silent> <f21> <c-o>:silent doautocmd FocusGained %<cr>"+ , GenericStatement+ "nnoremap <silent> <f20> :silent doautocmd FocusLost %<cr>"+ , GenericStatement+ "nnoremap <silent> <f21> :silent doautocmd FocusGained %<cr>"+ , GenericStatement+ "onoremap <silent> <f20> <Esc>:silent doautocmd FocusLost %<cr>"+ , GenericStatement+ "onoremap <silent> <f21> <Esc>:silent doautocmd FocusGained %<cr>"+ , GenericStatement+ "vnoremap <silent> <f20> <Esc>:silent doautocmd FocusLost %<cr>gv"+ , GenericStatement+ "vnoremap <silent> <f21> <Esc>:silent doautocmd FocusGained %<cr>gv"+ , GenericStatement "endif"+ , GenericStatement "endif"+ , LetStatement+ { letLexpr = "s:paste"+ , letValue = "get(g:, 'TerminusBracketedPaste', 1)"+ }+ , GenericStatement "if s:paste"+ , GenericStatement "if s:screenish || s:xterm"+ , LetStatement+ { letLexpr = "&t_ti." , letValue = "\"\\e[?2004h\"" }+ , LetStatement+ { letLexpr = "&t_te" , letValue = "\"\\e[?2004l\" . &t_te" }+ , GenericStatement "set pastetoggle=<Esc>[201~"+ , GenericStatement+ "inoremap <expr> <Esc>[200~ terminus#private#paste('')"+ , GenericStatement+ "nnoremap <expr> <Esc>[200~ terminus#private#paste('i')"+ , GenericStatement+ "vnoremap <expr> <Esc>[200~ terminus#private#paste('c')"+ , GenericStatement "cnoremap <Esc>[200~ <nop>"+ , GenericStatement "cnoremap <Esc>[201~ <nop>"+ , GenericStatement "endif"+ , GenericStatement "endif"+ , LetStatement+ { letLexpr = "&cpoptions" , letValue = "s:cpoptions" }+ , UnletStatement { unletBang = False , unletBody = "s:cpoptions" }+ ]+ ]+ ]
+ tests/fixtures/integration/terminus/golden/markdown.golden view
+ tests/fixtures/integration/terminus/golden/plaintext.golden view
+ tests/fixtures/integration/terminus/input/autoload/terminus/private.vim view
@@ -0,0 +1,45 @@+" Copyright 2015-present Greg Hurrell. All rights reserved.+" Licensed under the terms of the BSD 2-clause license.++function! s:escape(string) abort+ " Double each <Esc>.+ return substitute(a:string, "\<Esc>", "\<Esc>\<Esc>", 'g')+endfunction++function! terminus#private#wrap(string) abort+ if strlen(a:string) == 0+ return ''+ end++ let l:tmux_begin="\<Esc>Ptmux;"+ let l:tmux_end="\<Esc>\\"++ return l:tmux_begin . s:escape(a:string) . l:tmux_end+endfunction++function! terminus#private#focus_lost() abort+ let l:cmdline=getcmdline()+ let l:cmdpos=getcmdpos()++ silent doautocmd FocusLost %++ call setcmdpos(l:cmdpos)+ return l:cmdline+endfunction++function! terminus#private#focus_gained() abort+ let l:cmdline=getcmdline()+ let l:cmdpos=getcmdpos()++ " Our checktime autocmd will produce:+ " E523: Not allowed here: checktime+ silent! doautocmd FocusGained %++ call setcmdpos(l:cmdpos)+ return l:cmdline+endfunction++function! terminus#private#paste(ret) abort+ set paste+ return a:ret+endfunction
+ tests/fixtures/integration/terminus/input/plugin/terminus.vim view
@@ -0,0 +1,144 @@+" Copyright 2015-present Greg Hurrell. All rights reserved.+" Licensed under the terms of the BSD 2-clause license.++" Provide users with means to prevent loading, as recommended in `:h+" write-plugin`.+if exists('g:TerminusLoaded') || &compatible || v:version < 700+ finish+endif+let g:TerminusLoaded=1++" Temporarily set 'cpoptions' to Vim default as per `:h use-cpo-save`.+let s:cpoptions=&cpoptions+set cpoptions&vim++set autoread " if not changed in Vim, automatically pick up changes after "git checkout" etc+if &ttimeoutlen == -1 && &timeoutlen > 50 || &ttimeoutlen > 50+ set ttimeoutlen=50 " speed up O etc in the Terminal+endif++let s:iterm=+ \ exists('$ITERM_PROFILE') ||+ \ exists('$ITERM_SESSION_ID') ||+ \ exists('$KONSOLE_DBUS_SESSION') ||+ \ exists('$KONSOLE_PROFILE_NAME') ||+ \ exists('g:TerminusAssumeITerm') ||+ \ filereadable(expand('~/.vim/.assume-iterm'))+let s:screenish=&term =~# 'screen\|tmux'+let s:tmux=exists('$TMUX')+let s:xterm=&term =~# 'xterm'++" Change shape of cursor in insert mode in iTerm 2.+let s:shape=get(g:, 'TerminusCursorShape', 1)+if s:shape+ let s:insert_shape=+get(g:, 'TerminusInsertCursorShape', 1)+ let s:replace_shape=+get(g:, 'TerminusReplaceCursorShape', 2)+ let s:normal_shape=+get(g:, 'TerminusNormalCursorShape', 0)+ if s:iterm+ let s:start_insert="\<Esc>]50;CursorShape=" . s:insert_shape . "\x7"+ let s:start_replace="\<Esc>]50;CursorShape=" . s:replace_shape . "\x7"+ let s:end_insert="\<Esc>]50;CursorShape=" . s:normal_shape . "\x7"+ else+ let s:cursor_shape_to_vte_shape={1: 6, 2: 4, 0: 2}+ let s:insert_shape=s:cursor_shape_to_vte_shape[s:insert_shape]+ let s:replace_shape=s:cursor_shape_to_vte_shape[s:replace_shape]+ let s:normal_shape=s:cursor_shape_to_vte_shape[s:normal_shape]+ let s:start_insert="\<Esc>[" . s:insert_shape . ' q'+ let s:start_replace="\<Esc>[" . s:replace_shape . ' q'+ let s:end_insert="\<Esc>[" . s:normal_shape . ' q'+ endif++ if s:tmux+ let s:start_insert=terminus#private#wrap(s:start_insert)+ let s:start_replace=terminus#private#wrap(s:start_replace)+ let s:end_insert=terminus#private#wrap(s:end_insert)+ endif++ let &t_SI=s:start_insert+ if v:version > 704 || v:version == 704 && has('patch687')+ let &t_SR=s:start_replace+ end+ let &t_EI=s:end_insert+endif++let s:mouse=get(g:, 'TerminusMouse', 1)+if s:mouse+ if has('mouse')+ set mouse=a+ if s:screenish || s:xterm+ if !has('nvim')+ if has('mouse_sgr')+ set ttymouse=sgr+ else+ set ttymouse=xterm2+ endif+ endif+ endif+ endif+endif++let s:focus=get(g:, 'TerminusFocusReporting', 1)+if s:focus+ if has('autocmd')+ augroup Terminus+ autocmd!+ autocmd FocusGained * checktime+ augroup END+ endif++ " Enable focus reporting on entering Vim.+ let &t_ti.="\e[?1004h"+ " Disable focus reporting on leaving Vim.+ let &t_te="\e[?1004l" . &t_te++ execute "set <f20>=\<Esc>[O"+ execute "set <f21>=\<Esc>[I"+ cnoremap <silent> <f20> <c-\>eterminus#private#focus_lost()<cr>+ cnoremap <silent> <f21> <c-\>eterminus#private#focus_gained()<cr>++ if v:version > 703 || v:version == 703 && has('patch438')+ " <nomodeline> was added in 7.3.438 (see `:h version7.txt`).+ inoremap <silent> <f20> <c-o>:silent doautocmd <nomodeline> FocusLost %<cr>+ inoremap <silent> <f21> <c-o>:silent doautocmd <nomodeline> FocusGained %<cr>+ nnoremap <silent> <f20> :silent doautocmd <nomodeline> FocusLost %<cr>+ nnoremap <silent> <f21> :silent doautocmd <nomodeline> FocusGained %<cr>+ onoremap <silent> <f20> <Esc>:silent doautocmd <nomodeline> FocusLost %<cr>+ onoremap <silent> <f21> <Esc>:silent doautocmd <nomodeline> FocusGained %<cr>+ vnoremap <silent> <f20> <Esc>:silent doautocmd <nomodeline> FocusLost %<cr>gv+ vnoremap <silent> <f21> <Esc>:silent doautocmd <nomodeline> FocusGained %<cr>gv+ else+ inoremap <silent> <f20> <c-o>:silent doautocmd FocusLost %<cr>+ inoremap <silent> <f21> <c-o>:silent doautocmd FocusGained %<cr>+ nnoremap <silent> <f20> :silent doautocmd FocusLost %<cr>+ nnoremap <silent> <f21> :silent doautocmd FocusGained %<cr>+ onoremap <silent> <f20> <Esc>:silent doautocmd FocusLost %<cr>+ onoremap <silent> <f21> <Esc>:silent doautocmd FocusGained %<cr>+ vnoremap <silent> <f20> <Esc>:silent doautocmd FocusLost %<cr>gv+ vnoremap <silent> <f21> <Esc>:silent doautocmd FocusGained %<cr>gv+ endif+endif++let s:paste=get(g:, 'TerminusBracketedPaste', 1)+if s:paste+ " Make use of Xterm "bracketed paste mode". See:+ " - http://www.xfree86.org/current/ctlseqs.html#Bracketed%20Paste%20Mode+ " - http://stackoverflow.com/questions/5585129+ if s:screenish || s:xterm+ " Enable bracketed paste mode on entering Vim.+ let &t_ti.="\e[?2004h"++ " Disable bracketed paste mode on leaving Vim.+ let &t_te="\e[?2004l" . &t_te++ set pastetoggle=<Esc>[201~+ inoremap <expr> <Esc>[200~ terminus#private#paste('')+ nnoremap <expr> <Esc>[200~ terminus#private#paste('i')+ vnoremap <expr> <Esc>[200~ terminus#private#paste('c')+ cnoremap <Esc>[200~ <nop>+ cnoremap <Esc>[201~ <nop>+ endif+endif++" Restore 'cpoptions' to its former value.+let &cpoptions=s:cpoptions+unlet s:cpoptions
+ tests/fixtures/integration/vim-clipper/golden/ast.golden view
@@ -0,0 +1,57 @@+Project+ [ Project+ [ Unit+ [ FunctionDeclaration+ { functionBang = True+ , functionName = "clipper#private#clip"+ , functionArguments = ArgumentList []+ , functionAttributes = [ "abort" ]+ , functionBody =+ [ GenericStatement "if executable('nc') == 1"+ , LetStatement+ { letLexpr = "l:address "+ , letValue = "get(g:, 'ClipperAddress', 'localhost')"+ }+ , LetStatement+ { letLexpr = "l:port "+ , letValue =+ "+(get(g:, 'ClipperPort', 8377)) \" Co-erce to number."+ }+ , GenericStatement "if l:port"+ , GenericStatement+ "call system('nc ' . l:address . ' ' . l:port, @0)"+ , GenericStatement "else"+ , GenericStatement "call system('nc -U ' . l:address, @0)"+ , GenericStatement "endif"+ , GenericStatement "else"+ , GenericStatement+ "echoerr 'Clipper: nc executable does not exist'"+ , GenericStatement "endif"+ ]+ }+ ]+ , Unit+ [ GenericStatement+ "if exists('g:ClipperLoaded') || &compatible || v:version < 700"+ , GenericStatement "finish"+ , GenericStatement "endif"+ , LetStatement { letLexpr = "g:ClipperLoaded" , letValue = "1" }+ , LetStatement+ { letLexpr = "s:cpoptions" , letValue = "&cpoptions" }+ , GenericStatement "set cpoptions&vim"+ , GenericStatement "command! Clip call clipper#private#clip()"+ , LetStatement+ { letLexpr = "s:map" , letValue = "get(g:, 'ClipperMap', 1)" }+ , GenericStatement "if s:map"+ , GenericStatement+ "if !hasmapto('<Plug>(ClipperClip)') && maparg('<leader>y', 'n') ==# ''"+ , GenericStatement "nmap <unique> <leader>y <Plug>(ClipperClip)"+ , GenericStatement "endif"+ , GenericStatement "endif"+ , GenericStatement "nnoremap <Plug>(ClipperClip) :Clip<CR>"+ , LetStatement+ { letLexpr = "&cpoptions" , letValue = "s:cpoptions" }+ , UnletStatement { unletBang = False , unletBody = "s:cpoptions" }+ ]+ ]+ ]
+ tests/fixtures/integration/vim-clipper/golden/markdown.golden view
+ tests/fixtures/integration/vim-clipper/golden/plaintext.golden view
+ tests/fixtures/integration/vim-clipper/input/autoload/clipper/private.vim view
@@ -0,0 +1,16 @@+" Copyright 2015-present Greg Hurrell. All rights reserved.+" Licensed under the terms of the BSD 2-clause license.++function! clipper#private#clip() abort+ if executable('nc') == 1+ let l:address = get(g:, 'ClipperAddress', 'localhost')+ let l:port = +(get(g:, 'ClipperPort', 8377)) " Co-erce to number.+ if l:port+ call system('nc ' . l:address . ' ' . l:port, @0)+ else+ call system('nc -U ' . l:address, @0)+ endif+ else+ echoerr 'Clipper: nc executable does not exist'+ endif+endfunction
+ tests/fixtures/integration/vim-clipper/input/plugin/clipper.vim view
@@ -0,0 +1,27 @@+" Copyright 2015-present Greg Hurrell. All rights reserved.+" Licensed under the terms of the BSD 2-clause license.++" Provide users with means to prevent loading, as recommended in `:h+" write-plugin`.+if exists('g:ClipperLoaded') || &compatible || v:version < 700+ finish+endif+let g:ClipperLoaded=1++" Temporarily set 'cpoptions' to Vim default as per `:h use-cpo-save`.+let s:cpoptions=&cpoptions+set cpoptions&vim++command! Clip call clipper#private#clip()++let s:map=get(g:, 'ClipperMap', 1)+if s:map+ if !hasmapto('<Plug>(ClipperClip)') && maparg('<leader>y', 'n') ==# ''+ nmap <unique> <leader>y <Plug>(ClipperClip)+ endif+endif+nnoremap <Plug>(ClipperClip) :Clip<CR>++" Restore 'cpoptions' to its former value.+let &cpoptions=s:cpoptions+unlet s:cpoptions
+ tests/fixtures/integration/vim-docvim/golden/ast.golden view
@@ -0,0 +1,1081 @@+Project+ [ DocBlock+ [ PluginAnnotation+ "docvim" "Syntax highlighting for docvim comments"+ , TOC+ [ "Intro"+ , "Installation"+ , "Related"+ , "Website"+ , "License"+ , "Development"+ , "Authors"+ , "History"+ ]+ ]+ , LinkTargets [ "vim-docvim" ]+ , HeadingAnnotation "Intro"+ , Paragraph+ [ Plaintext "vim-docvim"+ , Whitespace+ , Plaintext "provides"+ , Whitespace+ , Plaintext "additional"+ , Whitespace+ , Plaintext "syntax"+ , Whitespace+ , Plaintext "highlighting"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "Vim"+ , Whitespace+ , Plaintext "script"+ , Whitespace+ , Plaintext "files"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "contain"+ , Whitespace+ , Plaintext "embedded"+ , Whitespace+ , Plaintext "docvim"+ , Whitespace+ , Plaintext "comments."+ ]+ , Paragraph+ [ Plaintext "docvim"+ , Whitespace+ , Plaintext "(the"+ , Whitespace+ , Plaintext "tool,"+ , Whitespace+ , Plaintext "not"+ , Whitespace+ , Plaintext "this"+ , Whitespace+ , Plaintext "plug-in)"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "documentation"+ , Whitespace+ , Plaintext "generator"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "processes"+ , Whitespace+ , Plaintext "those"+ , Whitespace+ , Plaintext "embedded"+ , Whitespace+ , Plaintext "comments"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "produces"+ , Whitespace+ , Plaintext "documentation"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "Markdown"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "Vim"+ , Whitespace+ , Plaintext "\"help\""+ , Whitespace+ , Plaintext "formats."+ , Whitespace+ , Plaintext "To"+ , Whitespace+ , Plaintext "avoid"+ , Whitespace+ , Plaintext "confusion,"+ , Whitespace+ , Plaintext "this"+ , Whitespace+ , Plaintext "document"+ , Whitespace+ , Plaintext "refers"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "Vim"+ , Whitespace+ , Plaintext "plug-in"+ , Whitespace+ , Plaintext "as"+ , Whitespace+ , Plaintext "\"vim-docvim\""+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "separate"+ , Whitespace+ , Plaintext "generation"+ , Whitespace+ , Plaintext "tool"+ , Whitespace+ , Plaintext "as"+ , Whitespace+ , Plaintext "\"docvim\"."+ ]+ , HeadingAnnotation "Installation"+ , Paragraph+ [ Plaintext "To"+ , Whitespace+ , Plaintext "install"+ , Whitespace+ , Plaintext "vim-docvim,"+ , Whitespace+ , Plaintext "use"+ , Whitespace+ , Plaintext "your"+ , Whitespace+ , Plaintext "plug-in"+ , Whitespace+ , Plaintext "management"+ , Whitespace+ , Plaintext "system"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "choice."+ ]+ , Paragraph+ [ Plaintext "If"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "don't"+ , Whitespace+ , Plaintext "have"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "\"plug-in"+ , Whitespace+ , Plaintext "management"+ , Whitespace+ , Plaintext "system"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "choice\","+ , Whitespace+ , Plaintext "I"+ , Whitespace+ , Plaintext "recommend"+ , Whitespace+ , Plaintext "Pathogen"+ , Whitespace+ , Plaintext "(https://github.com/tpope/vim-pathogen)"+ , Whitespace+ , Plaintext "due"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "its"+ , Whitespace+ , Plaintext "simplicity"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "robustness."+ , Whitespace+ , Plaintext "Assuming"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "have"+ , Whitespace+ , Plaintext "Pathogen"+ , Whitespace+ , Plaintext "installed"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "configured,"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "want"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "install"+ , Whitespace+ , Plaintext "vim-docvim"+ , Whitespace+ , Plaintext "into"+ , Whitespace+ , Code "~/.vim/bundle"+ , Plaintext ","+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "do"+ , Whitespace+ , Plaintext "so"+ , Whitespace+ , Plaintext "with:"+ ]+ , Fenced+ [ "git clone https://github.com/wincent/vim-docvim.git ~/.vim/bundle/vim-docvim"+ ]+ , Paragraph+ [ Plaintext "Alternatively,"+ , Whitespace+ , Plaintext "if"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "use"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "Git"+ , Whitespace+ , Plaintext "submodule"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "each"+ , Whitespace+ , Plaintext "Vim"+ , Whitespace+ , Plaintext "plug-in,"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "could"+ , Whitespace+ , Plaintext "do"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "following"+ , Whitespace+ , Plaintext "after"+ , Whitespace+ , Code "cd"+ , Plaintext "-ing"+ , Whitespace+ , Plaintext "into"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "top-level"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "your"+ , Whitespace+ , Plaintext "Git"+ , Whitespace+ , Plaintext "superproject:"+ ]+ , Fenced+ [ "git submodule add https://github.com/wincent/vim-docvim.git ~/vim/bundle/vim-docvim"+ , "git submodule init"+ ]+ , Paragraph+ [ Plaintext "To"+ , Whitespace+ , Plaintext "generate"+ , Whitespace+ , Plaintext "help"+ , Whitespace+ , Plaintext "tags"+ , Whitespace+ , Plaintext "under"+ , Whitespace+ , Plaintext "Pathogen,"+ , Whitespace+ , Plaintext "you"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "do"+ , Whitespace+ , Plaintext "so"+ , Whitespace+ , Plaintext "from"+ , Whitespace+ , Plaintext "inside"+ , Whitespace+ , Plaintext "Vim"+ , Whitespace+ , Plaintext "with:"+ ]+ , Fenced [ ":call pathogen#helptags()" ]+ , HeadingAnnotation "Related"+ , SubheadingAnnotation "Docvim"+ , Paragraph+ [ Plaintext "The"+ , Whitespace+ , Plaintext "Docvim"+ , Whitespace+ , Plaintext "tool"+ , Whitespace+ , Plaintext "itself"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "Haskell"+ , Whitespace+ , Plaintext "module,"+ , Whitespace+ , Plaintext "available"+ , Whitespace+ , Plaintext "at:"+ ]+ , Paragraph+ [ Plaintext "http://hackage.haskell.org/package/docvim" ]+ , Paragraph+ [ Plaintext "The"+ , Whitespace+ , Plaintext "official"+ , Whitespace+ , Plaintext "source"+ , Whitespace+ , Plaintext "code"+ , Whitespace+ , Plaintext "repo"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "at:"+ ]+ , Paragraph [ Plaintext "http://git.wincent.com/docvim.git" ]+ , Paragraph+ [ Plaintext "Mirrors"+ , Whitespace+ , Plaintext "exist"+ , Whitespace+ , Plaintext "at:"+ ]+ , List+ [ ListItem [ Plaintext "https://github.com/wincent/docvim" ]+ , ListItem [ Plaintext "https://gitlab.com/wincent/docvim" ]+ , ListItem [ Plaintext "https://bitbucket.org/ghurrell/docvim" ]+ ]+ , HeadingAnnotation "Website"+ , Paragraph+ [ Plaintext "The"+ , Whitespace+ , Plaintext "official"+ , Whitespace+ , Plaintext "vim-docvim"+ , Whitespace+ , Plaintext "source"+ , Whitespace+ , Plaintext "code"+ , Whitespace+ , Plaintext "repo"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "at:"+ ]+ , Paragraph [ Plaintext "http://git.wincent.com/vim-docvim.git" ]+ , Paragraph+ [ Plaintext "Mirrors"+ , Whitespace+ , Plaintext "exist"+ , Whitespace+ , Plaintext "at:"+ ]+ , List+ [ ListItem [ Plaintext "https://github.com/wincent/vim-docvim" ]+ , ListItem [ Plaintext "https://gitlab.com/wincent/vim-docvim" ]+ , ListItem+ [ Plaintext "https://bitbucket.org/ghurrell/vim-docvim" ]+ ]+ , Paragraph+ [ Plaintext "Official"+ , Whitespace+ , Plaintext "releases"+ , Whitespace+ , Plaintext "are"+ , Whitespace+ , Plaintext "listed"+ , Whitespace+ , Plaintext "at:"+ ]+ , Paragraph+ [ Plaintext+ "http://www.vim.org/scripts/script.php?script_id=[TODO]"+ ]+ , HeadingAnnotation "License"+ , Paragraph+ [ Plaintext "Copyright"+ , Whitespace+ , Plaintext "(c)"+ , Whitespace+ , Plaintext "2015-present"+ , Whitespace+ , Plaintext "Greg"+ , Whitespace+ , Plaintext "Hurrell"+ ]+ , Paragraph+ [ Plaintext "Permission"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "hereby"+ , Whitespace+ , Plaintext "granted,"+ , Whitespace+ , Plaintext "free"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "charge,"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "any"+ , Whitespace+ , Plaintext "person"+ , Whitespace+ , Plaintext "obtaining"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "copy"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "this"+ , Whitespace+ , Plaintext "software"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "associated"+ , Whitespace+ , Plaintext "documentation"+ , Whitespace+ , Plaintext "files"+ , Whitespace+ , Plaintext "(the"+ , Whitespace+ , Plaintext "\"Software\"),"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "deal"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "Software"+ , Whitespace+ , Plaintext "without"+ , Whitespace+ , Plaintext "restriction,"+ , Whitespace+ , Plaintext "including"+ , Whitespace+ , Plaintext "without"+ , Whitespace+ , Plaintext "limitation"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "rights"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "use,"+ , Whitespace+ , Plaintext "copy,"+ , Whitespace+ , Plaintext "modify,"+ , Whitespace+ , Plaintext "merge,"+ , Whitespace+ , Plaintext "publish,"+ , Whitespace+ , Plaintext "distribute,"+ , Whitespace+ , Plaintext "sublicense,"+ , Whitespace+ , Plaintext "and/or"+ , Whitespace+ , Plaintext "sell"+ , Whitespace+ , Plaintext "copies"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "Software,"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "permit"+ , Whitespace+ , Plaintext "persons"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "whom"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "Software"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "furnished"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "do"+ , Whitespace+ , Plaintext "so,"+ , Whitespace+ , Plaintext "subject"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "following"+ , Whitespace+ , Plaintext "conditions:"+ ]+ , Paragraph+ [ Plaintext "The"+ , Whitespace+ , Plaintext "above"+ , Whitespace+ , Plaintext "copyright"+ , Whitespace+ , Plaintext "notice"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "this"+ , Whitespace+ , Plaintext "permission"+ , Whitespace+ , Plaintext "notice"+ , Whitespace+ , Plaintext "shall"+ , Whitespace+ , Plaintext "be"+ , Whitespace+ , Plaintext "included"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "all"+ , Whitespace+ , Plaintext "copies"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Plaintext "substantial"+ , Whitespace+ , Plaintext "portions"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "Software."+ ]+ , Paragraph+ [ Plaintext "THE"+ , Whitespace+ , Plaintext "SOFTWARE"+ , Whitespace+ , Plaintext "IS"+ , Whitespace+ , Plaintext "PROVIDED"+ , Whitespace+ , Plaintext "\"AS"+ , Whitespace+ , Plaintext "IS\","+ , Whitespace+ , Plaintext "WITHOUT"+ , Whitespace+ , Plaintext "WARRANTY"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "ANY"+ , Whitespace+ , Plaintext "KIND,"+ , Whitespace+ , Plaintext "EXPRESS"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "IMPLIED,"+ , Whitespace+ , Plaintext "INCLUDING"+ , Whitespace+ , Plaintext "BUT"+ , Whitespace+ , Plaintext "NOT"+ , Whitespace+ , Plaintext "LIMITED"+ , Whitespace+ , Plaintext "TO"+ , Whitespace+ , Plaintext "THE"+ , Whitespace+ , Plaintext "WARRANTIES"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "MERCHANTABILITY,"+ , Whitespace+ , Plaintext "FITNESS"+ , Whitespace+ , Plaintext "FOR"+ , Whitespace+ , Plaintext "A"+ , Whitespace+ , Plaintext "PARTICULAR"+ , Whitespace+ , Plaintext "PURPOSE"+ , Whitespace+ , Plaintext "AND"+ , Whitespace+ , Plaintext "NONINFRINGEMENT."+ , Whitespace+ , Plaintext "IN"+ , Whitespace+ , Plaintext "NO"+ , Whitespace+ , Plaintext "EVENT"+ , Whitespace+ , Plaintext "SHALL"+ , Whitespace+ , Plaintext "THE"+ , Whitespace+ , Plaintext "AUTHORS"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "COPYRIGHT"+ , Whitespace+ , Plaintext "HOLDERS"+ , Whitespace+ , Plaintext "BE"+ , Whitespace+ , Plaintext "LIABLE"+ , Whitespace+ , Plaintext "FOR"+ , Whitespace+ , Plaintext "ANY"+ , Whitespace+ , Plaintext "CLAIM,"+ , Whitespace+ , Plaintext "DAMAGES"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "OTHER"+ , Whitespace+ , Plaintext "LIABILITY,"+ , Whitespace+ , Plaintext "WHETHER"+ , Whitespace+ , Plaintext "IN"+ , Whitespace+ , Plaintext "AN"+ , Whitespace+ , Plaintext "ACTION"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "CONTRACT,"+ , Whitespace+ , Plaintext "TORT"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "OTHERWISE,"+ , Whitespace+ , Plaintext "ARISING"+ , Whitespace+ , Plaintext "FROM,"+ , Whitespace+ , Plaintext "OUT"+ , Whitespace+ , Plaintext "OF"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "IN"+ , Whitespace+ , Plaintext "CONNECTION"+ , Whitespace+ , Plaintext "WITH"+ , Whitespace+ , Plaintext "THE"+ , Whitespace+ , Plaintext "SOFTWARE"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "THE"+ , Whitespace+ , Plaintext "USE"+ , Whitespace+ , Plaintext "OR"+ , Whitespace+ , Plaintext "OTHER"+ , Whitespace+ , Plaintext "DEALINGS"+ , Whitespace+ , Plaintext "IN"+ , Whitespace+ , Plaintext "THE"+ , Whitespace+ , Plaintext "SOFTWARE."+ ]+ , HeadingAnnotation "Development"+ , SubheadingAnnotation "Contributing patches"+ , Paragraph+ [ Plaintext "Patches"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "be"+ , Whitespace+ , Plaintext "sent"+ , Whitespace+ , Plaintext "via"+ , Whitespace+ , Plaintext "mail"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "greg@hurrell.net,"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Plaintext "as"+ , Whitespace+ , Plaintext "GitHub"+ , Whitespace+ , Plaintext "pull"+ , Whitespace+ , Plaintext "requests"+ , Whitespace+ , Plaintext "at:"+ , Whitespace+ , Plaintext "https://github.com/wincent/vim-docvim/pulls"+ ]+ , SubheadingAnnotation "Cutting a new release"+ , Paragraph+ [ Plaintext "At"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "moment"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "release"+ , Whitespace+ , Plaintext "process"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "manual:"+ ]+ , List+ [ ListItem+ [ Plaintext "Perform"+ , Whitespace+ , Plaintext "final"+ , Whitespace+ , Plaintext "sanity"+ , Whitespace+ , Plaintext "checks"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "manual"+ , Whitespace+ , Plaintext "testing"+ ]+ , ListItem+ [ Plaintext "Update"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Link "docvim-history"+ , Whitespace+ , Plaintext "section"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "documentation"+ ]+ , ListItem+ [ Plaintext "Verify"+ , Whitespace+ , Plaintext "clean"+ , Whitespace+ , Plaintext "work"+ , Whitespace+ , Plaintext "tree:"+ ]+ ]+ , Fenced [ "git status" ]+ , List+ [ ListItem+ [ Plaintext "Tag"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "release:"+ ]+ ]+ , Fenced [ "git tag -s -m \"$VERSION release\" $VERSION" ]+ , List+ [ ListItem+ [ Plaintext "Publish"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "code:"+ ]+ ]+ , Fenced+ [ "git push origin master --follow-tags"+ , "git push github master --follow-tags"+ ]+ , List+ [ ListItem+ [ Plaintext "Produce"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "release"+ , Whitespace+ , Plaintext "archive:"+ ]+ ]+ , Fenced [ "git archive -o vim-docvim-$VERSION.zip HEAD -- ." ]+ , List+ [ ListItem+ [ Plaintext "Upload"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext+ "http://www.vim.org/scripts/script.php?script_id=[TODO]"+ ]+ ]+ , HeadingAnnotation "Authors"+ , Paragraph+ [ Plaintext "vim-docvim"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "written"+ , Whitespace+ , Plaintext "and"+ , Whitespace+ , Plaintext "maintained"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "Greg"+ , Whitespace+ , Plaintext "Hurrell"+ , Whitespace+ , Plaintext "<greg@hurrell.net>."+ ]+ , HeadingAnnotation "History"+ , SubheadingAnnotation "0.1 (not yet released)"+ , List+ [ ListItem+ [ Plaintext "Initial" , Whitespace , Plaintext "release." ]+ ]+ , Project+ [ Unit+ [ GenericStatement+ "syntax region docvimBlock start='\\v^\\s*\"\"' end='\\v^\\zs\\ze\\s*($|[^ \\t\"])' containedin=vimFuncBody"+ , GenericStatement+ "syntax region docvimPre start='\\v^\\s*\"\\s+\\zs```\\s*$' end='\\v^\\s*\"\\s+```\\s*$' containedin=docvimBlock contained keepend"+ , GenericStatement+ "syntax match docvimAnnotation '\\v\\@command( .+)?' containedin=docvimBlock contained"+ , GenericStatement+ "syntax match docvimAnnotation '@commands' containedin=docvimBlock contained"+ , GenericStatement+ "syntax match docvimAnnotation '@dedent' containedin=docvimBlock contained"+ , GenericStatement+ "syntax match docvimAnnotation '@footer' containedin=docvimBlock contained"+ , GenericStatement+ "syntax match docvimAnnotation '\\v\\@function( .+)?' containedin=docvimBlock contained"+ , GenericStatement+ "syntax match docvimAnnotation '@functions' containedin=docvimBlock contained"+ , GenericStatement+ "syntax match docvimAnnotation '@indent' containedin=docvimBlock contained"+ , GenericStatement+ "syntax match docvimAnnotation '\\v\\@mapping( .+)?' containedin=docvimBlock contained"+ , GenericStatement+ "syntax match docvimAnnotation '@mappings' containedin=docvimBlock contained"+ , GenericStatement+ "syntax match docvimAnnotation '\\v\\@option( .+)?' containedin=docvimBlock contained"+ , GenericStatement+ "syntax match docvimAnnotation '@options' containedin=docvimBlock contained"+ , GenericStatement+ "syntax match docvimAnnotation '@param' containedin=docvimBlock contained"+ , GenericStatement+ "syntax match docvimAnnotation '\\v\\@plugin( .+)?' containedin=docvimBlock contained"+ , GenericStatement+ "syntax match docvimAnnotation '@private' containedin=docvimBlock contained"+ , GenericStatement+ "syntax match docvimBackticks '\\v`[^\\s`]+`' containedin=docvimBlock contained"+ , GenericStatement+ "syntax match docvimBlockquote '\\v^\\s*\"\\s+\\zs\\>\\s+.+$' containedin=docvimBlock contained"+ , GenericStatement+ "syntax match docvimCrossReference '\\v\\c\\|:?[a-z0-9()<>\\.:-]+\\|' containedin=docvimBlock contained"+ , GenericStatement+ "syntax match docvimHeading '\\v^\\s*\"\\s+\\zs#\\s+.+$' containedin=docvimBlock contained"+ , GenericStatement+ "syntax match docvimPreComment '\\v^\\s*\"' containedin=docvimPre contained"+ , GenericStatement+ "syntax match docvimSetting \"\\v'[a-z]{2,}'\" containedin=docvimBlock contained"+ , GenericStatement+ "syntax match docvimSetting \"\\v't_..'\" containedin=docvimBlock contained"+ , GenericStatement+ "syntax match docvimSpecial '\\v\\<CSM-.\\>' containedin=docvimBlock contained"+ , GenericStatement+ "syntax match docvimSpecial '\\v\\<[-a-zA-Z0-9_]+\\>' containedin=docvimBlock contained"+ , GenericStatement+ "syntax match docvimSubheading '\\v^\\s*\"\\s+\\zs##\\s+.+$' containedin=docvimBlock contained"+ , GenericStatement+ "syntax match docvimTarget '\\v\\c\\*:?[a-z0-9()<>-]+\\*' containedin=docvimBlock contained"+ , GenericStatement+ "syntax match docvimURL `\\v<(((https?|ftp|gopher)://|(mailto|file|news):)[^' <>\"]+|(www|web|w3)[a-z0-9_-]*\\.[a-z0-9._-]+\\.[^' <>\"]+)[a-zA-Z0-9/]` containedin=docvimBlock contained"+ , GenericStatement "if has('conceal')"+ , GenericStatement+ "syntax match docvimBacktick '\\v`' containedin=docvimBackticks contained conceal"+ , GenericStatement+ "syntax match docvimBar '\\v\\|' containedin=docvimCrossReference contained conceal"+ , GenericStatement+ "syntax match docvimHeadingPrefix '\\v# ' containedin=docvimHeading contained conceal"+ , GenericStatement+ "syntax match docvimStar '\\v\\*' containedin=docvimTarget contained conceal"+ , GenericStatement+ "syntax match docvimSubheadingPrefix '\\v## ' containedin=docvimSubheading contained conceal"+ , GenericStatement "else"+ , GenericStatement+ "syntax match docvimBacktick '\\v`' containedin=docvimBackticks contained"+ , GenericStatement+ "syntax match docvimBar '\\v\\|' containedin=docvimCrossReference contained"+ , GenericStatement+ "syntax match docvimHeadingPrefix '\\v# ' containedin=docvimHeading contained"+ , GenericStatement+ "syntax match docvimStar '\\v\\*' containedin=docvimTarget contained"+ , GenericStatement+ "syntax match docvimSubheadingPrefix '\\v## ' containedin=docvimSubheading contained"+ , GenericStatement "endif"+ , FunctionDeclaration+ { functionBang = True+ , functionName = "s:italicize"+ , functionArguments =+ ArgumentList [ Argument "name" , Argument "link" ]+ , functionAttributes = []+ , functionBody =+ [ GenericStatement "try"+ , GenericStatement+ "execute 'highlight! ' . a:name . ' ' . pinnacle#italicize(a:link)"+ , GenericStatement "catch"+ , GenericStatement+ "execute 'highlight! link ' . a:name . ' ' . a:link"+ , GenericStatement "endtry"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "s:highlight"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody =+ [ GenericStatement "call s:italicize('docvimAnnotation', 'String')"+ , GenericStatement "call s:italicize('docvimBacktick', 'Comment')"+ , GenericStatement "call s:italicize('docvimBackticks', 'Comment')"+ , GenericStatement "call s:italicize('docvimBar', 'Identifier')"+ , GenericStatement "call s:italicize('docvimBlock', 'Normal')"+ , GenericStatement+ "call s:italicize('docvimBlockquote', 'Comment')"+ , GenericStatement "call s:italicize('docvimComment', 'Normal')"+ , GenericStatement+ "call s:italicize('docvimCrossReference', 'Identifier')"+ , GenericStatement+ "call s:italicize('docvimHeading', 'Identifier')"+ , GenericStatement+ "call s:italicize('docvimHeadingPrefix', 'Identifier')"+ , GenericStatement "call s:italicize('docvimPre', 'Comment')"+ , GenericStatement "call s:italicize('docvimSetting', 'Type')"+ , GenericStatement "call s:italicize('docvimSpecial', 'Special')"+ , GenericStatement "call s:italicize('docvimStar', 'String')"+ , GenericStatement+ "call s:italicize('docvimSubheading', 'PreProc')"+ , GenericStatement+ "call s:italicize('docvimSubheadingPrefix', 'PreProc')"+ , GenericStatement "call s:italicize('docvimTarget', 'String')"+ , GenericStatement "call s:italicize('docvimURL', 'String')"+ ]+ }+ , GenericStatement "if has('autocmd')"+ , GenericStatement "augroup Docvim"+ , GenericStatement "autocmd!"+ , GenericStatement "autocmd ColorScheme * call s:highlight()"+ , GenericStatement "augroup END"+ , GenericStatement "endif"+ , GenericStatement "call s:highlight()"+ ]+ , Unit+ [ GenericStatement "set conceallevel=2"+ , GenericStatement "set concealcursor=nc"+ , LetStatement+ { letLexpr = "s:path"+ , letValue = "resolve(expand('<sfile>:p:h:h')) . '/after'"+ }+ , GenericStatement "execute 'set rtp+=' . s:path"+ ]+ ]+ ]
+ tests/fixtures/integration/vim-docvim/golden/markdown.golden view
@@ -0,0 +1,124 @@+# docvim<a name="docvim-docvim" href="#user-content-docvim-docvim"></a>++<p align="right"><a name="vim-docvim" href="#user-content-vim-docvim"><code>vim-docvim</code></a></p>+## Intro<a name="docvim-intro" href="#user-content-docvim-intro"></a>++vim-docvim provides additional syntax highlighting for Vim script files that contain embedded docvim comments.++docvim (the tool, not this plug-in) is a documentation generator that processes those embedded comments and produces documentation in Markdown and Vim "help" formats. To avoid confusion, this document refers to the Vim plug-in as "vim-docvim" and the separate generation tool as "docvim".++## Installation<a name="docvim-installation" href="#user-content-docvim-installation"></a>++To install vim-docvim, use your plug-in management system of choice.++If you don't have a "plug-in management system of choice", I recommend Pathogen (https://github.com/tpope/vim-pathogen) due to its simplicity and robustness. Assuming that you have Pathogen installed and configured, and that you want to install vim-docvim into `~/.vim/bundle`, you can do so with:++```+git clone https://github.com/wincent/vim-docvim.git ~/.vim/bundle/vim-docvim+```++Alternatively, if you use a Git submodule for each Vim plug-in, you could do the following after `cd`-ing into the top-level of your Git superproject:++```+git submodule add https://github.com/wincent/vim-docvim.git ~/vim/bundle/vim-docvim+git submodule init+```++To generate help tags under Pathogen, you can do so from inside Vim with:++```+:call pathogen#helptags()+```++## Related<a name="docvim-related" href="#user-content-docvim-related"></a>++### Docvim<a name="docvim-docvim" href="#user-content-docvim-docvim"></a>++The Docvim tool itself is a Haskell module, available at:++http://hackage.haskell.org/package/docvim++The official source code repo is at:++http://git.wincent.com/docvim.git++Mirrors exist at:++- https://github.com/wincent/docvim+- https://gitlab.com/wincent/docvim+- https://bitbucket.org/ghurrell/docvim++## Website<a name="docvim-website" href="#user-content-docvim-website"></a>++The official vim-docvim source code repo is at:++http://git.wincent.com/vim-docvim.git++Mirrors exist at:++- https://github.com/wincent/vim-docvim+- https://gitlab.com/wincent/vim-docvim+- https://bitbucket.org/ghurrell/vim-docvim++Official releases are listed at:++http://www.vim.org/scripts/script.php?script_id=[TODO]++## License<a name="docvim-license" href="#user-content-docvim-license"></a>++Copyright (c) 2015-present Greg Hurrell++Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.++## Development<a name="docvim-development" href="#user-content-docvim-development"></a>++### Contributing patches<a name="docvim-contributing-patches" href="#user-content-docvim-contributing-patches"></a>++Patches can be sent via mail to greg@hurrell.net, or as GitHub pull requests at: https://github.com/wincent/vim-docvim/pulls++### Cutting a new release<a name="docvim-cutting-a-new-release" href="#user-content-docvim-cutting-a-new-release"></a>++At the moment the release process is manual:++- Perform final sanity checks and manual testing+- Update the <strong>[`docvim-history`](#user-content-docvim-history)</strong> section of the documentation+- Verify clean work tree:++```+git status+```++- Tag the release:++```+git tag -s -m "$VERSION release" $VERSION+```++- Publish the code:++```+git push origin master --follow-tags+git push github master --follow-tags+```++- Produce the release archive:++```+git archive -o vim-docvim-$VERSION.zip HEAD -- .+```++- Upload to http://www.vim.org/scripts/script.php?script_id=[TODO]++## Authors<a name="docvim-authors" href="#user-content-docvim-authors"></a>++vim-docvim is written and maintained by Greg Hurrell <greg@hurrell.net>.++## History<a name="docvim-history" href="#user-content-docvim-history"></a>++### 0.1 (not yet released)<a name="docvim-01-not-yet-released" href="#user-content-docvim-01-not-yet-released"></a>++- Initial release.
+ tests/fixtures/integration/vim-docvim/golden/plaintext.golden view
@@ -0,0 +1,143 @@+*docvim.txt* Syntax highlighting for docvim comments *docvim*++CONTENTS *docvim-contents*++1. Intro |docvim-intro|+2. Installation |docvim-installation|+3. Related |docvim-related|+4. Website |docvim-website|+5. License |docvim-license|+6. Development |docvim-development|+7. Authors |docvim-authors|+8. History |docvim-history|+++ *vim-docvim*+INTRO *docvim-intro*++vim-docvim provides additional syntax highlighting for Vim script files that+contain embedded docvim comments.++docvim (the tool, not this plug-in) is a documentation generator that+processes those embedded comments and produces documentation in Markdown and+Vim "help" formats. To avoid confusion, this document refers to the Vim+plug-in as "vim-docvim" and the separate generation tool as "docvim".++INSTALLATION *docvim-installation*++To install vim-docvim, use your plug-in management system of choice.++If you don't have a "plug-in management system of choice", I recommend+Pathogen (https://github.com/tpope/vim-pathogen) due to its simplicity and+robustness. Assuming that you have Pathogen installed and configured, and+that you want to install vim-docvim into `~/.vim/bundle`, you can do so with:+>+ git clone https://github.com/wincent/vim-docvim.git ~/.vim/bundle/vim-docvim+<+Alternatively, if you use a Git submodule for each Vim plug-in, you could do+the following after `cd`-ing into the top-level of your Git superproject:+>+ git submodule add https://github.com/wincent/vim-docvim.git ~/vim/bundle/vim-docvim+ git submodule init+<+To generate help tags under Pathogen, you can do so from inside Vim with:+>+ :call pathogen#helptags()+<+RELATED *docvim-related*++Docvim ~++The Docvim tool itself is a Haskell module, available at:++http://hackage.haskell.org/package/docvim++The official source code repo is at:++http://git.wincent.com/docvim.git++Mirrors exist at:++- https://github.com/wincent/docvim+- https://gitlab.com/wincent/docvim+- https://bitbucket.org/ghurrell/docvim++WEBSITE *docvim-website*++The official vim-docvim source code repo is at:++http://git.wincent.com/vim-docvim.git++Mirrors exist at:++- https://github.com/wincent/vim-docvim+- https://gitlab.com/wincent/vim-docvim+- https://bitbucket.org/ghurrell/vim-docvim++Official releases are listed at:++http://www.vim.org/scripts/script.php?script_id=[TODO]++LICENSE *docvim-license*++Copyright (c) 2015-present Greg Hurrell++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to+deal in the Software without restriction, including without limitation the+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or+sell copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in+all copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS+IN THE SOFTWARE.++DEVELOPMENT *docvim-development*++Contributing patches ~++Patches can be sent via mail to greg@hurrell.net, or as GitHub pull requests+at: https://github.com/wincent/vim-docvim/pulls++Cutting a new release ~++At the moment the release process is manual:++- Perform final sanity checks and manual testing+- Update the |docvim-history| section of the documentation+- Verify clean work tree:+>+ git status+<+- Tag the release:+>+ git tag -s -m "$VERSION release" $VERSION+<+- Publish the code:+>+ git push origin master --follow-tags+ git push github master --follow-tags+<+- Produce the release archive:+>+ git archive -o vim-docvim-$VERSION.zip HEAD -- .+<+- Upload to http://www.vim.org/scripts/script.php?script_id=[TODO]++AUTHORS *docvim-authors*++vim-docvim is written and maintained by Greg Hurrell <greg@hurrell.net>.++HISTORY *docvim-history*++0.1 (not yet released) ~++- Initial release.
+ tests/fixtures/integration/vim-docvim/input/after/syntax/vim.vim view
@@ -0,0 +1,237 @@+""+" @plugin docvim Syntax highlighting for docvim comments+"+" *vim-docvim*+" # Intro+"+" vim-docvim provides additional syntax highlighting for Vim script files that+" contain embedded docvim comments.+"+" docvim (the tool, not this plug-in) is a documentation generator that+" processes those embedded comments and produces documentation in Markdown and+" Vim "help" formats. To avoid confusion, this document refers to the Vim+" plug-in as "vim-docvim" and the separate generation tool as "docvim".+"+"+" # Installation+"+" To install vim-docvim, use your plug-in management system of choice.+"+" If you don't have a "plug-in management system of choice", I recommend+" Pathogen (https://github.com/tpope/vim-pathogen) due to its simplicity and+" robustness. Assuming that you have Pathogen installed and configured, and that+" you want to install vim-docvim into `~/.vim/bundle`, you can do so with:+"+" ```+" git clone https://github.com/wincent/vim-docvim.git ~/.vim/bundle/vim-docvim+" ```+"+" Alternatively, if you use a Git submodule for each Vim plug-in, you could do+" the following after `cd`-ing into the top-level of your Git superproject:+"+" ```+" git submodule add https://github.com/wincent/vim-docvim.git ~/vim/bundle/vim-docvim+" git submodule init+" ```+"+" To generate help tags under Pathogen, you can do so from inside Vim with:+"+" ```+" :call pathogen#helptags()+" ```+"+"+" # Related+"+" ## Docvim+"+" The Docvim tool itself is a Haskell module, available at:+"+" http://hackage.haskell.org/package/docvim+"+" The official source code repo is at:+"+" http://git.wincent.com/docvim.git+"+" Mirrors exist at:+"+" - https://github.com/wincent/docvim+" - https://gitlab.com/wincent/docvim+" - https://bitbucket.org/ghurrell/docvim+"+" # Website+"+" The official vim-docvim source code repo is at:+"+" http://git.wincent.com/vim-docvim.git+"+" Mirrors exist at:+"+" - https://github.com/wincent/vim-docvim+" - https://gitlab.com/wincent/vim-docvim+" - https://bitbucket.org/ghurrell/vim-docvim+"+" Official releases are listed at:+"+" http://www.vim.org/scripts/script.php?script_id=[TODO]+"+"+" # License+"+" Copyright (c) 2015-present Greg Hurrell+"+" Permission is hereby granted, free of charge, to any person obtaining+" a copy of this software and associated documentation files (the+" "Software"), to deal in the Software without restriction, including+" without limitation the rights to use, copy, modify, merge, publish,+" distribute, sublicense, and/or sell copies of the Software, and to+" permit persons to whom the Software is furnished to do so, subject to+" the following conditions:+"+" The above copyright notice and this permission notice shall be+" included in all copies or substantial portions of the Software.+"+" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,+" EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF+" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND+" NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE+" LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION+" OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION+" WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.+"+"+" # Development+"+" ## Contributing patches+"+" Patches can be sent via mail to greg@hurrell.net, or as GitHub pull requests+" at: https://github.com/wincent/vim-docvim/pulls+"+" ## Cutting a new release+"+" At the moment the release process is manual:+"+" - Perform final sanity checks and manual testing+" - Update the |docvim-history| section of the documentation+" - Verify clean work tree:+"+" ```+" git status+" ```+"+" - Tag the release:+"+" ```+" git tag -s -m "$VERSION release" $VERSION+" ```+"+" - Publish the code:+"+" ```+" git push origin master --follow-tags+" git push github master --follow-tags+" ```+"+" - Produce the release archive:+"+" ```+" git archive -o vim-docvim-$VERSION.zip HEAD -- .+" ```+"+" - Upload to http://www.vim.org/scripts/script.php?script_id=[TODO]+"+"+" # Authors+"+" vim-docvim is written and maintained by Greg Hurrell <greg@hurrell.net>.+"+"+" # History+"+" ## 0.1 (not yet released)+"+" - Initial release.++syntax region docvimBlock start='\v^\s*""' end='\v^\zs\ze\s*($|[^ \t"])' containedin=vimFuncBody+syntax region docvimPre start='\v^\s*"\s+\zs```\s*$' end='\v^\s*"\s+```\s*$' containedin=docvimBlock contained keepend++syntax match docvimAnnotation '\v\@command( .+)?' containedin=docvimBlock contained+syntax match docvimAnnotation '@commands' containedin=docvimBlock contained+syntax match docvimAnnotation '@dedent' containedin=docvimBlock contained+syntax match docvimAnnotation '@footer' containedin=docvimBlock contained+syntax match docvimAnnotation '\v\@function( .+)?' containedin=docvimBlock contained+syntax match docvimAnnotation '@functions' containedin=docvimBlock contained+syntax match docvimAnnotation '@indent' containedin=docvimBlock contained+syntax match docvimAnnotation '\v\@mapping( .+)?' containedin=docvimBlock contained+syntax match docvimAnnotation '@mappings' containedin=docvimBlock contained+syntax match docvimAnnotation '\v\@option( .+)?' containedin=docvimBlock contained+syntax match docvimAnnotation '@options' containedin=docvimBlock contained+syntax match docvimAnnotation '@param' containedin=docvimBlock contained+syntax match docvimAnnotation '\v\@plugin( .+)?' containedin=docvimBlock contained+syntax match docvimAnnotation '@private' containedin=docvimBlock contained+syntax match docvimBackticks '\v`[^\s`]+`' containedin=docvimBlock contained+syntax match docvimBlockquote '\v^\s*"\s+\zs\>\s+.+$' containedin=docvimBlock contained+syntax match docvimCrossReference '\v\c\|:?[a-z0-9()<>\.:-]+\|' containedin=docvimBlock contained+syntax match docvimHeading '\v^\s*"\s+\zs#\s+.+$' containedin=docvimBlock contained+syntax match docvimPreComment '\v^\s*"' containedin=docvimPre contained+syntax match docvimSetting "\v'[a-z]{2,}'" containedin=docvimBlock contained+syntax match docvimSetting "\v't_..'" containedin=docvimBlock contained+syntax match docvimSpecial '\v\<CSM-.\>' containedin=docvimBlock contained+syntax match docvimSpecial '\v\<[-a-zA-Z0-9_]+\>' containedin=docvimBlock contained+syntax match docvimSubheading '\v^\s*"\s+\zs##\s+.+$' containedin=docvimBlock contained+syntax match docvimTarget '\v\c\*:?[a-z0-9()<>-]+\*' containedin=docvimBlock contained++" Stolen from $VIMRUNTIME/syntax/help.vim:+syntax match docvimURL `\v<(((https?|ftp|gopher)://|(mailto|file|news):)[^' <>"]+|(www|web|w3)[a-z0-9_-]*\.[a-z0-9._-]+\.[^' <>"]+)[a-zA-Z0-9/]` containedin=docvimBlock contained++if has('conceal')+ syntax match docvimBacktick '\v`' containedin=docvimBackticks contained conceal+ syntax match docvimBar '\v\|' containedin=docvimCrossReference contained conceal+ syntax match docvimHeadingPrefix '\v# ' containedin=docvimHeading contained conceal+ syntax match docvimStar '\v\*' containedin=docvimTarget contained conceal+ syntax match docvimSubheadingPrefix '\v## ' containedin=docvimSubheading contained conceal+else+ syntax match docvimBacktick '\v`' containedin=docvimBackticks contained+ syntax match docvimBar '\v\|' containedin=docvimCrossReference contained+ syntax match docvimHeadingPrefix '\v# ' containedin=docvimHeading contained+ syntax match docvimStar '\v\*' containedin=docvimTarget contained+ syntax match docvimSubheadingPrefix '\v## ' containedin=docvimSubheading contained+endif++function! s:italicize(name, link)+ try+ execute 'highlight! ' . a:name . ' ' . pinnacle#italicize(a:link)+ catch+ execute 'highlight! link ' . a:name . ' ' . a:link+ endtry+endfunction++function! s:highlight()+ call s:italicize('docvimAnnotation', 'String')+ call s:italicize('docvimBacktick', 'Comment')+ call s:italicize('docvimBackticks', 'Comment')+ call s:italicize('docvimBar', 'Identifier')+ call s:italicize('docvimBlock', 'Normal')+ call s:italicize('docvimBlockquote', 'Comment')+ call s:italicize('docvimComment', 'Normal')+ call s:italicize('docvimCrossReference', 'Identifier')+ call s:italicize('docvimHeading', 'Identifier')+ call s:italicize('docvimHeadingPrefix', 'Identifier')+ call s:italicize('docvimPre', 'Comment')+ call s:italicize('docvimSetting', 'Type')+ call s:italicize('docvimSpecial', 'Special')+ call s:italicize('docvimStar', 'String')+ call s:italicize('docvimSubheading', 'PreProc')+ call s:italicize('docvimSubheadingPrefix', 'PreProc')+ call s:italicize('docvimTarget', 'String')+ call s:italicize('docvimURL', 'String')+endfunction++if has('autocmd')+ augroup Docvim+ autocmd!+ autocmd ColorScheme * call s:highlight()+ augroup END+endif++call s:highlight()
+ tests/fixtures/integration/vim-docvim/input/ftplugin/vim.vim view
@@ -0,0 +1,6 @@+set conceallevel=2+set concealcursor=nc++" https://groups.google.com/forum/#!topic/vim_dev/M8FBQIM6-aY+let s:path=resolve(expand('<sfile>:p:h:h')) . '/after'+execute 'set rtp+=' . s:path
+ tests/fixtures/markdown/basic-paragraphs.golden view
@@ -0,0 +1,5 @@+Simple paragraph.++A multiline paragraph.++Here is one with an embedded break tag.<br />End.
+ tests/fixtures/markdown/basic-paragraphs.vim view
@@ -0,0 +1,8 @@+""+" Simple paragraph.+"+" A multiline+" paragraph.+"+" Here is one with an embedded break tag.<br>+" End.
+ tests/fixtures/markdown/blockquotes.golden view
@@ -0,0 +1,7 @@+> Here is a blockquote.++And:++> Here...+>+> ... is another.
+ tests/fixtures/markdown/blockquotes.vim view
@@ -0,0 +1,9 @@+""+" > Here is a blockquote.+"+" And:+"+" > Here...+" >+" > ... is another.+"
+ tests/fixtures/markdown/break-tags.golden view
@@ -0,0 +1,13 @@+> Here is a blockquote<br />With a breaktag in it.++And here is some<br />normal text with a breaktag.++> Same but with an XHTML-style<br />tag.++And<br />again.++> And one final variation containing<br />whitespace inside the tag.++And with that,<br />we're done.++- Now let's try that<br />with a list item.
+ tests/fixtures/markdown/break-tags.vim view
@@ -0,0 +1,21 @@+""+" > Here is a blockquote<br>+" > With a breaktag in it.+"+" And here is some<br>+" normal text with a breaktag.+"+" > Same but with an XHTML-style<br/>+" > tag.+"+" And<br/>+" again.+"+" > And one final variation containing<br />+" > whitespace inside the tag.+"+" And with that,<br />+" we're done.+"+" - Now let's try that<br>+" with a list item.
+ tests/fixtures/markdown/code.golden view
@@ -0,0 +1,1 @@+`code` and `more code`.
+ tests/fixtures/markdown/code.vim view
@@ -0,0 +1,2 @@+""+" `code` and `more code`.
+ tests/fixtures/markdown/fenced.golden view
@@ -0,0 +1,12 @@+Here is some fenced code:++```+function foo() {+ return 1;+}+```++That was it. Here's an empty block:++```+```
+ tests/fixtures/markdown/fenced.vim view
@@ -0,0 +1,14 @@+""+" Here is some fenced code:+"+" ```+" function foo() {+" return 1;+" }+" ```+"+" That was it. Here's an empty block:+"+" ```+" ```+"
+ tests/fixtures/markdown/headings.golden view
@@ -0,0 +1,9 @@+# foo<a name="foo-foo" href="#user-content-foo-foo"></a>++## A heading<a name="foo-a-heading" href="#user-content-foo-a-heading"></a>++### A subheading<a name="foo-a-subheading" href="#user-content-foo-a-subheading"></a>++## An overlength heading when I really should have chose something shorter<a name="foo-an-overlength-heading-when-i-really-should-have-chose-something-shorter" href="#user-content-foo-an-overlength-heading-when-i-really-should-have-chose-something-shorter"></a>++Note that in order for that last one to be shown as a heading in Vim, we can't allow the usual hard-wrapping rules to apply.
+ tests/fixtures/markdown/headings.vim view
@@ -0,0 +1,11 @@+""+" @plugin foo We need this because otherwise we don't get link targets+"+" # A heading+"+" ## A subheading+"+" # An overlength heading when I really should have chose something shorter+"+" Note that in order for that last one to be shown as a heading in Vim, we can't+" allow the usual hard-wrapping rules to apply.
+ tests/fixtures/markdown/link-targets.golden view
@@ -0,0 +1,2 @@+<p align="right"><a name="foobar" href="#user-content-foobar"><code>foo_bar</code></a> <a name="gthing" href="#user-content-gthing"><code>g:Thing</code></a></p>+This paragraph has some associated link targets above it.
+ tests/fixtures/markdown/link-targets.vim view
@@ -0,0 +1,5 @@+""+" *g:Thing* *foo_bar*+" This paragraph has some associated link targets above+" it.+"
+ tests/fixtures/markdown/links.golden view
@@ -0,0 +1,4 @@+<p align="right"><a name="foobar" href="#user-content-foobar"><code>'foobar'</code></a> <a name="gthing" href="#user-content-gthing"><code>g:Thing</code></a></p>+See those links targets?++I'm going to link to <strong>[`g:Thing`](#user-content-gthing)</strong> and <strong>[`'foobar'`](#user-content-foobar)</strong> here.
+ tests/fixtures/markdown/links.vim view
@@ -0,0 +1,6 @@+""+" *g:Thing* *'foobar'*+" See those links targets?+"+" I'm going to link to |g:Thing| and |'foobar'| here.+"
+ tests/fixtures/markdown/list-items.golden view
@@ -0,0 +1,6 @@+Here we test list items:++- This is one.+- This is another.++No more list items.
+ tests/fixtures/markdown/list-items.vim view
@@ -0,0 +1,8 @@+""+" Here we test list items:+"+" - This is one.+" - This is another.+"+" No more list items.+"
+ tests/fixtures/markdown/ordering-across-docblocks.golden view
@@ -0,0 +1,29 @@+# Example<a name="example-example" href="#user-content-example-example"></a>++In which the narrator says some things.++## Commands<a name="example-commands" href="#user-content-example-commands"></a>++Stuff about commands.++## Mappings<a name="example-mappings" href="#user-content-example-mappings"></a>++Stuff about mappings.++## Options<a name="example-options" href="#user-content-example-options"></a>++Stuff about options.++## Functions<a name="example-functions" href="#user-content-example-functions"></a>++Stuff about functions.++## License<a name="example-license" href="#user-content-example-license"></a>++Released under the terms of the OMFGWTFBBQLMAOPL.++## History<a name="example-history" href="#user-content-example-history"></a>++### 0.1 (not yet released)<a name="example-01-not-yet-released" href="#user-content-example-01-not-yet-released"></a>++- Initial release.
+ tests/fixtures/markdown/ordering-across-docblocks.vim view
@@ -0,0 +1,42 @@+""+" @options+"+" Stuff about options.+"++""+" @functions+"+" Stuff about functions.+"++""+" @mappings+"+" Stuff about mappings.+"++""+" @commands+"+" Stuff about commands.+"++""+" @footer+"+" # License+"+" Released under the terms of the OMFGWTFBBQLMAOPL.+"+" # History+"+" ## 0.1 (not yet released)+"+" - Initial release.++""+" @plugin Example An example plug-in.+"+" In which the narrator says some things.+"
+ tests/fixtures/markdown/ordering-within-docblocks.golden view
@@ -0,0 +1,29 @@+# Example<a name="example-example" href="#user-content-example-example"></a>++In which the narrator says some things.++## Commands<a name="example-commands" href="#user-content-example-commands"></a>++Stuff about commands.++## Mappings<a name="example-mappings" href="#user-content-example-mappings"></a>++Stuff about mappings.++## Options<a name="example-options" href="#user-content-example-options"></a>++Stuff about options.++## Functions<a name="example-functions" href="#user-content-example-functions"></a>++Stuff about functions.++## License<a name="example-license" href="#user-content-example-license"></a>++Released under the terms of the OMFGWTFBBQLMAOPL.++## History<a name="example-history" href="#user-content-example-history"></a>++### 0.1 (not yet released)<a name="example-01-not-yet-released" href="#user-content-example-01-not-yet-released"></a>++- Initial release.
+ tests/fixtures/markdown/ordering-within-docblocks.vim view
@@ -0,0 +1,33 @@+""+" @options+"+" Stuff about options.+"+" @functions+"+" Stuff about functions.+"+" @mappings+"+" Stuff about mappings.+"+" @commands+"+" Stuff about commands.+"+" @footer+"+" # License+"+" Released under the terms of the OMFGWTFBBQLMAOPL.+"+" # History+"+" ## 0.1 (not yet released)+"+" - Initial release.+"+" @plugin Example An example plug-in.+"+" In which the narrator says some things.+"
+ tests/fixtures/markdown/separator.golden view
@@ -0,0 +1,5 @@+Let's test a separator.++---++This is pretty separate, isn't it?
+ tests/fixtures/markdown/separator.vim view
@@ -0,0 +1,7 @@+""+" Let's test a separator.+"+" ---+"+" This is pretty separate, isn't it?+"
+ tests/fixtures/parser/backticks.golden view
@@ -0,0 +1,41 @@+Project+ [ Project+ [ Unit+ [ DocBlock+ [ Paragraph+ [ Plaintext "We"+ , Whitespace+ , Plaintext "can"+ , Whitespace+ , Plaintext "use"+ , Whitespace+ , Code "backticks"+ , Whitespace+ , Plaintext "as"+ , Whitespace+ , Plaintext "well."+ ]+ , Paragraph+ [ Plaintext "Just"+ , Whitespace+ , Plaintext "remember"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Code "git commit"+ , Whitespace+ , Plaintext "at"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "end"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "it."+ ]+ , Paragraph [ Code "backticks in first column work too" ]+ ]+ ]+ ]+ ]
+ tests/fixtures/parser/backticks.vim view
@@ -0,0 +1,6 @@+""+" We can use `backticks` as well.+"+" Just remember to `git commit` at the end of it.+"+" `backticks in first column work too`
+ tests/fixtures/parser/blank-docblock-lines.golden view
@@ -0,0 +1,11 @@+Project+ [ Project+ [ Unit+ [ DocBlock+ [ LinkTargets [ "leading-blank-lines" ]+ , LinkTargets [ "trailing-whitespace-is-ok-too" ]+ , LinkTargets [ "trailing-blank-lines" ]+ ]+ ]+ ]+ ]
+ tests/fixtures/parser/blank-docblock-lines.vim view
@@ -0,0 +1,16 @@+""+"+"+" *leading-blank-lines*+" +"+" *trailing-whitespace-is-ok-too* +"+" +"+"+"+" *trailing-blank-lines*+"+" +"
+ tests/fixtures/parser/blockquotes.golden view
@@ -0,0 +1,90 @@+Project+ [ Project+ [ Unit+ [ DocBlock+ [ Blockquote+ [ Paragraph+ [ Plaintext "Here"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "single-line"+ , Whitespace+ , Plaintext "blockquote"+ , Whitespace+ , Plaintext "with"+ , Whitespace+ , Plaintext "trailing"+ , Whitespace+ , Plaintext "space..."+ ]+ ]+ , Blockquote+ [ Paragraph+ [ Plaintext "And"+ , Whitespace+ , Plaintext "here"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "multline"+ , Whitespace+ , Plaintext "one."+ ]+ ]+ , Blockquote+ [ Paragraph [ Plaintext "And" , Whitespace , Plaintext "this" ]+ , Paragraph+ [ Plaintext "is"+ , Whitespace+ , Plaintext "one"+ , Whitespace+ , Plaintext "with"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "blank"+ , Whitespace+ , Plaintext "line"+ , Whitespace+ , Plaintext "in"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "middle."+ ]+ ]+ , Blockquote+ [ Paragraph+ [ Plaintext "This"+ , Whitespace+ , Plaintext "one"+ , Whitespace+ , Plaintext "with"+ , Whitespace+ , Plaintext "multiple"+ ]+ , Paragraph+ [ Plaintext "consecutive" , Whitespace , Plaintext "blanks..." ]+ ]+ , Blockquote+ [ Paragraph+ [ Plaintext "Look"+ , BreakTag+ , Plaintext "Line"+ , Whitespace+ , Plaintext "breaks"+ , Whitespace+ , Plaintext "work"+ , Whitespace+ , Plaintext "too."+ ]+ ]+ ]+ ]+ ]+ ]
+ tests/fixtures/parser/blockquotes.vim view
@@ -0,0 +1,20 @@+""+"+" > Here is a single-line blockquote with trailing space... +"+" > And here is+" > a multline+" > one.+"+" > And this+" >+" > is one with a blank line in the middle.+"+" > This one with multiple+" >+" >+" >+" > consecutive blanks...+"+" > Look<br>+" > Line breaks work too.
+ tests/fixtures/parser/br-tags.golden view
@@ -0,0 +1,56 @@+Project+ [ Project+ [ Unit+ [ DocBlock+ [ Paragraph [ Plaintext "This." , BreakTag , Plaintext "That." ]+ , Paragraph [ Plaintext "This." , BreakTag , Plaintext "That." ]+ , Paragraph [ Plaintext "This." , BreakTag , Plaintext "That." ]+ , Paragraph [ Plaintext "This." , BreakTag , Plaintext "That." ]+ , Paragraph+ [ Plaintext "Note"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "surrounding"+ , Whitespace+ , Plaintext "whitespace"+ , BreakTag+ , Plaintext "gets"+ , Whitespace+ , Plaintext "slurped"+ , Whitespace+ , Plaintext "(at"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "end"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "line)."+ ]+ , Paragraph+ [ Plaintext "And"+ , BreakTag+ , Plaintext "internally"+ , Whitespace+ , Plaintext "too."+ ]+ , Paragraph+ [ Plaintext "Also,"+ , BreakTag+ , Plaintext "we"+ , BreakTag+ , Plaintext "are"+ , BreakTag+ , Plaintext "case"+ , BreakTag+ , Plaintext "insensitive."+ , BreakTag+ ]+ ]+ ]+ ]+ ]
+ tests/fixtures/parser/br-tags.vim view
@@ -0,0 +1,24 @@+""+"+" This.<br>+" That.+"+" This.<br />+" That.+"+" This.<br/>+" That.+"+" This.<br>That.+"+" Note that surrounding whitespace <br> +" gets slurped (at the end of the line).+"+" And <br /> internally too.+"+" Also,<BR>+" we<Br>+" are<bR>+" case<Br />+" insensitive.<BR />+"
+ tests/fixtures/parser/command.golden view
@@ -0,0 +1,34 @@+Project+ [ CommandsAnnotation+ , CommandAnnotation "Ack" (Just "{pattern} {options}")+ , Paragraph [ Plaintext "Info." ]+ , CommandAnnotation "Qargs" Nothing+ , Paragraph+ [ Plaintext "No"+ , Whitespace+ , Plaintext "params"+ , Whitespace+ , Plaintext "on"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "one."+ ]+ , Paragraph+ [ Plaintext "TODO:"+ , Whitespace+ , Plaintext "Infer"+ , Whitespace+ , Plaintext "info"+ , Whitespace+ , Plaintext "based"+ , Whitespace+ , Plaintext "on"+ , Whitespace+ , Plaintext "following"+ , Whitespace+ , Plaintext "VimL"+ , Whitespace+ , Plaintext "nodes."+ ]+ ]
+ tests/fixtures/parser/command.vim view
@@ -0,0 +1,10 @@+""+" @command :Ack {pattern} {options}+"+" Info.+"+" @command :Qargs+"+" No params on that one.+"+" TODO: Infer info based on following VimL nodes.
+ tests/fixtures/parser/commands.golden view
@@ -0,0 +1,44 @@+Project+ [ Project+ [ Unit+ [ DocBlock+ [ Paragraph+ [ Plaintext "General" , Whitespace , Plaintext "stuff." ]+ ]+ ]+ ]+ , CommandsAnnotation+ , Paragraph+ [ Plaintext "Here"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "some"+ , Whitespace+ , Plaintext "general"+ , Whitespace+ , Plaintext "commentary"+ , Whitespace+ , Plaintext "about"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "commands"+ , Whitespace+ , Plaintext "provided"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "plug-in."+ ]+ , FooterAnnotation+ , Paragraph+ [ Plaintext "Some"+ , Whitespace+ , Plaintext "other"+ , Whitespace+ , Plaintext "stuff."+ ]+ ]
+ tests/fixtures/parser/commands.vim view
@@ -0,0 +1,10 @@+""+" General stuff.+"+" @commands+"+" Here is some general commentary about the commands provided by the plug-in.+"+" @footer+"+" Some other stuff.
+ tests/fixtures/parser/comments.golden view
@@ -0,0 +1,1 @@+Empty
+ tests/fixtures/parser/comments.vim view
@@ -0,0 +1,3 @@+" Note that comments+"+" Can have "blank" lines in them, like the one above.
+ tests/fixtures/parser/empty-function.golden view
@@ -0,0 +1,13 @@+Project+ [ Project+ [ Unit+ [ FunctionDeclaration+ { functionBang = False+ , functionName = "Foo"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody = []+ }+ ]+ ]+ ]
+ tests/fixtures/parser/empty-function.vim view
@@ -0,0 +1,2 @@+fu Foo()+endf
+ tests/fixtures/parser/empty.golden view
@@ -0,0 +1,1 @@+Empty
+ tests/fixtures/parser/empty.vim view
+ tests/fixtures/parser/endfunction.golden view
@@ -0,0 +1,50 @@+Project+ [ Project+ [ Unit+ [ FunctionDeclaration+ { functionBang = True+ , functionName = "A"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody =+ [ GenericStatement "for l:item in getqflist()"+ , GenericStatement "echo l:item"+ , GenericStatement "endfo"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "B"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody =+ [ GenericStatement "for l:item in getqflist()"+ , GenericStatement "echo l:item"+ , GenericStatement "endfor"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "C"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody =+ [ GenericStatement "for l:item in getqflist()"+ , GenericStatement "echo l:item"+ , GenericStatement "endfo"+ ]+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "D"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody =+ [ GenericStatement "for l:item in getqflist()"+ , GenericStatement "echo l:item"+ , GenericStatement "endfo"+ ]+ }+ ]+ ]+ ]
+ tests/fixtures/parser/endfunction.vim view
@@ -0,0 +1,24 @@+" This test shows how we disambiguate between `:endf` and `:endfo`.+fu! A()+ for l:item in getqflist()+ echo l:item+ endfo+endf++fu! B()+ for l:item in getqflist()+ echo l:item+ endfor+endf++fu! C()+ for l:item in getqflist()+ echo l:item+ endfo+endfuncti++fu! D()+ for l:item in getqflist()+ echo l:item+ endfo+endfunction
+ tests/fixtures/parser/fenced-code-blocks.golden view
@@ -0,0 +1,18 @@+Project+ [ Project+ [ Unit+ [ DocBlock+ [ Fenced+ [ "Here is a fenced code block."+ , " All internal whitespace is preserved."+ , "But not trailing whitespace."+ ]+ , Fenced+ [ "We can do better too."+ , " This will be good."+ , "Adapt to find real indent."+ ]+ ]+ ]+ ]+ ]
+ tests/fixtures/parser/fenced-code-blocks.vim view
@@ -0,0 +1,14 @@+""+"+" ```+" Here is a fenced code block.+" All internal whitespace is preserved.+" But not trailing whitespace. +" ```+"+" ```+" We can do better too.+" This will be good.+" Adapt to find real indent.+" ```+"
+ tests/fixtures/parser/function-autoloaded.golden view
@@ -0,0 +1,13 @@+Project+ [ Project+ [ Unit+ [ FunctionDeclaration+ { functionBang = False+ , functionName = "this#that#the#other"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody = []+ }+ ]+ ]+ ]
+ tests/fixtures/parser/function-autoloaded.vim view
@@ -0,0 +1,2 @@+fu this#that#the#other()+endf
+ tests/fixtures/parser/function-bang.golden view
@@ -0,0 +1,13 @@+Project+ [ Project+ [ Unit+ [ FunctionDeclaration+ { functionBang = True+ , functionName = "Foo"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody = []+ }+ ]+ ]+ ]
+ tests/fixtures/parser/function-bang.vim view
@@ -0,0 +1,2 @@+fu! Foo()+endf
+ tests/fixtures/parser/function-command-variants.golden view
@@ -0,0 +1,83 @@+Project+ [ Project+ [ Unit+ [ FunctionDeclaration+ { functionBang = False+ , functionName = "Function1"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody = []+ }+ , FunctionDeclaration+ { functionBang = False+ , functionName = "Function2"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody = []+ }+ , FunctionDeclaration+ { functionBang = False+ , functionName = "Function3"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody = []+ }+ , FunctionDeclaration+ { functionBang = False+ , functionName = "Function4"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody = []+ }+ , FunctionDeclaration+ { functionBang = False+ , functionName = "Function5"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody = []+ }+ , FunctionDeclaration+ { functionBang = False+ , functionName = "Function6"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody = []+ }+ , FunctionDeclaration+ { functionBang = False+ , functionName = "Function7"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody = []+ }+ , FunctionDeclaration+ { functionBang = False+ , functionName = "Function8"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody = []+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "FunctionWithBang1"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody = []+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "FunctionWithBang2"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody = []+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "FunctionWithBang3"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody = []+ }+ ]+ ]+ ]
+ tests/fixtures/parser/function-command-variants.vim view
@@ -0,0 +1,33 @@+fu Function1()+endf++fun Function2()+endfu++func Function3()+endfun++funct Function4()+endfunc++functi Function5()+endfunct++functio Function6()+endfuncti++function Function7()+endfunctio++function Function8()+endfunction++fu! FunctionWithBang1()+endf++fun! FunctionWithBang2()+endf++" Cheating a bit, don't bother checking func!, funct!, functi! and functio!...+function! FunctionWithBang3()+endf
+ tests/fixtures/parser/function-script-local.golden view
@@ -0,0 +1,27 @@+Project+ [ Project+ [ Unit+ [ FunctionDeclaration+ { functionBang = True+ , functionName = "s:foo"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody = []+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "s:underscores_too"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody = []+ }+ , FunctionDeclaration+ { functionBang = True+ , functionName = "s:"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody = []+ }+ ]+ ]+ ]
+ tests/fixtures/parser/function-script-local.vim view
@@ -0,0 +1,9 @@+fu! s:foo()+endf++fu! s:underscores_too()+endf++" Believe it or not, this is valid in VimL.+fu! s:()+endf
+ tests/fixtures/parser/function-varargs.golden view
@@ -0,0 +1,29 @@+Project+ [ Project+ [ Unit+ [ FunctionDeclaration+ { functionBang = True+ , functionName = "Foo"+ , functionArguments =+ ArgumentList [ Argument "varargs" , Argument "..." ]+ , functionAttributes = []+ , functionBody = []+ }+ , FunctionDeclaration+ { functionBang = False+ , functionName = "Bar"+ , functionArguments = ArgumentList [ Argument "..." ]+ , functionAttributes = []+ , functionBody = []+ }+ , FunctionDeclaration+ { functionBang = False+ , functionName = "Baz"+ , functionArguments =+ ArgumentList [ Argument "..." , Argument "other" ]+ , functionAttributes = []+ , functionBody = []+ }+ ]+ ]+ ]
+ tests/fixtures/parser/function-varargs.vim view
@@ -0,0 +1,9 @@+fu! Foo(varargs, ...)+endf++fun Bar(...)+endf++" TODO: disallow this:+function Baz(..., other)+endf
+ tests/fixtures/parser/function-with-nested-contents.golden view
@@ -0,0 +1,14 @@+Project+ [ Project+ [ Unit+ [ FunctionDeclaration+ { functionBang = False+ , functionName = "Foo"+ , functionArguments = ArgumentList []+ , functionAttributes = []+ , functionBody =+ [ LetStatement { letLexpr = "g:foo" , letValue = "1" } ]+ }+ ]+ ]+ ]
+ tests/fixtures/parser/function-with-nested-contents.vim view
@@ -0,0 +1,4 @@+fu Foo()+ " Contents go here.+ let g:foo=1+endf
+ tests/fixtures/parser/functions-with-attributes.golden view
@@ -0,0 +1,41 @@+Project+ [ Project+ [ Unit+ [ FunctionDeclaration+ { functionBang = False+ , functionName = "Function1"+ , functionArguments = ArgumentList []+ , functionAttributes = [ "abort" ]+ , functionBody = []+ }+ , FunctionDeclaration+ { functionBang = False+ , functionName = "Function2"+ , functionArguments = ArgumentList []+ , functionAttributes = [ "range" ]+ , functionBody = []+ }+ , FunctionDeclaration+ { functionBang = False+ , functionName = "Function3"+ , functionArguments = ArgumentList []+ , functionAttributes = [ "dict" ]+ , functionBody = []+ }+ , FunctionDeclaration+ { functionBang = False+ , functionName = "Function4"+ , functionArguments = ArgumentList []+ , functionAttributes = [ "abort" , "range" , "dict" ]+ , functionBody = []+ }+ , FunctionDeclaration+ { functionBang = False+ , functionName = "Function5"+ , functionArguments = ArgumentList []+ , functionAttributes = [ "abort" , "range" , "abort" , "abort" ]+ , functionBody = []+ }+ ]+ ]+ ]
+ tests/fixtures/parser/functions-with-attributes.vim view
@@ -0,0 +1,16 @@+fu Function1() abort+endf++fun Function2() range+endfu++func Function3() dict+endfun++" Multiple attributes.+funct Function4() abort range dict+endfunc++" Repeated attributes.+functi Function5() abort range abort abort+endfunct
+ tests/fixtures/parser/functions.golden view
@@ -0,0 +1,44 @@+Project+ [ Project+ [ Unit+ [ DocBlock+ [ Paragraph+ [ Plaintext "General" , Whitespace , Plaintext "stuff." ]+ ]+ ]+ ]+ , FunctionsAnnotation+ , Paragraph+ [ Plaintext "Here"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "some"+ , Whitespace+ , Plaintext "general"+ , Whitespace+ , Plaintext "commentary"+ , Whitespace+ , Plaintext "about"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "functions"+ , Whitespace+ , Plaintext "provided"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "plug-in."+ ]+ , FooterAnnotation+ , Paragraph+ [ Plaintext "Some"+ , Whitespace+ , Plaintext "other"+ , Whitespace+ , Plaintext "stuff."+ ]+ ]
+ tests/fixtures/parser/functions.vim view
@@ -0,0 +1,10 @@+""+" General stuff.+"+" @functions+"+" Here is some general commentary about the functions provided by the plug-in.+"+" @footer+"+" Some other stuff.
+ tests/fixtures/parser/headings.golden view
@@ -0,0 +1,11 @@+Project+ [ Project+ [ Unit+ [ DocBlock+ [ HeadingAnnotation "Heading"+ , SubheadingAnnotation "Subheading"+ , HeadingAnnotation "Heading with trailing whitespace"+ ]+ ]+ ]+ ]
+ tests/fixtures/parser/headings.vim view
@@ -0,0 +1,6 @@+""+" # Heading+"+" ## Subheading+"+" # Heading with trailing whitespace
+ tests/fixtures/parser/just-whitespace.golden view
@@ -0,0 +1,1 @@+Empty
+ tests/fixtures/parser/just-whitespace.vim view
@@ -0,0 +1,3 @@+ + +
+ tests/fixtures/parser/let.golden view
@@ -0,0 +1,13 @@+Project+ [ Project+ [ Unit+ [ LetStatement+ { letLexpr = "s:example" , letValue = "s:myfunction('foo')" }+ , LetStatement+ { letLexpr = "l:list[l:line - 1]"+ , letValue = "0 \" Trailing comment."+ }+ , LetStatement { letLexpr = "g:foo " , letValue = "'bar'" }+ ]+ ]+ ]
+ tests/fixtures/parser/let.vim view
@@ -0,0 +1,6 @@+let s:example=s:myfunction('foo')++let l:list[l:line - 1]=0 " Trailing comment.++" We tolerate space before/after the assignment operator.+let g:foo = 'bar'
+ tests/fixtures/parser/lexpr.golden view
@@ -0,0 +1,16 @@+Project+ [ Project+ [ Unit+ [ LexprStatement+ { lexprBang = True+ , lexprExpr = "system(&grepprg . ' ' . g:command)"+ }+ , LexprStatement+ { lexprBang = False , lexprExpr = "s:MyFancyFunc()" }+ , LexprStatement+ { lexprBang = False+ , lexprExpr = "autoloaded#function(\"blah\")."+ }+ ]+ ]+ ]
+ tests/fixtures/parser/lexpr.vim view
@@ -0,0 +1,8 @@+" Bang form.+lexpr! system(&grepprg . ' ' . g:command)++" Vanilla.+lexpr s:MyFancyFunc()++" We support the abbreviation too.+lex autoloaded#function("blah").
+ tests/fixtures/parser/link-targets.golden view
@@ -0,0 +1,10 @@+Project+ [ Project+ [ Unit+ [ DocBlock+ [ LinkTargets [ "single-target" ]+ , LinkTargets [ "multiple" , "targets" ]+ ]+ ]+ ]+ ]
+ tests/fixtures/parser/link-targets.vim view
@@ -0,0 +1,4 @@+""+" *single-target*+"+" *multiple* *targets*
+ tests/fixtures/parser/links.golden view
@@ -0,0 +1,43 @@+Project+ [ Project+ [ Unit+ [ DocBlock+ [ Paragraph+ [ Plaintext "Here"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "an"+ , Whitespace+ , Plaintext "example"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Link "link"+ , Plaintext "."+ ]+ , Paragraph+ [ Plaintext "See"+ , Whitespace+ , Link "'foo'"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Link ":bar"+ , Whitespace+ , Plaintext "or"+ , Whitespace+ , Link "g:Thing"+ , Whitespace+ , Plaintext "for"+ , Whitespace+ , Plaintext "more"+ , Whitespace+ , Plaintext "info."+ ]+ ]+ ]+ ]+ ]
+ tests/fixtures/parser/links.vim view
@@ -0,0 +1,5 @@+""+" Here is an example of a |link|.+"+" See |'foo'| or |:bar| or |g:Thing| for more info.+"
+ tests/fixtures/parser/list-items.golden view
@@ -0,0 +1,83 @@+Project+ [ Project+ [ Unit+ [ DocBlock+ [ List+ [ ListItem [ Plaintext "Item" , Whitespace , Plaintext "1." ]+ , ListItem+ [ Plaintext "Item"+ , Whitespace+ , Plaintext "with"+ , Whitespace+ , Plaintext "trailing"+ , Whitespace+ , Plaintext "space."+ ]+ , ListItem [ Plaintext "Another" , Whitespace , Plaintext "item." ]+ , ListItem+ [ Plaintext "Note"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "we"+ , Whitespace+ , Plaintext "parse"+ , Whitespace+ , Plaintext "nested"+ , Whitespace+ , Plaintext "lists."+ ]+ , ListItem+ [ Plaintext "But"+ , Whitespace+ , Plaintext "don't"+ , Whitespace+ , Plaintext "do"+ , Whitespace+ , Plaintext "anything"+ , Whitespace+ , Plaintext "special"+ , Whitespace+ , Plaintext "with"+ , Whitespace+ , Plaintext "them."+ ]+ , ListItem+ [ Plaintext "This"+ , Whitespace+ , Plaintext "one"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "multiline"+ , Whitespace+ , Plaintext "list"+ , Whitespace+ , Plaintext "item."+ ]+ ]+ , Paragraph+ [ Plaintext "This"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "a"+ , Whitespace+ , Plaintext "paragraph"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "follows"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "list"+ , Whitespace+ , Plaintext "item."+ ]+ ]+ ]+ ]+ ]
+ tests/fixtures/parser/list-items.vim view
@@ -0,0 +1,11 @@+""+" - Item 1.+" - Item with trailing space. +" - Another item.+" - Note that we parse nested lists.+" - But don't do anything special with them.+" - This one is a+" multiline list+" item.+"+" This is a paragraph that follows the list item.
+ tests/fixtures/parser/lw.golden view
@@ -0,0 +1,18 @@+Project+ [ Project+ [ Unit+ [ LwindowStatement { lwindowHeight = Nothing }+ , LwindowStatement { lwindowHeight = Nothing }+ , LwindowStatement { lwindowHeight = Nothing }+ , LwindowStatement { lwindowHeight = Nothing }+ , LwindowStatement { lwindowHeight = Nothing }+ , LwindowStatement { lwindowHeight = Nothing }+ , LwindowStatement { lwindowHeight = Just 10 }+ , LwindowStatement { lwindowHeight = Just 20 }+ , LwindowStatement { lwindowHeight = Just 30 }+ , LwindowStatement { lwindowHeight = Just 40 }+ , LwindowStatement { lwindowHeight = Just 50 }+ , LwindowStatement { lwindowHeight = Just 60 }+ ]+ ]+ ]
+ tests/fixtures/parser/lw.vim view
@@ -0,0 +1,13 @@+lw+lwi+lwin+lwind+lwindo+lwindow++lw 10+lwi 20+lwin 30+lwind 40+lwindo 50+lwindow 60
+ tests/fixtures/parser/mappings.golden view
@@ -0,0 +1,44 @@+Project+ [ Project+ [ Unit+ [ DocBlock+ [ Paragraph+ [ Plaintext "General" , Whitespace , Plaintext "stuff." ]+ ]+ ]+ ]+ , MappingsAnnotation+ , Paragraph+ [ Plaintext "Here"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "some"+ , Whitespace+ , Plaintext "general"+ , Whitespace+ , Plaintext "commentary"+ , Whitespace+ , Plaintext "about"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "mappings"+ , Whitespace+ , Plaintext "provided"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "plug-in."+ ]+ , FooterAnnotation+ , Paragraph+ [ Plaintext "Some"+ , Whitespace+ , Plaintext "other"+ , Whitespace+ , Plaintext "stuff."+ ]+ ]
+ tests/fixtures/parser/mappings.vim view
@@ -0,0 +1,10 @@+""+" General stuff.+"+" @mappings+"+" Here is some general commentary about the mappings provided by the plug-in.+"+" @footer+"+" Some other stuff.
+ tests/fixtures/parser/minimal-annotation.golden view
@@ -0,0 +1,1 @@+Project [ DocBlock [ PluginAnnotation "Foo" "Bar" , TOC [] ] ]
+ tests/fixtures/parser/minimal-annotation.vim view
@@ -0,0 +1,1 @@+"" @plugin Foo Bar
+ tests/fixtures/parser/options.golden view
@@ -0,0 +1,44 @@+Project+ [ Project+ [ Unit+ [ DocBlock+ [ Paragraph+ [ Plaintext "General" , Whitespace , Plaintext "stuff." ]+ ]+ ]+ ]+ , OptionsAnnotation+ , Paragraph+ [ Plaintext "Here"+ , Whitespace+ , Plaintext "is"+ , Whitespace+ , Plaintext "some"+ , Whitespace+ , Plaintext "general"+ , Whitespace+ , Plaintext "commentary"+ , Whitespace+ , Plaintext "about"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "options"+ , Whitespace+ , Plaintext "provided"+ , Whitespace+ , Plaintext "by"+ , Whitespace+ , Plaintext "the"+ , Whitespace+ , Plaintext "plug-in."+ ]+ , FooterAnnotation+ , Paragraph+ [ Plaintext "Some"+ , Whitespace+ , Plaintext "other"+ , Whitespace+ , Plaintext "stuff."+ ]+ ]
+ tests/fixtures/parser/options.vim view
@@ -0,0 +1,10 @@+""+" General stuff.+"+" @options+"+" Here is some general commentary about the options provided by the plug-in.+"+" @footer+"+" Some other stuff.
+ tests/fixtures/parser/phrasing-content.golden view
@@ -0,0 +1,81 @@+Project+ [ Project+ [ Unit+ [ DocBlock+ [ Paragraph+ [ Plaintext "We"+ , Whitespace+ , Plaintext "want"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "make"+ , Whitespace+ , Plaintext "sure"+ , Whitespace+ , Plaintext "that"+ , Whitespace+ , Plaintext "stuff"+ , Whitespace+ , Plaintext "immediately"+ , Whitespace+ , Plaintext "following"+ , Whitespace+ , Plaintext "phrasing"+ , Whitespace+ , Plaintext "content."+ ]+ , HeadingAnnotation "Gets recognized"+ , List [ ListItem [ Plaintext "Appropriately" ] ]+ , Fenced [ "code" ]+ , SubheadingAnnotation "Even if we don't expect"+ , Paragraph+ [ Code "this"+ , Whitespace+ , Plaintext "kind"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "thing"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "happen"+ , Whitespace+ , Plaintext "very"+ , Whitespace+ , Plaintext "often."+ ]+ , IndentAnnotation+ , Paragraph+ [ Plaintext "indented" , Whitespace , Plaintext "content" ]+ , DedentAnnotation+ , Separator+ , Blockquote+ [ Paragraph+ [ Plaintext "end"+ , Whitespace+ , Plaintext "of"+ , Whitespace+ , Plaintext "special"+ , Whitespace+ , Plaintext "stuff"+ ]+ ]+ , Paragraph+ [ Plaintext "back"+ , Whitespace+ , Plaintext "to"+ , Whitespace+ , Plaintext "normal"+ , Whitespace+ , Plaintext "phrasing"+ , Whitespace+ , Plaintext "content"+ , Whitespace+ , Plaintext "again."+ ]+ ]+ ]+ ]+ ]
+ tests/fixtures/parser/phrasing-content.vim view
@@ -0,0 +1,15 @@+""+" We want to make sure that stuff immediately following phrasing content.+" # Gets recognized+" - Appropriately+" ```+" code+" ```+" ## Even if we don't expect+" `this` kind of thing to happen very often.+" @indent+" indented content+" @dedent+" ---+" > end of special stuff+" back to normal phrasing content again.
+ tests/fixtures/parser/plugin-annotation.golden view
@@ -0,0 +1,6 @@+Project+ [ DocBlock+ [ PluginAnnotation "Foo" "Description with trailing whitespace"+ , TOC []+ ]+ ]
+ tests/fixtures/parser/plugin-annotation.vim view
@@ -0,0 +1,2 @@+""+" @plugin Foo Description with trailing whitespace
+ tests/fixtures/parser/simple-annotations.golden view
@@ -0,0 +1,10 @@+Project+ [ DocBlock [ PluginAnnotation "foo" "bar" , TOC [] ]+ , DedentAnnotation+ , Project+ [ Unit+ [ LetStatement { letLexpr = "g:x" , letValue = "1 \"Unset!" }+ , LetStatement { letLexpr = "g:y" , letValue = "1" }+ ]+ ]+ ]
+ tests/fixtures/parser/simple-annotations.vim view
@@ -0,0 +1,4 @@+let g:x=1 "Unset!+"" @plugin foo bar+" @dedent+let g:y=1
+ tests/fixtures/parser/trailing-comment.golden view
@@ -0,0 +1,10 @@+Project+ [ Project+ [ Unit+ [ LetStatement+ { letLexpr = "g:counter"+ , letValue = "1 \" Set counter to initial value."+ }+ ]+ ]+ ]
+ tests/fixtures/parser/trailing-comment.vim view
@@ -0,0 +1,4 @@+let g:counter=1 " Set counter to initial value.++" And this is a trailing comment at the end+" of a file.
+ tests/fixtures/vim/basic-paragraphs.golden view
@@ -0,0 +1,6 @@+Simple paragraph.++A multiline paragraph.++Here is one with an embedded break tag.+End.
+ tests/fixtures/vim/blockquotes.golden view
@@ -0,0 +1,7 @@+ Here is a blockquote.++And:++ Here...++ ... is another.
+ tests/fixtures/vim/break-tags.golden view
@@ -0,0 +1,20 @@+ Here is a blockquote+ With a breaktag in it.++And here is some+normal text with a breaktag.++ Same but with an XHTML-style+ tag.++And+again.++ And one final variation containing+ whitespace inside the tag.++And with that,+we're done.++- Now let's try that+ with a list item.
+ tests/fixtures/vim/code.golden view
@@ -0,0 +1,1 @@+`code` and `more code`.
+ tests/fixtures/vim/fenced.golden view
@@ -0,0 +1,9 @@+Here is some fenced code:+>+ function foo() {+ return 1;+ }+<+That was it. Here's an empty block:+>+<
+ tests/fixtures/vim/headings.golden view
@@ -0,0 +1,16 @@+*foo.txt* We need this because otherwise we don't get link targets *foo*++CONTENTS *foo-contents*+++1. A heading |foo-a-heading|+2. An overlength heading when I really should have chose something shorter |foo-an-overlength-heading-when-i-really-should-have-chose-something-shorter|++A HEADING *foo-a-heading*++A subheading ~++AN OVERLENGTH HEADING WHEN I REALLY SHOULD HAVE CHOSE SOMETHING SHORTER *foo-an-overlength-heading-when-i-really-should-have-chose-something-shorter*++Note that in order for that last one to be shown as a heading in Vim, we+can't allow the usual hard-wrapping rules to apply.
+ tests/fixtures/vim/link-targets.golden view
@@ -0,0 +1,3 @@++ *foo_bar* *g:Thing*+This paragraph has some associated link targets above it.
+ tests/fixtures/vim/links.golden view
@@ -0,0 +1,5 @@++ *'foobar'* *g:Thing*+See those links targets?++I'm going to link to |g:Thing| and |'foobar'| here.
+ tests/fixtures/vim/list-items.golden view
@@ -0,0 +1,6 @@+Here we test list items:++- This is one.+- This is another.++No more list items.
+ tests/fixtures/vim/options.golden view
@@ -0,0 +1,25 @@+OPTIONS+++ *g:Foo*+|g:Foo| string (default: "foo")++Controls the foo factor.+++ *g:Temp*+|g:Temp| number (default: 10)++Temperature control.+++ *g:Bar*+|g:Bar| string (default: none)++No default on this one (explicit "none").+++ *g:qux*+|g:qux| number (default: none)++No default (implicit).
+ tests/fixtures/vim/options.vim view
@@ -0,0 +1,16 @@+""+" @option g:Foo string "foo"+"+" Controls the foo factor.+"+" @option g:Temp number 10+"+" Temperature control.+"+" @option g:Bar string none+"+" No default on this one (explicit "none").+"+" @option g:qux number+"+" No default (implicit).
+ tests/fixtures/vim/plugin.golden view
@@ -0,0 +1,11 @@+*pinnacle.txt* Highlight group manipulation for Vim *pinnacle*++CONTENTS *pinnacle-contents*++++Note how we can link to |pinnacle.txt| even though the Vim printer doesn't use+the symbol table.++Also note that case used for the plugin name in the annotation doesn't+really matter; it will be normalized to lowercase.
+ tests/fixtures/vim/plugin.vim view
@@ -0,0 +1,8 @@+""+" @plugin Pinnacle Highlight group manipulation for Vim+"+" Note how we can link to |pinnacle.txt| even though the Vim printer doesn't use+" the symbol table.+"+" Also note that case used for the plugin name in the annotation doesn't really+" matter; it will be normalized to lowercase.