Jansen of Lorkeers, Richard wrote:
Hello,

I am a beginning user of vim and I just tried to create a .vimrc file. It is
oke when I use 1 command but if I use two commands I get a error. Any one
knows what the problem is. I can't find it in the documentation and neither
in the example.

Richard



For ":set" and friends, omit the verb:

        :set nobackup writebackup

For most commands, separate them with a | bar:

        :if &tenc == "" | let &tenc = &enc | endif | set enc=utf-8

Some commands see the bar as part of their arguments, see ":help :bar". If you still want to use another command on the same line, wrap the first one in an ":exe[cute]" command (see ":help :exe").

In most cases though, one command per line is the way to go:

-----8< ~/.vimrc -----
set nocompatible
if has("multi_lang")
  if has("unix")
    language messages C
  else
    language messages en
  endif
endif
runtime vimrc_example.vim
filetype indent off
set autowriteall nobackup writebackup
if has("wildmenu")
  set wildmenu
endif
if has("gui_running")
  if has("gui_gtk2")
    set guifont=B&H\ LucidaTypewriter\ 12
  elseif has("gui_kde")
    set guifont=B&H\ LucidaTypewriter/12
  elseif has("x11")
    set guifont=*-lucidatypewriter-medium-r-normal-*-*-160-*-*-m-*-*
  else
    set guifont=Lucida_Console:h12:cDEFAULT
  endif
  winpos 0 0
  set lines=9999 columns=9999
endif
if has("multi_byte")
  if &termencoding == ""
    let &termencoding = &encoding
  endif
  set encoding=utf-8
endif
----->8-----
etc.


Best regards,
Tony.

Reply via email to