home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / runtime / doc / various.txt < prev    next >
Encoding:
Text File  |  2012-05-31  |  25.5 KB  |  638 lines

  1. *various.txt*   For Vim version 7.3.  Last change: 2012 Jan 15
  2.  
  3.  
  4.           VIM REFERENCE MANUAL    by Bram Moolenaar
  5.  
  6.  
  7. Various commands                    *various*
  8.  
  9. 1. Various commands        |various-cmds|
  10. 2. Using Vim like less or more    |less|
  11.  
  12. ==============================================================================
  13. 1. Various commands                    *various-cmds*
  14.  
  15.                             *CTRL-L*
  16. CTRL-L            Clear and redraw the screen.  The redraw may happen
  17.             later, after processing typeahead.
  18.  
  19.                             *:redr* *:redraw*
  20. :redr[aw][!]        Redraw the screen right now.  When ! is included it is
  21.             cleared first.
  22.             Useful to update the screen halfway executing a script
  23.             or function.  Also when halfway a mapping and
  24.             'lazyredraw' is set.
  25.  
  26.                         *:redraws* *:redrawstatus*
  27. :redraws[tatus][!]    Redraw the status line of the current window.  When !
  28.             is included all status lines are redrawn.
  29.             Useful to update the status line(s) when 'statusline'
  30.             includes an item that doesn't cause automatic
  31.             updating.
  32.  
  33.                             *N<Del>*
  34. <Del>            When entering a number: Remove the last digit.
  35.             Note: if you like to use <BS> for this, add this
  36.             mapping to your .vimrc: >
  37.                 :map CTRL-V <BS>   CTRL-V <Del>
  38. <            See |:fixdel| if your <Del> key does not do what you
  39.             want.
  40.  
  41. :as[cii]    or                    *ga* *:as* *:ascii*
  42. ga            Print the ascii value of the character under the
  43.             cursor in decimal, hexadecimal and octal.  For
  44.             example, when the cursor is on a 'R':
  45.                 <R>  82,  Hex 52,  Octal 122 ~
  46.             When the character is a non-standard ASCII character,
  47.             but printable according to the 'isprint' option, the
  48.             non-printable version is also given.  When the
  49.             character is larger than 127, the <M-x> form is also
  50.             printed.  For example:
  51.                 <~A>  <M-^A>  129,  Hex 81,  Octal 201 ~
  52.                 <p>  <|~>  <M-~>  254,  Hex fe,  Octal 376 ~
  53.             (where <p> is a special character)
  54.             The <Nul> character in a file is stored internally as
  55.             <NL>, but it will be shown as:
  56.                 <^@>  0,  Hex 00,  Octal 000 ~
  57.             If the character has composing characters these are
  58.             also shown.  The value of 'maxcombine' doesn't matter.
  59.             Mnemonic: Get Ascii value.  {not in Vi}
  60.  
  61.                             *g8*
  62. g8            Print the hex values of the bytes used in the
  63.             character under the cursor, assuming it is in |UTF-8|
  64.             encoding.  This also shows composing characters.  The
  65.             value of 'maxcombine' doesn't matter.
  66.             Example of a character with two composing characters:
  67.                 e0 b8 81 + e0 b8 b9 + e0 b9 89 ~
  68.             {not in Vi} {only when compiled with the |+multi_byte|
  69.             feature}
  70.  
  71.                             *8g8*
  72. 8g8            Find an illegal UTF-8 byte sequence at or after the
  73.             cursor.  This works in two situations:
  74.             1. when 'encoding' is any 8-bit encoding
  75.             2. when 'encoding' is "utf-8" and 'fileencoding' is
  76.                any 8-bit encoding
  77.             Thus it can be used when editing a file that was
  78.             supposed to be UTF-8 but was read as if it is an 8-bit
  79.             encoding because it contains illegal bytes.
  80.             Does not wrap around the end of the file.
  81.             Note that when the cursor is on an illegal byte or the
  82.             cursor is halfway a multi-byte character the command
  83.             won't move the cursor.
  84.             {not in Vi} {only when compiled with the |+multi_byte|
  85.             feature}
  86.  
  87.                         *:p* *:pr* *:print* *E749*
  88. :[range]p[rint] [flags]
  89.             Print [range] lines (default current line).
  90.             Note: If you are looking for a way to print your text
  91.             on paper see |:hardcopy|.  In the GUI you can use the
  92.             File.Print menu entry.
  93.             See |ex-flags| for [flags].
  94.  
  95. :[range]p[rint] {count} [flags]
  96.             Print {count} lines, starting with [range] (default
  97.             current line |cmdline-ranges|).
  98.             See |ex-flags| for [flags].
  99.  
  100.                             *:P* *:Print*
  101. :[range]P[rint] [count] [flags]
  102.             Just as ":print".  Was apparently added to Vi for
  103.             people that keep the shift key pressed too long...
  104.             Note: A user command can overrule this command.
  105.             See |ex-flags| for [flags].
  106.  
  107.                             *:l* *:list*
  108. :[range]l[ist] [count] [flags]
  109.             Same as :print, but display unprintable characters
  110.             with '^' and put $ after the line.  This can be
  111.             further changed with the 'listchars' option.
  112.             See |ex-flags| for [flags].
  113.  
  114.                             *:nu* *:number*
  115. :[range]nu[mber] [count] [flags]
  116.             Same as :print, but precede each line with its line
  117.             number.  (See also 'highlight' and 'numberwidth'
  118.             option).
  119.             See |ex-flags| for [flags].
  120.  
  121.                             *:#*
  122. :[range]# [count] [flags]
  123.             synonym for :number.
  124.  
  125.                             *:#!*
  126. :#!{anything}        Ignored, so that you can start a Vim script with: >
  127.                 #!vim -S
  128.                 echo "this is a Vim script"
  129.                 quit
  130. <
  131.                             *:z* *E144*
  132. :{range}z[+-^.=]{count}    Display several lines of text surrounding the line
  133.             specified with {range}, or around the current line
  134.             if there is no {range}.  If there is a {count}, that's
  135.             how many lines you'll see; if there is only one window
  136.             then twice the value of the 'scroll' option is used,
  137.             otherwise the current window height minus 3 is used.
  138.  
  139.             If there is a {count} the 'window' option is set to
  140.             its value.
  141.  
  142.             :z can be used either alone or followed by any of
  143.             several punctuation marks.  These have the following
  144.             effect:
  145.  
  146.             mark   first line    last line      new cursor line ~
  147.             ----   ----------    ---------      ------------
  148.             +      current line  1 scr forward  1 scr forward
  149.             -      1 scr back    current line   current line
  150.             ^      2 scr back    1 scr back     1 scr back
  151.             .      1/2 scr back  1/2 scr fwd    1/2 scr fwd
  152.             =      1/2 scr back  1/2 scr fwd    current line
  153.  
  154.             Specifying no mark at all is the same as "+".
  155.             If the mark is "=", a line of dashes is printed
  156.             around the current line.
  157.  
  158. :{range}z#[+-^.=]{count}                *:z#*
  159.             Like ":z", but number the lines.
  160.             {not in all versions of Vi, not with these arguments}
  161.  
  162.                             *:=*
  163. := [flags]        Print the last line number.
  164.             See |ex-flags| for [flags].
  165.  
  166. :{range}= [flags]    Prints the last line number in {range}.  For example,
  167.             this prints the current line number: >
  168.                 :.=
  169. <            See |ex-flags| for [flags].
  170.  
  171. :norm[al][!] {commands}                    *:norm* *:normal*
  172.             Execute Normal mode commands {commands}.  This makes
  173.             it possible to execute Normal mode commands typed on
  174.             the command-line.  {commands} are executed like they
  175.             are typed.  For undo all commands are undone together.
  176.             Execution stops when an error is encountered.
  177.             If the [!] is given, mappings will not be used.
  178.             {commands} should be a complete command.  If
  179.             {commands} does not finish a command, the last one
  180.             will be aborted as if <Esc> or <C-C> was typed.
  181.             The display isn't updated while ":normal" is busy.
  182.             This implies that an insert command must be completed
  183.             (to start Insert mode, see |:startinsert|).  A ":"
  184.             command must be completed as well.  And you can't use
  185.             "Q" or "gQ" to start Ex mode.
  186.             {commands} cannot start with a space.  Put a count of
  187.             1 (one) before it, "1 " is one space.
  188.             The 'insertmode' option is ignored for {commands}.
  189.             This command cannot be followed by another command,
  190.             since any '|' is considered part of the command.
  191.             This command can be used recursively, but the depth is
  192.             limited by 'maxmapdepth'.
  193.             When this command is called from a non-remappable
  194.             mapping |:noremap|, the argument can be mapped anyway.
  195.             An alternative is to use |:execute|, which uses an
  196.             expression as argument.  This allows the use of
  197.             printable characters to represent special characters.
  198.             Example: >
  199.                 :exe "normal \<c-w>\<c-w>"
  200. <            {not in Vi, of course}
  201.             {not available when the |+ex_extra| feature was
  202.             disabled at compile time}
  203.  
  204. :{range}norm[al][!] {commands}                *:normal-range*
  205.             Execute Normal mode commands {commands} for each line
  206.             in the {range}.  Before executing the {commands}, the
  207.             cursor is positioned in the first column of the range,
  208.             for each line.  Otherwise it's the same as the
  209.             ":normal" command without a range.
  210.             {not in Vi}
  211.             {not available when |+ex_extra| feature was disabled
  212.             at compile time}
  213.  
  214.                             *:sh* *:shell* *E371*
  215. :sh[ell]        This command starts a shell.  When the shell exits
  216.             (after the "exit" command) you return to Vim.  The
  217.             name for the shell command comes from 'shell' option.
  218.                             *E360*
  219.             Note: This doesn't work when Vim on the Amiga was
  220.             started in QuickFix mode from a compiler, because the
  221.             compiler will have set stdin to a non-interactive
  222.             mode.
  223.  
  224.                             *:!cmd* *:!* *E34*
  225. :!{cmd}            Execute {cmd} with the shell.  See also the 'shell'
  226.             and 'shelltype' option.
  227.             Any '!' in {cmd} is replaced with the previous
  228.             external command (see also 'cpoptions').  But not when
  229.             there is a backslash before the '!', then that
  230.             backslash is removed.  Example: ":!ls" followed by
  231.             ":!echo ! \! \\!" executes "echo ls ! \!".
  232.             After the command has been executed, the timestamp of
  233.             the current file is checked |timestamp|.
  234.             A '|' in {cmd} is passed to the shell, you cannot use
  235.             it to append a Vim command.  See |:bar|.
  236.             A newline character ends {cmd}, what follows is
  237.             interpreted as a following ":" command.  However, if
  238.             there is a backslash before the newline it is removed
  239.             and {cmd} continues.  It doesn't matter how many
  240.             backslashes are before the newline, only one is
  241.             removed.
  242.             On Unix the command normally runs in a non-interactive
  243.             shell.  If you want an interactive shell to be used
  244.             (to use aliases) set 'shellcmdflag' to "-ic".
  245.             For Win32 also see |:!start|.
  246.             Vim redraws the screen after the command is finished,
  247.             because it may have printed any text.  This requires a
  248.             hit-enter prompt, so that you can read any messages.
  249.             To avoid this use: >
  250.                 :silent !{cmd}
  251. <            The screen is not redrawn then, thus you have to use
  252.             CTRL-L or ":redraw!" if the command did display
  253.             something.
  254.             Also see |shell-window|.
  255.  
  256.                             *:!!*
  257. :!!            Repeat last ":!{cmd}".
  258.  
  259.                             *:ve* *:version*
  260. :ve[rsion]        Print the version number of the editor.  If the
  261.             compiler used understands "__DATE__" the compilation
  262.             date is mentioned.  Otherwise a fixed release-date is
  263.             shown.
  264.             The following lines contain information about which
  265.             features were enabled when Vim was compiled.  When
  266.             there is a preceding '+', the feature is included,
  267.             when there is a '-' it is excluded.  To change this,
  268.             you have to edit feature.h and recompile Vim.
  269.             To check for this in an expression, see |has()|.
  270.             Here is an overview of the features.
  271.             The first column shows the smallest version in which
  272.             they are included:
  273.                T    tiny
  274.                S    small
  275.                N    normal
  276.                B    big
  277.                H    huge
  278.                m    manually enabled or depends on other features
  279.              (none) system dependent
  280.             Thus if a feature is marked with "N", it is included
  281.             in the normal, big and huge versions of Vim.
  282.  
  283.                             *+feature-list*
  284.    *+ARP*        Amiga only: ARP support included
  285. B  *+arabic*        |Arabic| language support
  286. N  *+autocmd*        |:autocmd|, automatic commands
  287. m  *+balloon_eval*    |balloon-eval| support. Included when compiling with
  288.             supported GUI (Motif, GTK, GUI) and either
  289.             Netbeans/Sun Workshop integration or |+eval| feature.
  290. N  *+browse*        |:browse| command
  291. N  *+builtin_terms*    some terminals builtin |builtin-terms|
  292. B  *++builtin_terms*    maximal terminals builtin |builtin-terms|
  293. N  *+byte_offset*    support for 'o' flag in 'statusline' option, "go"
  294.             and ":goto" commands.
  295. N  *+cindent*        |'cindent'|, C indenting
  296. N  *+clientserver*    Unix and Win32: Remote invocation |clientserver|
  297.    *+clipboard*        |clipboard| support
  298. N  *+cmdline_compl*    command line completion |cmdline-completion|
  299. N  *+cmdline_hist*    command line history |cmdline-history|
  300. N  *+cmdline_info*    |'showcmd'| and |'ruler'|
  301. N  *+comments*        |'comments'| support
  302. B  *+conceal*        "conceal" support, see |conceal| |:syn-conceal| etc.
  303. N  *+cryptv*        encryption support |encryption|
  304. B  *+cscope*        |cscope| support
  305. m  *+cursorbind*    |'cursorbind'| support
  306. m  *+cursorshape*    |termcap-cursor-shape| support
  307. m  *+debug*        Compiled for debugging.
  308. N  *+dialog_gui*    Support for |:confirm| with GUI dialog.
  309. N  *+dialog_con*    Support for |:confirm| with console dialog.
  310. N  *+dialog_con_gui*    Support for |:confirm| with GUI and console dialog.
  311. N  *+diff*        |vimdiff| and 'diff'
  312. N  *+digraphs*        |digraphs| *E196*
  313.    *+dnd*        Support for DnD into the "~ register |quote_~|.
  314. B  *+emacs_tags*    |emacs-tags| files
  315. N  *+eval*        expression evaluation |eval.txt|
  316. N  *+ex_extra*        Vim's extra Ex commands: |:center|, |:left|,
  317.             |:normal|, |:retab| and |:right|
  318. N  *+extra_search*    |'hlsearch'| and |'incsearch'| options.
  319. B  *+farsi*        |farsi| language
  320. N  *+file_in_path*    |gf|, |CTRL-W_f| and |<cfile>|
  321. N  *+find_in_path*    include file searches: |[I|, |:isearch|,
  322.             |CTRL-W_CTRL-I|, |:checkpath|, etc.
  323. N  *+folding*        |folding|
  324.    *+footer*        |gui-footer|
  325.    *+fork*        Unix only: |fork| shell commands
  326.    *+float*        Floating point support
  327. N  *+gettext*        message translations |multi-lang|
  328.    *+GUI_Athena*    Unix only: Athena |GUI|
  329.    *+GUI_neXtaw*    Unix only: neXtaw |GUI|
  330.    *+GUI_GTK*        Unix only: GTK+ |GUI|
  331.    *+GUI_Motif*        Unix only: Motif |GUI|
  332.    *+GUI_Photon*    QNX only:  Photon |GUI|
  333. m  *+hangul_input*    Hangul input support |hangul|
  334.    *+iconv*        Compiled with the |iconv()| function
  335.    *+iconv/dyn*        Likewise |iconv-dynamic| |/dyn|
  336. N  *+insert_expand*    |insert_expand| Insert mode completion
  337. N  *+jumplist*        |jumplist|
  338. B  *+keymap*        |'keymap'|
  339. B  *+langmap*        |'langmap'|
  340. N  *+libcall*        |libcall()|
  341. N  *+linebreak*        |'linebreak'|, |'breakat'| and |'showbreak'|
  342. N  *+lispindent*    |'lisp'|
  343. N  *+listcmds*        Vim commands for the list of buffers |buffer-hidden|
  344.             and argument list |:argdelete|
  345. N  *+localmap*        Support for mappings local to a buffer |:map-local|
  346. m  *+lua*        |Lua| interface
  347. m  *+lua/dyn*        |Lua| interface |/dyn|
  348. N  *+menu*        |:menu|
  349. N  *+mksession*        |:mksession|
  350. N  *+modify_fname*    |filename-modifiers|
  351. N  *+mouse*        Mouse handling |mouse-using|
  352. N  *+mouseshape*    |'mouseshape'|
  353. B  *+mouse_dec*        Unix only: Dec terminal mouse handling |dec-mouse|
  354. N  *+mouse_gpm*        Unix only: Linux console mouse handling |gpm-mouse|
  355. B  *+mouse_netterm*    Unix only: netterm mouse handling |netterm-mouse|
  356. N  *+mouse_pterm*        QNX only: pterm mouse handling |qnx-terminal|
  357. N  *+mouse_sysmouse*    Unix only: *BSD console mouse handling |sysmouse|
  358. N  *+mouse_urxvt*        Unix only: urxvt mouse handling |urxvt-mouse|
  359. N  *+mouse_xterm*        Unix only: xterm mouse handling |xterm-mouse|
  360. B  *+multi_byte*        16 and 32 bit characters |multibyte|
  361.    *+multi_byte_ime*    Win32 input method for multibyte chars |multibyte-ime|
  362. N  *+multi_lang*        non-English language support |multi-lang|
  363. m  *+mzscheme*        Mzscheme interface |mzscheme|
  364. m  *+mzscheme/dyn*    Mzscheme interface |mzscheme-dynamic| |/dyn|
  365. m  *+netbeans_intg*    |netbeans|
  366. m  *+ole*            Win32 GUI only: |ole-interface|
  367. N  *+path_extra*        Up/downwards search in 'path' and 'tags'
  368. m  *+perl*        Perl interface |perl|
  369. m  *+perl/dyn*        Perl interface |perl-dynamic| |/dyn|
  370. N  *+persistent_undo*    Persistent undo |undo-persistence|
  371.    *+postscript*        |:hardcopy| writes a PostScript file
  372. N  *+printer*        |:hardcopy| command
  373. H  *+profile*        |:profile| command
  374. m  *+python*        Python 2 interface |python|
  375. m  *+python/dyn*        Python 2 interface |python-dynamic| |/dyn|
  376. m  *+python3*        Python 3 interface |python|
  377. m  *+python3/dyn*        Python 3 interface |python-dynamic| |/dyn|
  378. N  *+quickfix*        |:make| and |quickfix| commands
  379. N  *+reltime*        |reltime()| function, 'hlsearch'/'incsearch' timeout,
  380.             'redrawtime' option
  381. B  *+rightleft*        Right to left typing |'rightleft'|
  382. m  *+ruby*        Ruby interface |ruby|
  383. m  *+ruby/dyn*        Ruby interface |ruby-dynamic| |/dyn|
  384. N  *+scrollbind*        |'scrollbind'|
  385. B  *+signs*        |:sign|
  386. N  *+smartindent*        |'smartindent'|
  387. m  *+sniff*        SniFF interface |sniff|
  388. N  *+startuptime*        |--startuptime| argument
  389. N  *+statusline*        Options 'statusline', 'rulerformat' and special
  390.             formats of 'titlestring' and 'iconstring'
  391. m  *+sun_workshop*    |workshop|
  392. N  *+syntax*        Syntax highlighting |syntax|
  393.    *+system()*        Unix only: opposite of |+fork|
  394. N  *+tag_binary*        binary searching in tags file |tag-binary-search|
  395. N  *+tag_old_static*    old method for static tags |tag-old-static|
  396. m  *+tag_any_white*    any white space allowed in tags file |tag-any-white|
  397. m  *+tcl*            Tcl interface |tcl|
  398. m  *+tcl/dyn*        Tcl interface |tcl-dynamic| |/dyn|
  399.    *+terminfo*        uses |terminfo| instead of termcap
  400. N  *+termresponse*    support for |t_RV| and |v:termresponse|
  401. N  *+textobjects*        |text-objects| selection
  402.    *+tgetent*        non-Unix only: able to use external termcap
  403. N  *+title*        Setting the window 'title' and 'icon'
  404. N  *+toolbar*        |gui-toolbar|
  405. N  *+user_commands*    User-defined commands. |user-commands|
  406. N  *+viminfo*        |'viminfo'|
  407. N  *+vertsplit*        Vertically split windows |:vsplit|
  408. N  *+virtualedit*        |'virtualedit'|
  409. S  *+visual*        Visual mode |Visual-mode|
  410. N  *+visualextra*        extra Visual mode commands |blockwise-operators|
  411. N  *+vreplace*        |gR| and |gr|
  412. N  *+wildignore*        |'wildignore'|
  413. N  *+wildmenu*        |'wildmenu'|
  414. S  *+windows*        more than one window
  415. m  *+writebackup*        |'writebackup'| is default on
  416. m  *+xim*            X input method |xim|
  417.    *+xfontset*        X fontset support |xfontset|
  418. m  *+xpm_w32*        Win32 GUI only: pixmap support |:sign-define|
  419.    *+xsmp*        XSMP (X session management) support
  420.    *+xsmp_interact*    interactive XSMP (X session management) support
  421. N  *+xterm_clipboard*    Unix only: xterm clipboard handling
  422. m  *+xterm_save*        save and restore xterm screen |xterm-screens|
  423. N  *+X11*            Unix only: can restore window title |X11|
  424.  
  425.                             */dyn* *E370* *E448*
  426.             To some of the features "/dyn" is added when the
  427.             feature is only available when the related library can
  428.             be dynamically loaded.
  429.  
  430. :ve[rsion] {nr}        Is now ignored.  This was previously used to check the
  431.             version number of a .vimrc file.  It was removed,
  432.             because you can now use the ":if" command for
  433.             version-dependent behavior.  {not in Vi}
  434.  
  435.                             *:redi* *:redir*
  436. :redi[r][!] > {file}    Redirect messages to file {file}.  The messages which
  437.             are the output of commands are written to that file,
  438.             until redirection ends.  The messages are also still
  439.             shown on the screen.  When [!] is included, an
  440.             existing file is overwritten.  When [!] is omitted,
  441.             and {file} exists, this command fails.
  442.             Only one ":redir" can be active at a time.  Calls to
  443.             ":redir" will close any active redirection before
  444.             starting redirection to the new target.
  445.             To stop the messages and commands from being echoed to
  446.             the screen, put the commands in a function and call it
  447.             with ":silent call Function()".
  448.             An alternative is to use the 'verbosefile' option,
  449.             this can be used in combination with ":redir".
  450.             {not in Vi}
  451.  
  452. :redi[r] >> {file}    Redirect messages to file {file}.  Append if {file}
  453.             already exists.  {not in Vi}
  454.  
  455. :redi[r] @{a-zA-Z}
  456. :redi[r] @{a-zA-Z}>    Redirect messages to register {a-z}.  Append to the
  457.             contents of the register if its name is given
  458.             uppercase {A-Z}.  The ">" after the register name is
  459.             optional. {not in Vi}
  460. :redi[r] @{a-z}>>    Append messages to register {a-z}. {not in Vi}
  461.  
  462. :redi[r] @*>        
  463. :redi[r] @+>        Redirect messages to the selection or clipboard. For
  464.             backward compatibility, the ">" after the register
  465.             name can be omitted. See |quotestar| and |quoteplus|.
  466.             {not in Vi}
  467. :redi[r] @*>>        
  468. :redi[r] @+>>        Append messages to the selection or clipboard.
  469.             {not in Vi}
  470.  
  471. :redi[r] @">        Redirect messages to the unnamed register. For
  472.             backward compatibility, the ">" after the register
  473.             name can be omitted. {not in Vi}
  474. :redi[r] @">>        Append messages to the unnamed register. {not in Vi}
  475.  
  476. :redi[r] => {var}    Redirect messages to a variable.  If the variable
  477.             doesn't exist, then it is created.  If the variable
  478.             exists, then it is initialized to an empty string.
  479.             The variable will remain empty until redirection ends.
  480.             Only string variables can be used.  After the
  481.             redirection starts, if the variable is removed or
  482.             locked or the variable type is changed, then further
  483.             command output messages will cause errors. {not in Vi}
  484.  
  485. :redi[r] =>> {var}    Append messages to an existing variable.  Only string
  486.             variables can be used. {not in Vi}
  487.  
  488. :redi[r] END        End redirecting messages.  {not in Vi}
  489.  
  490.                         *:sil* *:silent*
  491. :sil[ent][!] {command}    Execute {command} silently.  Normal messages will not
  492.             be given or added to the message history.
  493.             When [!] is added, error messages will also be
  494.             skipped, and commands and mappings will not be aborted
  495.             when an error is detected.  |v:errmsg| is still set.
  496.             When [!] is not used, an error message will cause
  497.             further messages to be displayed normally.
  498.             Redirection, started with |:redir|, will continue as
  499.             usual, although there might be small differences.
  500.             This will allow redirecting the output of a command
  501.             without seeing it on the screen.  Example: >
  502.                 :redir >/tmp/foobar
  503.                 :silent g/Aap/p
  504.                 :redir END
  505. <            To execute a Normal mode command silently, use the
  506.             |:normal| command.  For example, to search for a
  507.             string without messages: >
  508.                 :silent exe "normal /path\<CR>"
  509. <            ":silent!" is useful to execute a command that may
  510.             fail, but the failure is to be ignored.  Example: >
  511.                 :let v:errmsg = ""
  512.                 :silent! /^begin
  513.                 :if v:errmsg != ""
  514.                 : ... pattern was not found
  515. <            ":silent" will also avoid the hit-enter prompt.  When
  516.             using this for an external command, this may cause the
  517.             screen to be messed up.  Use |CTRL-L| to clean it up
  518.             then.
  519.             ":silent menu ..." defines a menu that will not echo a
  520.             Command-line command.  The command will still produce
  521.             messages though.  Use ":silent" in the command itself
  522.             to avoid that: ":silent menu .... :silent command".
  523.  
  524.                         *:uns* *:unsilent*
  525. :uns[ilent] {command}    Execute {command} not silently.  Only makes a
  526.             difference when |:silent| was used to get to this
  527.             command.
  528.             Use this for giving a message even when |:silent| was
  529.             used.  In this example |:silent| is used to avoid the
  530.             message about reading the file and |:unsilent| to be
  531.             able to list the first line of each file. >
  532.             :silent argdo unsilent echo expand('%') . ": " . getline(1)
  533. <
  534.  
  535.                         *:verb* *:verbose*
  536. :[count]verb[ose] {command}
  537.             Execute {command} with 'verbose' set to [count].  If
  538.             [count] is omitted one is used. ":0verbose" can be
  539.             used to set 'verbose' to zero.
  540.             The additional use of ":silent" makes messages
  541.             generated but not displayed.
  542.             The combination of ":silent" and ":verbose" can be
  543.             used to generate messages and check them with
  544.             |v:statusmsg| and friends.  For example: >
  545.                 :let v:statusmsg = ""
  546.                 :silent verbose runtime foobar.vim
  547.                 :if v:statusmsg != ""
  548.                 :  " foobar.vim could not be found
  549.                 :endif
  550. <            When concatenating another command, the ":verbose"
  551.             only applies to the first one: >
  552.                 :4verbose set verbose | set verbose
  553. <                  verbose=4 ~
  554.                   verbose=0 ~
  555.             For logging verbose messages in a file use the
  556.             'verbosefile' option.
  557.  
  558.                             *:verbose-cmd*
  559. When 'verbose' is non-zero, listing the value of a Vim option or a key map or
  560. an abbreviation or a user-defined function or a command or a highlight group
  561. or an autocommand will also display where it was last defined.  If it was
  562. defined manually then there will be no "Last set" message.  When it was
  563. defined while executing a function, user command or autocommand, the script in
  564. which it was defined is reported.
  565. {not available when compiled without the |+eval| feature}
  566.  
  567.                             *K*
  568. K            Run a program to lookup the keyword under the
  569.             cursor.  The name of the program is given with the
  570.             'keywordprg' (kp) option (default is "man").  The
  571.             keyword is formed of letters, numbers and the
  572.             characters in 'iskeyword'.  The keyword under or
  573.             right of the cursor is used.  The same can be done
  574.             with the command >
  575.                 :!{program} {keyword}
  576. <            There is an example of a program to use in the tools
  577.             directory of Vim.  It is called 'ref' and does a
  578.             simple spelling check.
  579.             Special cases:
  580.             - If 'keywordprg' is empty, the ":help" command is
  581.               used.  It's a good idea to include more characters
  582.               in 'iskeyword' then, to be able to find more help.
  583.             - When 'keywordprg' is equal to "man", a count before
  584.               "K" is inserted after the "man" command and before
  585.               the keyword.  For example, using "2K" while the
  586.               cursor is on "mkdir", results in: >
  587.                 !man 2 mkdir
  588. <            - When 'keywordprg' is equal to "man -s", a count
  589.               before "K" is inserted after the "-s".  If there is
  590.               no count, the "-s" is removed.
  591.             {not in Vi}
  592.  
  593.                             *v_K*
  594. {Visual}K        Like "K", but use the visually highlighted text for
  595.             the keyword.  Only works when the highlighted text is
  596.             not more than one line.  {not in Vi}
  597.  
  598. [N]gs                            *gs* *:sl* *:sleep*
  599. :[N]sl[eep] [N]    [m]    Do nothing for [N] seconds.  When [m] is included,
  600.             sleep for [N] milliseconds.  The count for "gs" always
  601.             uses seconds.  The default is one second. >
  602.                  :sleep         "sleep for one second
  603.                  :5sleep         "sleep for five seconds
  604.                  :sleep 100m     "sleep for a hundred milliseconds
  605.                  10gs         "sleep for ten seconds
  606. <            Can be interrupted with CTRL-C (CTRL-Break on MS-DOS).
  607.             "gs" stands for "goto sleep".
  608.             While sleeping the cursor is positioned in the text,
  609.             if at a visible position.  {not in Vi}
  610.             Also process the received netbeans messages. {only
  611.             available when compiled with the |+netbeans_intg|
  612.             feature}
  613.  
  614.  
  615.                             *g_CTRL-A*
  616. g CTRL-A        Only when Vim was compiled with MEM_PROFILING defined
  617.             (which is very rare): print memory usage statistics.
  618.             Only useful for debugging Vim.
  619.  
  620. ==============================================================================
  621. 2. Using Vim like less or more                    *less*
  622.  
  623. If you use the less or more program to view a file, you don't get syntax
  624. highlighting.  Thus you would like to use Vim instead.  You can do this by
  625. using the shell script "$VIMRUNTIME/macros/less.sh".
  626.  
  627. This shell script uses the Vim script "$VIMRUNTIME/macros/less.vim".  It sets
  628. up mappings to simulate the commands that less supports.  Otherwise, you can
  629. still use the Vim commands.
  630.  
  631. This isn't perfect.  For example, when viewing a short file Vim will still use
  632. the whole screen.  But it works good enough for most uses, and you get syntax
  633. highlighting.
  634.  
  635. The "h" key will give you a short overview of the available commands.
  636.  
  637.  vim:tw=78:ts=8:ft=help:norl:
  638.