home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / vim53os2.zip / vim-5.3 / doc / various.txt < prev    next >
Text File  |  1998-08-30  |  15KB  |  366 lines

  1. *various.txt*   For Vim version 5.3.  Last modification: 1998 Aug 30
  2.  
  3.  
  4.           VIM REFERENCE MANUAL    by Bram Moolenaar
  5.  
  6.  
  7. Various commands                    *various*
  8.  
  9. 1. Various commands    |various-cmds|
  10. 2. Online help        |online-help|
  11.  
  12. ==============================================================================
  13. 1. Various commands                    *various-cmds*
  14.  
  15.                             *CTRL-L*
  16. CTRL-L            Clear and redraw the screen.
  17.  
  18.                             *N<Del>*
  19. <Del>            When entering a number: Remove the last digit.
  20.             Note: if you like to use <BS> for this, add this
  21.             mapping to your .vimrc:
  22.                 :map CTRL-V <BS>   CTRL-V <Del>
  23.             See |:fixdel| if your <Del> key does not do what you
  24.             want.
  25.  
  26. :as[cii]    or                    *ga* *:as* *:ascii*
  27. ga            Print the ascii value of the character under the
  28.             cursor in decimal, hexadecimal and octal.  For
  29.             example, when the cursor is on a 'R':
  30.                 <R>  82,  Hex 52,  Octal 122
  31.             When the character is a non-standard ASCII character,
  32.             but printable according to the 'isprint' option, the
  33.             non-printable version is also given.  When the
  34.             character is larger than 127, the <M-x> form is also
  35.             printed.  For example:
  36.                 <~A>  <M-^A>  129,  Hex 81,  Octal 201
  37.                 <p>  <|~>  <M-~>  254,  Hex fe,  Octal 376
  38.             (where <p> is a special character)
  39.             The <Nul> character in a file is stored internally as
  40.             <NL>, but it will be shown as:
  41.                 <^@>  0,  Hex 00,  Octal 000
  42.             Mnemonic: Get Ascii value.  {not in Vi}
  43.  
  44.                             *:p* *:print*
  45. :[range]p[rint]        Print [range] lines (default current line).
  46.  
  47. :[range]p[rint] {count}
  48.             Print {count} lines, starting with [range] (default
  49.             current line |cmdline-ranges|).
  50.  
  51.                             *:P* *:Print*
  52. :[range]P[rint] [count]
  53.             Just as ":print".  Was apparantly added to Vi for
  54.             people that keep the shift key pressed too long...
  55.  
  56.                             *:l* *:list*
  57. :[range]l[ist] [count]
  58.             Same as :print, but display unprintable characters
  59.             with '^'.
  60.  
  61.                             *:nu* *:number*
  62. :[range]nu[mber] [count]
  63.             Same as :print, but precede each line with its line
  64.             number.  (See also 'highlight' option).
  65.  
  66.                             *:#*
  67. :[range]# [count]    synonym for :number.
  68.  
  69.                             *:z*
  70. :{range}z[+-^.=]{count}    Display several lines of text surrounding the line
  71.             specified with {range}, or around the current line
  72.             if there is no {range}.  If there is a {count}, that's
  73.             how many lines you'll see; otherwise, the current
  74.             window size is used.
  75.  
  76.             :z can be used either alone or followed by any of
  77.             several punctuation marks.  These have the following
  78.             effect:
  79.  
  80.             mark   first line    last line      new location   ~
  81.             ----   ----------    ---------      ------------
  82.             +      current line  1 scr forward  1 scr forward
  83.             -      1 scr back    current line   current line
  84.             ^      2 scr back    1 scr back     1 scr back
  85.             .      1/2 scr back  1/2 scr fwd    1/2 src fwd
  86.             =      1/2 src back  1/2 scr fwd    current line
  87.  
  88.             Specifying no mark at all is the same as "+".
  89.             If the mark is "=", a line of dashes is printed
  90.             around the current line.
  91.  
  92.                             *:=*
  93. :=            Print the cursor line number.
  94.  
  95. :norm[al][!] {commands}                    *:norm* *:normal*
  96.             Execute Normal mode commands {commands}.  This makes
  97.             it possible to execute Normal mode commands typed on
  98.             the command-line.  {commands} is executed like it is
  99.             typed.  For undo all commands are undone together.  If
  100.             the [!] is given, mappings will not be used.
  101.             {commands} should be a complete command.  If
  102.             {commands} does not finish a command, more characters
  103.             need to be typed, but the display isn't updated while
  104.             doing this.
  105.             Mostly useful for autocommands.  This command cannot
  106.             be followed by another command, since any '|' is
  107.             considered part of the command.
  108.             This command can be used recursively, but the depth is
  109.             limited by 'maxmapdepth'.
  110.             When this command is called from a non-remappable
  111.             mapping |:noremap|, the argument can be mapped anyway.
  112.             An alternative is to use |:execute|, which uses an
  113.             expression as argument.  This allows the use of
  114.             printable characters.  Example:
  115. >                :exe "normal \<c-w>\<c-w>"
  116.             Hint: If the {commands} ends in an <Esc>, Vim may
  117.             think it's the start of a function key, and 'ttimeout'
  118.             will apply, which makes things very slow, or even wait
  119.             indefenitely for anything to be typed.  Include the
  120.             [!] in this case.
  121.             {not in Vi, of course}
  122.             Not available when |+ex_extra| feature was disabled at
  123.             compile time.
  124.  
  125. :{range}norm[al][!] {commands}                *:normal-range*
  126.             Execute Normal mode commands {commands} for each line
  127.             in the {range}.  Before executing the {commands}, the
  128.             cursor is positioned in the first column of the range,
  129.             for each line.  Otherwise it's the same as the
  130.             ":normal" command without a range.
  131.             {not in Vi}
  132.             Not available when |+ex_extra| feature was disabled at
  133.             compile time.
  134.  
  135.                             *:sh* *:shell*
  136. :sh[ell]        This command starts a shell.  When the shell exits
  137.             (after the "exit" command) you return to Vim.  The
  138.             name for the shell command comes from 'shell' option.
  139.             Note: This doesn't work when Vim on the Amiga was
  140.             started in QuickFix mode from a compiler, because the
  141.             compiler will have set stdin to a non-interactive
  142.             mode.
  143.  
  144.                             *:!cmd* *:!*
  145. :!{cmd}            Execute {cmd} with the shell.  See also the 'shell'
  146.             and 'shelltype' option.
  147.             Any '!' in {cmd} is replaced with the previous
  148.             external command (see also 'cpoptions').  But not when
  149.             there is a backslash before the '!', then that
  150.             backslash is removed.  Example: ":!ls" followed by
  151.             ":!echo ! \! \\!" executes "echo ls ! \!".
  152.             After the command has been executed, the timestamp of
  153.             the current file is checked |timestamp|.
  154.             There cannot be a '|' in {cmd}, see |:bar|.
  155.             Also see |shell-window|.
  156.  
  157.                             *:!!*
  158. :!!            Repeat last ":!{cmd}".
  159.  
  160.                             *:ve* *:version*
  161. :ve[rsion]        Print the version number of the editor.  If the
  162.             compiler used understands "__DATE__" the compilation
  163.             date is mentioned.  Otherwise a fixed release-date is
  164.             shown.
  165.             The following lines contain information about which
  166.             features were enabled when Vim was compiled.  When
  167.             there is a preceding '+', the feature is included,
  168.             when there is a '-' it is excluced.  To change this,
  169.             you have to edit feature.h and recompile Vim.
  170.             To check for this in an expression, see |has()|.
  171.             Here is an overview of the features:
  172.  
  173.                             *+feature-list*
  174. *+ARP*            Amiga only: ARP support included
  175. *+autocmd*        |:autocmd|, automatic commands
  176. *+browse*        |:browse| command
  177. *+builtin_terms*    some terminals builtin |builtin-terms|
  178. *++builtin_terms*    maximal terminals builtin |builtin-terms|
  179. *+cindent*        |'cindent'|, C indenting
  180. *+cscope*        |cscope| support
  181. *+dialog_gui*        Support for |:confirm| with GUI dialog.
  182. *+dialog_con*        Support for |:confirm| with console dialog.
  183. *+dialog_con_gui*    Support for |:confirm| with GUI and console dialog.
  184. *+digraphs*        |digraphs|
  185. *+emacs_tags*        |emacs-tags| files
  186. *+eval*            expression evaluation |eval.txt|
  187. *+ex_extra*        Vim's extra Ex commands: |:center|, |:left|,
  188.             |:normal|, |:retab| and |:right|
  189. *+extra_search*        |'hlsearch'| and |'incsearch'| options.
  190. *+farsi*        |farsi| language
  191. *+file_in_path*        |gf|, |CTRL-W_f| and |<cfile>|
  192. *+filetype*        Support for filetype checking in automatic commands.
  193.             |autocmd-filetypes|
  194. *+find_in_path*        include file searches: |[I|, |:isearch|,
  195.             |CTRL-W_CTRL-I|, |:checkpath|, etc.
  196. *+fork*            Unix only: |fork| shell commands
  197. *+GUI_Athena*        Unix only: Athena |GUI|
  198. *+GUI_BeOS*        BeOS only: BeOS |GUI|
  199. *+GUI_Motif*        Unix only: Motif |GUI|
  200. *+insert_expand*    |insert_expand| Insert mode completion
  201. *+langmap*        |'langmap'|
  202. *+lispindent*        |'lisp'|
  203. *+modify_fname*        |filename-modifiers|
  204. *+mouse*        Mouse handling |mouse-using|
  205. *+mouse_dec*        Unix only: Dec terminal mouse handling
  206. *+mouse_netterm*    Unix only: netterm mouse handling
  207. *+mouse_xterm*        Unix only: xterm mouse handling
  208. *+multi_byte*        Korean and other languages
  209. *+multi_byte_ime*    Win32 input method for multi_byte characters.
  210. *+ole*            Win32 GUI only: |ole-interface|
  211. *+perl*            Perl interface |perl|
  212. *+python*        Python interface |python|
  213. *+quickfix*        |:make| and |quickfix| commands
  214. *+rightleft*        Right to left typing |'rightleft'|
  215. *+showcmd*        |'showcmd'|
  216. *+smartindent*        |'smartindent'|
  217. *+sniff*        SniFF interface (no docs available...)
  218. *+syntax*        Syntax highlighting |syntax|
  219. *+system()*        Unix only: opposite of |+fork|
  220. *+tag_binary*        binary searching in tags file |tag-binary-search|
  221. *+tag_old_static*    old method for static tags |tag-old-static|
  222. *+tag_any_white*    any white space allowed in tags file |tag-any-white|
  223. *+tcl*            Tcl interface |tcl|
  224. *+terminfo*        uses |terminfo| instead of termcap
  225. *+textobjects*        |text-objects| selection
  226. *+tgetent*        non-Unix only: able to use external termcap
  227. *+user-commands*    User-defined commands.
  228. *+viminfo*        |'viminfo'|
  229. *+wildignore*        |'wildignore'|
  230. *+writebackup*        |'writebackup'| is default on
  231. *+xterm_save*        Save and restore xterm screen |xterm-screens|
  232. *+X11*            Unix only: can restore window title |X11|
  233.  
  234. :ve[rsion] {nr}        Is now ignored.  This was previously used to check the
  235.             version number of a .vimrc file.  It was removed,
  236.             because you can now use the ":if" command for
  237.             version-dependend behaviour.  {not in Vi}
  238.  
  239.                             *:redi* *:redir*
  240. :redi[r][!] > {file}    Redirect messages to file {file}.  The messages which
  241.             are the output of commands are written to that file,
  242.             until redirection ends.  The messages are also still
  243.             shown on the screen.  When [!] is included, an
  244.             existing file is overwritten.  When [!] is omitted,
  245.             and {file} exists, this command fails.  {not in Vi}
  246.  
  247. :redi[r] >> {file}    Redirect message to file {file}.  Append if {file}
  248.             already exists.  {not in Vi}
  249.  
  250. :redi[r] END        End redirecting messages.  {not in Vi}
  251.  
  252.                             *K*
  253. K            Run a program to lookup the keyword under the
  254.             cursor.  The name of the program is given with the
  255.             'keywordprg' (kp) option (default is "man").  The
  256.             keyword is formed of letters, numbers and the
  257.             characters in 'iskeyword'.  The keyword under or
  258.             right of the cursor is used.  The same can be done
  259.             with the command
  260. >                :!{program} {keyword}
  261.             There is an example of a program to use in the tools
  262.             directory of Vim.  It is called 'ref' and does a
  263.             simple spelling check.
  264.             Special cases:
  265.             - If 'keywordprg' is empty, the ":help" command is
  266.               used.  It's a good idea to include more characters
  267.               in 'iskeyword' then, to be able to find more help.
  268.             - When 'keywordprg' is equal to "man", a count before
  269.               "K" is inserted after the "man" command and before
  270.               the keyword.  For example, using "2K" while the
  271.               cursor is on "mkdir", results in:
  272. >                !man 2 mkdir
  273.             - When 'keywordprg' is equal to "man -s", a count
  274.               before "K" is inserted after the "-s".  If there is
  275.               no count, the "-s" is removed.
  276.             {not in Vi}
  277.  
  278.                             *v_K*
  279. {Visual}K        Like "K", but use the visually highlighted text for
  280.             the keyword.  Only works when the highlighted text is
  281.             not more than one line.  {not in Vi}
  282.  
  283. [N]gs                            *gs* *:sl* *:sleep*
  284. :[N]sl[eep] [N]    [m]    Do nothing for [N] seconds.  When [m] is included,
  285.             sleep for [N] milliseconds.
  286. >  :sleep      "sleep for one second
  287. >  :5sleep      "sleep for five seconds
  288. >  :sleep 100m    "sleep for hunderd millisonds
  289.             Can be interrupted with CTRL-C (CTRL-Break on MS-DOS).
  290.             "gs" stands for "goto sleep".  While sleeping the
  291.             cursor is positioned in the text (if visible).  {not
  292.             in Vi}
  293.  
  294.                             *g_CTRL-A*
  295. g CTRL-A        Only when Vim was compiled with MEM_PROFILING defined
  296.             (which is very rare): print memory usage statistics.
  297.             Only useful for debugging Vim.
  298.  
  299. ==============================================================================
  300. 2. Online help                        *online-help*
  301.  
  302.             *help* *<Help>* *:h* *:help* *<F1>* *i_<F1>* *i_<Help>*
  303. <Help>        or
  304. :h[elp]            Split the window and display the help file in
  305.             read-only mode.  If there is a help window open
  306.             already, use that one.  {not in Vi}
  307.  
  308. :h[elp] {subject}    Like ":help", additionally jump to the tag {subject}.
  309.             {subject} can include wildcards like "*", "?" and
  310.             "[a-z]":
  311.                :help z?    jump to help for any "z" command
  312.                :help z.    jump to the help for "z."
  313.             If there is no full match for the pattern, or there
  314.             are several matches, the "best" match will be used.
  315.             A sophisticated algorithm is used to decide which
  316.             match is better than another one.  These items are
  317.             considered in the computation:
  318.             - A match with same case is much better than a match
  319.               with different case.
  320.             - A match that starts after a non-alphanumeric
  321.               character is better than a match in the middle of a
  322.               word.
  323.             - A match at or near the beginning of the tag is
  324.               better than a match furter on.
  325.             - The more alphanumeric characters match, the better.
  326.             - The shorter the length of the match, the better.
  327.             Note that the longer the {subject} you give, the less
  328.             matches will be found.  You can get an idea how this
  329.             all works by using commandline completion (type CTRL-D
  330.             after ":help subject").
  331.             To use a regexp |pattern|, first do ":help" and then
  332.             use ":tag <pattern>" in the help window.  The
  333.             ":tnext" command can then be used to jump to other
  334.             matches, "tselect" to list matches and choose one.
  335. >                :help index| :tse z.
  336.             This command can be followed by '|' and another
  337.             command, but you don't need to escape the '|' inside a
  338.             help command.  So these both work:
  339. >                :help |
  340. >                :help k| only
  341.             Note that a space before the '|' is seen as part of
  342.             the ":help" argument.
  343.             You can also use <LF> or <CR> to separate the help
  344.             command from a following command.  You need to type
  345.             CTRL-V first to insert the <LF> or <CR>.  Example:
  346. >                :help so<C-V><CR>only
  347.             {not in Vi}
  348.  
  349. The help file name can be set with the 'helpfile' option.  The initial height
  350. of the help window can be set with the 'helpheight' option (default 20).
  351. Jump to specific subjects by using tags.  This can be done in two ways:
  352. - Use the "CTRL-]" command while standing on the name of a command or option.
  353.   This only works when the tag is a keyword.  "<C-Leftmouse>" and
  354.   "g<LeftMouse>" work just like "CTRL-]".
  355. - use the ":ta {subject}" command.  This works with all characters.
  356.  
  357. Use "CTRL-T" to jump back.
  358. Use ":q" to close the help window.
  359.  
  360.                             *help-xterm-window*
  361. If you want to have the help in another xterm window, you could use this
  362. command:
  363.     :!xterm -e vim +help &
  364.  
  365.  vim:tw=78:ts=8:sw=8:
  366.