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 / mac / vim55rt.sit / runtime / doc / vim.man < prev    next >
Encoding:
Text File  |  1999-09-25  |  16.0 KB  |  463 lines  |  [TEXT/ALFA]

  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.txt"  for  a
  30.        summary 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 December 28                       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 December 28                       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 December 28                       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.        -m          Modifying   files  is  disabled.   Resets  the
  225.                    'write' option, so that writing files  is  not
  226.                    possible.
  227.  
  228.        -N          No-compatible  mode.   Reset  the 'compatible'
  229.                    option.  This will make Vim behave a bit  bet-
  230.                    ter,  but  less  Vi  compatible, even though a
  231.                    .vimrc file does not exist.
  232.  
  233.        -n          No swap file will be used.  Recovery  after  a
  234.                    crash  will  be impossible.  Handy if you want
  235.                    to edit a file on a  very  slow  medium  (e.g.
  236.                    floppy).   Can  also be done with ":set uc=0".
  237.                    Can be undone with ":set uc=200".
  238.  
  239.        -o[N]       Open N windows.  When N is omitted,  open  one
  240.                    window for each file.
  241.  
  242.        -R          Read-only mode.  The 'readonly' option will be
  243.                    set.  You can still edit the buffer, but  will
  244.                    be  prevented  from  accidently  overwriting a
  245.                    file.  If you do want to overwrite a file, add
  246.                    an  exclamation  mark to the Ex command, as in
  247.                    ":w!".  The -R  option  also  implies  the  -n
  248.                    option (see below).  The 'readonly' option can
  249.                    be reset with ":set noro".  See ":help  'read-
  250.                    only'".
  251.  
  252.        -r          List  swap files, with information about using
  253.                    them for recovery.
  254.  
  255.        -r {file}   Recovery mode.   The  swap  file  is  used  to
  256.                    recover  a  crashed editing session.  The swap
  257.                    file is a file with the same filename  as  the
  258.                    text  file  with  ".swp" appended.  See ":help
  259.  
  260.  
  261.  
  262.                          1998 December 28                       4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. VIM(1)                                                     VIM(1)
  269.  
  270.  
  271.                    recovery".
  272.  
  273.        -s          Silent mode.  Only when  started  as  "Ex"  or
  274.                    when the "-e" option was given before the "-s"
  275.                    option.
  276.  
  277.        -s {scriptin}
  278.                    The script file {scriptin} is read.  The char-
  279.                    acters  in  the file are interpreted as if you
  280.                    had typed them.  The same can be done with the
  281.                    command  ":source! {scriptin}".  If the end of
  282.                    the file is reached before the  editor  exits,
  283.                    further characters are read from the keyboard.
  284.  
  285.        -T {terminal}
  286.                    Tells Vim the name of  the  terminal  you  are
  287.                    using.   Only  required when the automatic way
  288.                    doesn't work.  Should be a terminal  known  to
  289.                    Vim  (builtin)  or  defined  in the termcap or
  290.                    terminfo file.
  291.  
  292.        -u {vimrc}  Use the commands in the file {vimrc} for  ini-
  293.                    tializations.   All  the other initializations
  294.                    are skipped.  Use this to edit a special  kind
  295.                    of  files.   It  can  also be used to skip all
  296.                    initializations by  giving  the  name  "NONE".
  297.                    See ":help initialization" within vim for more
  298.                    details.
  299.  
  300.        -U {gvimrc} Use the commands in the file {gvimrc} for  GUI
  301.                    initializations.   All  the other GUI initial-
  302.                    izations are skipped.  It can also be used  to
  303.                    skip  all  GUI  initializations  by giving the
  304.                    name "NONE".  See ":help gui-init" within  vim
  305.                    for more details.
  306.  
  307.        -V          Verbose.   Give messages about which files are
  308.                    sourced and for reading and writing a  viminfo
  309.                    file.
  310.  
  311.        -v          Start Vim in Vi mode, just like the executable
  312.                    was called "vi".  This only  has  effect  when
  313.                    the executable is called "ex".
  314.  
  315.        -w {scriptout}
  316.                    All  the characters that you type are recorded
  317.                    in the file {scriptout}, until you  exit  Vim.
  318.                    This  is useful if you want to create a script
  319.                    file to be used with "vim -s"  or  ":source!".
  320.                    If the {scriptout} file exists, characters are
  321.                    appended.
  322.  
  323.        -W {scriptout}
  324.                    Like -w, but an existing file is  overwritten.
  325.  
  326.  
  327.  
  328.                          1998 December 28                       5
  329.  
  330.  
  331.  
  332.  
  333.  
  334. VIM(1)                                                     VIM(1)
  335.  
  336.  
  337.        -x          Use  encryption  when  writing  files.    Will
  338.                    prompt for a crypt key.
  339.  
  340.        -Z          Restricted mode.  Works  like  the  executable
  341.                    starts with "r".
  342.  
  343.        --          Denotes  the  end  of  the options.  Arguments
  344.                    after this will be handled  as  a  file  name.
  345.                    This  can  be  used  to  edit  a filename that
  346.                    starts with a '-'.
  347.  
  348. ON-LINE HELP
  349.        Type ":help" in Vim to get started.  Type ":help  subject"
  350.        to  get  help  on a specific subject.  For example: ":help
  351.        ZZ" to get help for the "ZZ" command.  Use <Tab> and CTRL-
  352.        D to complete subjects (":help cmdline-completion").  Tags
  353.        are present to jump from one place  to  another  (sort  of
  354.        hypertext  links,  see  ":help").  All documentation files
  355.        can be viewed in this way, for example ":help syntax.txt".
  356.  
  357. FILES
  358.        /usr/local/lib/vim/doc/*.txt
  359.                       The  Vim  documentation  files.  Use ":help
  360.                       doc-file-list" to get the complete list.
  361.  
  362.        /usr/local/lib/vim/doc/tags
  363.                       The tags file used for finding  information
  364.                       in the documentation files.
  365.  
  366.        /usr/local/lib/vim/syntax/syntax.vim
  367.                       System wide syntax initializations.
  368.  
  369.        /usr/local/lib/vim/syntax/*.vim
  370.                       Syntax files for various languages.
  371.  
  372.        /usr/local/lib/vim/vimrc
  373.                       System wide Vim initializations.
  374.  
  375.        /usr/local/lib/vim/gvimrc
  376.                       System wide gvim initializations.
  377.  
  378.        /usr/local/lib/vim/optwin.vim
  379.                       Script  used  for the ":options" command, a
  380.                       nice way to view and set options.
  381.  
  382.        /usr/local/lib/vim/menu.vim
  383.                       System wide menu initializations for  gvim.
  384.  
  385.        /usr/local/lib/vim/bugreport.vim
  386.                       Script  to  generate  a  bug  report.   See
  387.                       ":help bugs".
  388.  
  389.        /usr/local/lib/vim/filetype.vim
  390.                       Script to detect the type of a file by  its
  391.  
  392.  
  393.  
  394.                          1998 December 28                       6
  395.  
  396.  
  397.  
  398.  
  399.  
  400. VIM(1)                                                     VIM(1)
  401.  
  402.  
  403.                       name.  See ":help 'filetype'".
  404.  
  405.        /usr/local/lib/vim/scripts.vim
  406.                       Script  to detect the type of a file by its
  407.                       contents.  See ":help 'filetype'".
  408.  
  409.        For recent info read the VIM home page:
  410.        <URL:http://www.vim.org/>
  411.  
  412. SEE ALSO
  413.        vimtutor(1)
  414.  
  415. AUTHOR
  416.        Most of Vim was made by Bram Moolenaar, with a lot of help
  417.        from others.  See ":help credits".
  418.        Vim  is  based on Stevie, worked on by: Tim Thompson, Tony
  419.        Andrews and G.R. (Fred) Walter.  Although  hardly  any  of
  420.        the original code remains.
  421.  
  422. BUGS
  423.        Probably.   See ":help todo" for a list of known problems.
  424.  
  425.        Note that a number of things that may be regarded as  bugs
  426.        by some, are in fact caused by a too-faithful reproduction
  427.        of Vi's behaviour.  And if you think other things are bugs
  428.        "because Vi does it differently", you should take a closer
  429.        look at the vi_diff.txt file (or  type  :help  vi_diff.txt
  430.        when  in  Vim).   Also have a look at the 'compatible' and
  431.        'cpoptions' options.
  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 December 28                       7
  461.  
  462.  
  463.