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

  1.  
  2.  
  3.  
  4. VIM(1)                                                     VIM(1)
  5.  
  6.  
  7. NAME
  8.        vim - Vi IMproved, a programmers text editor
  9.  
  10. SYNOPSIS
  11.        vim [options] [file ..]
  12.        vim [options] -
  13.        vim [options] -t tag
  14.        vim [options] -q [errorfile]
  15.  
  16.        ex
  17.        view
  18.        gvim gview
  19.        rvim rview rgvim rgview
  20.  
  21. DESCRIPTION
  22.        Vim is a text editor that is upwards compatible to Vi.  It
  23.        can be used to edit any ASCII text.  It is especially use-
  24.        ful for editing programs.
  25.  
  26.        There  are  a  lot  of  enhancements above Vi: multi level
  27.        undo, multi windows and buffers, syntax highlighting, com-
  28.        mand  line  editing,  filename  completion,  on-line help,
  29.        visual selection, etc..  See ":help vi_diff" for a summary
  30.        of the differences between Vim and Vi.
  31.  
  32.        While  running  Vim a lot of help can be obtained from the
  33.        on-line help system, with the ":help"  command.   See  the
  34.        ON-LINE HELP section below.
  35.  
  36.        Most  often  Vim is started to edit a single file with the
  37.        command
  38.  
  39.             vim file
  40.  
  41.        More generally Vim is started with:
  42.  
  43.             vim [options] [filelist]
  44.  
  45.        If the filelist is missing, the editor will start with  an
  46.        empty  buffer.  Otherwise exactly one out of the following
  47.        four may be used to choose one or more files to be edited.
  48.  
  49.        file ..     A  list  of  filenames.  The first one will be
  50.                    the current file and  read  into  the  buffer.
  51.                    The  cursor  will  be  positioned on the first
  52.                    line of the buffer.  You can get to the  other
  53.                    files  with  the  ":next"  command.  To edit a
  54.                    file that starts  with  a  dash,  precede  the
  55.                    filelist with "--".
  56.  
  57.        -           The file to edit is read from stdin.  Commands
  58.                    are read from stderr, which should be a tty.
  59.  
  60.        -t {tag}    The  file  to  edit  and  the  initial  cursor
  61.  
  62.  
  63.  
  64.                            1998 April 7                         1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. VIM(1)                                                     VIM(1)
  71.  
  72.  
  73.                    position  depends  on  a "tag", a sort of goto
  74.                    label.  {tag} is looked up in the  tags  file,
  75.                    the  associated  file becomes the current file
  76.                    and  the  associated  command   is   executed.
  77.                    Mostly  this  is used for C programs, in which
  78.                    case {tag} could  be  a  function  name.   The
  79.                    effect  is that the file containing that func-
  80.                    tion becomes the current file and  the  cursor
  81.                    is  positioned  on  the start of the function.
  82.                    See ":help tag_commands".
  83.  
  84.        -q [errorfile]
  85.                    Start in quickFix mode.  The file  [errorfile]
  86.                    is  read and the first error is displayed.  If
  87.                    [errorfile]  is  omitted,  the   filename   is
  88.                    obtained from the 'errorfile' option (defaults
  89.                    to "AztecC.Err" for the Amiga, "errors.vim" on
  90.                    other  systems).  Further errors can be jumped
  91.                    to with the ":cn" command.  See ":help  quick-
  92.                    fix".
  93.  
  94.        Vim behaves differently, depending on the name of the com-
  95.        mand (the executable may still be the same file).
  96.  
  97.        vim       The "normal" way, everything is default.
  98.  
  99.        ex        Start in Ex mode.  Go to Normal  mode  with  the
  100.                  ":vi"  command.   Can also be done with the "-e"
  101.                  argument.
  102.  
  103.        view      Start in read-only mode.  You will be  protected
  104.                  from  writing  the files.  Can also be done with
  105.                  the "-R" argument.
  106.  
  107.        gvim gview
  108.                  The GUI version.  Starts a new window.  Can also
  109.                  be done with the "-g" argument.
  110.  
  111.        rvim rview rgvim rgview
  112.                  Like  the above, but with restrictions.  It will
  113.                  not be possible to start shell commands, or sus-
  114.                  pend  Vim.  Can also be done with the "-Z" argu-
  115.                  ment.
  116.  
  117. OPTIONS
  118.        The options may be given in any  order,  before  or  after
  119.        filenames.   Options  without  an argument can be combined
  120.        after a single dash.
  121.  
  122.        +[num]      For the first file the cursor  will  be  posi-
  123.                    tioned  on  line  "num".  If "num" is missing,
  124.                    the cursor will  be  positioned  on  the  last
  125.                    line.
  126.  
  127.  
  128.  
  129.  
  130.                            1998 April 7                         2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. VIM(1)                                                     VIM(1)
  137.  
  138.  
  139.        +/{pat}     For  the  first  file the cursor will be posi-
  140.                    tioned on the first occurrence of {pat}.   See
  141.                    ":help   search_pattern"   for  the  available
  142.                    search patterns.
  143.  
  144.        +{command}
  145.  
  146.        -c {command}
  147.                    {command} will be  executed  after  the  first
  148.                    file  has been read.  {command} is interpreted
  149.                    as an Ex command.  If the  {command}  contains
  150.                    spaces  it  must  be enclosed in double quotes
  151.                    (this depends on  the  shell  that  is  used).
  152.                    Example: Vim "+set si" main.c
  153.                    Note:  You  can  use up to 10 "+" or "-c" com-
  154.                    mands.
  155.  
  156.        -b          Binary mode.  A few options will be  set  that
  157.                    makes  it  possible  to  edit a binary or exe-
  158.                    cutable file.
  159.  
  160.        -C          Compatible.   Set  the  'compatible'   option.
  161.                    This will make Vim behave mostly like Vi, even
  162.                    though a .vimrc file exists.
  163.  
  164.        -d {device} Open {device} for use as a terminal.  Only  on
  165.                    the Amiga.  Example: "-d con:20/30/600/150".
  166.  
  167.        -e          Start Vim in Ex mode, just like the executable
  168.                    was called "ex".
  169.  
  170.        -f          Foreground.  For the GUI version, Vim will not
  171.                    fork  and detach from the shell it was started
  172.                    in.  On the Amiga, Vim  is  not  restarted  to
  173.                    open a new window.  This option should be used
  174.                    when Vim is executed by a  program  that  will
  175.                    wait  for  the  edit  session  to finish (e.g.
  176.                    mail).  On the Amiga the ":sh" and  ":!"  com-
  177.                    mands will not work.
  178.  
  179.        -F          If  Vim  has  been compiled with FKMAP support
  180.                    for editing right-to-left oriented  files  and
  181.                    Farsi keyboard mapping, this option starts Vim
  182.                    in Farsi mode, i.e.  'fkmap'  and  'rightleft'
  183.                    are  set.  Otherwise an error message is given
  184.                    and Vim aborts.
  185.  
  186.        -g          If Vim has been  compiled  with  GUI  support,
  187.                    this  option  enables the GUI.  If no GUI sup-
  188.                    port was compiled  in,  an  error  message  is
  189.                    given and Vim aborts.
  190.  
  191.        -h          Give  a  bit  of  help  about the command line
  192.                    arguments and options.  After this Vim  exits.
  193.  
  194.  
  195.  
  196.                            1998 April 7                         3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. VIM(1)                                                     VIM(1)
  203.  
  204.  
  205.        -H          If  Vim  has been compiled with RIGHTLEFT sup-
  206.                    port for editing right-to-left oriented  files
  207.                    and   Hebrew  keyboard  mapping,  this  option
  208.                    starts Vim in Hebrew mode,  i.e.  'hkmap'  and
  209.                    'rightleft'  are set.  Otherwise an error mes-
  210.                    sage is given and Vim aborts.
  211.  
  212.        -i {viminfo}
  213.                    When using the viminfo file is  enabled,  this
  214.                    option  sets  the  filename to use, instead of
  215.                    the default "~/.viminfo".  This  can  also  be
  216.                    used  to skip the use of the .viminfo file, by
  217.                    giving the name "NONE".
  218.  
  219.        -L          Same as -r.
  220.  
  221.        -l          Lisp mode.  Sets the  'lisp'  and  'showmatch'
  222.                    options on.
  223.  
  224.        -N          No-compatible  mode.   Reset  the 'compatible'
  225.                    option.  This will make Vim behave a bit  bet-
  226.                    ter,  but  less  Vi  compatible, even though a
  227.                    .vimrc file does not exist.
  228.  
  229.        -n          No swap file will be used.  Recovery  after  a
  230.                    crash  will  be impossible.  Handy if you want
  231.                    to edit a file on a  very  slow  medium  (e.g.
  232.                    floppy).   Can  also be done with ":set uc=0".
  233.                    Can be undone with ":set uc=200".
  234.  
  235.        -o[N]       Open N windows.  When N is omitted,  open  one
  236.                    window for each file.
  237.  
  238.        -R          Read-only mode.  The 'readonly' option will be
  239.                    set.  You can still edit the buffer, but  will
  240.                    be  prevented  from  accidently  overwriting a
  241.                    file.  If you do want to overwrite a file, add
  242.                    an  exclamation  mark to the Ex command, as in
  243.                    ":w!".  The -R  option  also  implies  the  -n
  244.                    option (see below).  The 'readonly' option can
  245.                    be reset with ":set noro".  See ":help  'read-
  246.                    only'".
  247.  
  248.        -r          List  swap files, with information about using
  249.                    them for recovery.
  250.  
  251.        -r {file}   Recovery mode.   The  swap  file  is  used  to
  252.                    recover  a  crashed editing session.  The swap
  253.                    file is a file with the same filename  as  the
  254.                    text  file  with  ".swp" appended.  See ":help
  255.                    recovery".
  256.  
  257.        -s          Silent mode.  Only when  started  as  "Ex"  or
  258.                    when the "-e" option was given before the "-s"
  259.  
  260.  
  261.  
  262.                            1998 April 7                         4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. VIM(1)                                                     VIM(1)
  269.  
  270.  
  271.                    option.
  272.  
  273.        -s {scriptin}
  274.                    The script file {scriptin} is read.  The char-
  275.                    acters  in  the file are interpreted as if you
  276.                    had typed them.  The same can be done with the
  277.                    command  ":source! {scriptin}".  If the end of
  278.                    the file is reached before the  editor  exits,
  279.                    further characters are read from the keyboard.
  280.  
  281.        -T {terminal}
  282.                    Tells Vim the name of  the  terminal  you  are
  283.                    using.   Only  required when the automatic way
  284.                    doesn't work.  Should be a terminal  known  to
  285.                    Vim  (builtin)  or  defined  in the termcap or
  286.                    terminfo file.
  287.  
  288.        -u {vimrc}  Use the commands in the file {vimrc} for  ini-
  289.                    tializations.   All  the other initializations
  290.                    are skipped.  Use this to edit a special  kind
  291.                    of  files.   It  can  also be used to skip all
  292.                    initializations by  giving  the  name  "NONE".
  293.                    See ":help initialization" within vim for more
  294.                    details.
  295.  
  296.        -U {gvimrc} Use the commands in the file {gvimrc} for  GUI
  297.                    initializations.   All  the other GUI initial-
  298.                    izations are skipped.  It can also be used  to
  299.                    skip  all  GUI  initializations  by giving the
  300.                    name "NONE".  See ":help gui_init" within  vim
  301.                    for more details.
  302.  
  303.        -V          Verbose.   Give messages about which files are
  304.                    sourced and for reading and writing a  viminfo
  305.                    file.
  306.  
  307.        -v          Start Vim in Vi mode, just like the executable
  308.                    was called "vi".  This only  has  effect  when
  309.                    the executable is called "ex".
  310.  
  311.        -w {scriptout}
  312.                    All  the characters that you type are recorded
  313.                    in the file {scriptout}, until you  exit  Vim.
  314.                    This  is useful if you want to create a script
  315.                    file to be used with "vim -s"  or  ":source!".
  316.                    If the {scriptout} file exists, characters are
  317.                    appended.
  318.  
  319.        -W {scriptout}
  320.                    Like -w, but an existing file is  overwritten.
  321.  
  322.        -x          Filter  read  and written files through crypt.
  323.                    Not implemented yet.
  324.  
  325.  
  326.  
  327.  
  328.                            1998 April 7                         5
  329.  
  330.  
  331.  
  332.  
  333.  
  334. VIM(1)                                                     VIM(1)
  335.  
  336.  
  337.        -Z          Restricted mode.  Works  like  the  executable
  338.                    starts with "r".
  339.  
  340.        --          Denotes  the  end  of  the options.  Arguments
  341.                    after this will be handled  as  a  file  name.
  342.                    This  can  be  used  to  edit  a filename that
  343.                    starts with a '-'.
  344.  
  345. ON-LINE HELP
  346.        Type ":help" in Vim to get started.  Type ":help  subject"
  347.        to  get  help  on a specific subject.  For example: ":help
  348.        ZZ" to get help for the "ZZ" command.  Use <Tab> and CTRL-
  349.        D to complete subjects (":help cmdline_completion").  Tags
  350.        are present to jump from one place  to  another  (sort  of
  351.        hypertext  links,  see  ":help").  All documentation files
  352.        can be viewed in this way, for example ":help syntax.txt".
  353.  
  354. FILES
  355.        /usr/local/lib/vim/doc/*.txt
  356.                       The  Vim  documentation  files.  Use ":help
  357.                       doc-file-list" to get the complete list.
  358.  
  359.        /usr/local/lib/vim/doc/tags
  360.                       The tags file used for finding  information
  361.                       in the documentation files.
  362.  
  363.        /usr/local/lib/vim/syntax/syntax.vim
  364.                       System wide syntax initializations.
  365.  
  366.        /usr/local/lib/vim/syntax/*.vim
  367.                       Syntax files for various languages.
  368.  
  369.        /usr/local/lib/vim/vimrc
  370.                       System wide Vim initializations.
  371.  
  372.        /usr/local/lib/vim/gvimrc
  373.                       System wide gvim initializations.
  374.  
  375.        /usr/local/lib/vim/menu.vim
  376.                       System  wide menu initializations for gvim.
  377.  
  378.        /usr/local/lib/vim/bugreport.vim
  379.                       Script  to  generate  a  bug  report.   See
  380.                       ":help bugs".
  381.  
  382.        For recent info read the VIM home page:
  383.        <URL:http://www.vim.org/>
  384.  
  385. AUTHOR
  386.        Most of Vim was made by Bram Moolenaar, with a lot of help
  387.        from others.  See ":help credits".
  388.        Vim is based on Stevie, worked on by: Tim  Thompson,  Tony
  389.        Andrews  and  G.R.  (Fred) Walter.  Although hardly any of
  390.        the original code remains.
  391.  
  392.  
  393.  
  394.                            1998 April 7                         6
  395.  
  396.  
  397.  
  398.  
  399.  
  400. VIM(1)                                                     VIM(1)
  401.  
  402.  
  403. BUGS
  404.        Probably.  See ":help todo" for a list of known  problems.
  405.  
  406.        Note  that a number of things that may be regarded as bugs
  407.        by some, are in fact caused by a too-faithful reproduction
  408.        of Vi's behaviour.  And if you think other things are bugs
  409.        "because Vi does it differently", you should take a closer
  410.        look  at  the  vi_diff.txt file (or type :help vi_diff.txt
  411.        when in Vim).  Also have a look at  the  'compatible'  and
  412.        'cpoptions' options.
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.  
  460.                            1998 April 7                         7
  461.  
  462.  
  463.