RunView.txt RunView Jan 12, 2018
Copyright: Copyright (C) 2018 Charles E. Campbell {{{1
Permission is hereby granted to use and distribute this code,
with or without modifications, provided that this copyright
notice is copied with it. Like anything else that's free,
RunView.vim is provided *as is* and comes with no warranty
of any kind, either expressed or implied. By using this
plugin, you agree that in no event will the copyright
holder be liable for any damages resulting from the use
of this software.
==============================================================================
1. Contents runview runview-contents
1. Contents..................................: runview-contents
2. Usage.....................................: runview-usage
3. Options...................................: runview-options
4. History...................................: runview-history
==============================================================================
2. Usage runview-usage
COMMAND :RunView :RV
:[range]RunView[!] [filtercommand]
:[range]RV[!] [filtercommand]
VISUAL MODE MAPS \rh \rv
(visual-line-selection) \rh
(visual-line-selection) \rv
RunView runs user-selected lines, selected either via a range provided
to the RunView command or by visual-line selection (V), through a
filter. By default, the filter is ksh; however, the runview-filtcmd
can be set (let g:runview_filtcmd="someotherfilter") in your <.vimrc>
to override this. The RunView command lets you specify the filter
on the command line, too.
However, if the filtercommand has a "%" in it, then the current file
name is substituted for the "%" and executed by :r! filtercommand .
The output is placed in a separate window; it is horizontally (\rh) or
vertically (\rv) placed. Source code is left unchanged and visible.
Without the !, the RunView command uses vertically stacked windows.
With the !, the RunView command uses horizontally adjacent windows.
As an example, consider the file:
Using
the source code window is left on top, but the results of filtering
the three lines is shown below it:
RunView provides a title and a separator. Subsequent applications
of RunView will append a new separator line plus the new filter
output.
The package contains:
==============================================================================
3. Options runview-option runview-options
Option Variable Default Value
----------------- -------------
runview-filtcmd g:runview_filtcmd "ksh"
runview-swapwin g:runview_swapwin 1
The g:runview_filtcmd specifies the default application that will
be used to filter lines.
One may use b:runview_filtcmd , too (see buffer-variable).
This variant works well with ftplugins; ie. one can have
the action that :RV takes depend on the filetype.
If g:runview_swapwin is true, then the source lines and output
window will be swapped (horizontal: top<>bottom, vertical:left<>right).
==============================================================================
4. History runview-history
v3 Nov 25, 2013 * various bug fixes
Jul 02, 2015 * changed %d to use blackhole register (%d _)
Jan 12, 2018 * improved decision concerning when to append
vs when to create a new window for output
v2 Jan 07, 2009 * Updated syntax highlighting.
Changed default to vertical split
Jul 20, 2010 * runview buffer now a scratch buffer
(see special-buffers)
Nov 08, 2011 * added "%" to let filtercommand take a filename
v1 Oct 26, 2005 * Initial release
==============================================================================
vim: ts=8