Your message dated Wed, 24 May 2006 10:31:39 -0400
with message-id <[EMAIL PROTECTED]>
and subject line Bug#368698: Started as vi sources .vimrc and warns about 
unknown configuration syntax
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: vim
Version: 1:7.0-017+4
Severity: normal

Hi,

I have copied the following line from /etc/vim/vimrc into my .vimrc:

" Uncomment the following to have Vim jump to the last position when
" reopening a file
if has("autocmd")
  au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
      \| exe "normal g'\"" | endif
endif

If I start vim as vim everything works as expected. If I start vim as
vi I get the following warning:

Error detected while processing /home/kai/.vimrc:
line   11:
E10: \ should be followed by /, ? or &
Press ENTER or type command to continue

Is this the expected behaviour? Is starting vim as vi different in
upstream or is this a Debian addition?

If I read about "compatible" in the vim-help I could not find a
information. The help says: If a .vimrc is found it always
starts in compatible mode.

Summarize: If vim is started as vi it also reads .vimrc which could lead
to warnings and errors about unknown syntax (and maybe options, too --
did not try that).


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16-1148306385
Locale: LANG=C, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)

Versions of packages vim depends on:
ii  libc6                        2.3.6-9     GNU C Library: Shared libraries
ii  libgpmg1                     1.19.6-22   General Purpose Mouse - shared lib
ii  libncurses5                  5.5-2       Shared libraries for terminal hand
ii  vim-common                   1:7.0-017+4 Vi IMproved - Common files
ii  vim-runtime                  1:7.0-017+4 Vi IMproved - Runtime files

vim recommends no packages.

-- no debconf information


--- End Message ---
--- Begin Message ---
On Wed, May 24, 2006 at 11:09:09AM +0200, Kai Weber wrote:
> Hi,
> 
> I have copied the following line from /etc/vim/vimrc into my .vimrc:
> 
> " Uncomment the following to have Vim jump to the last position when
> " reopening a file
> if has("autocmd")
>   au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
>       \| exe "normal g'\"" | endif
> endif
> 
> If I start vim as vim everything works as expected. If I start vim as
> vi I get the following warning:
> 
> Error detected while processing /home/kai/.vimrc:
> line   11:
> E10: \ should be followed by /, ? or &
> Press ENTER or type command to continue

As mentioned under ":help E10", this is because vi-compatible mode
doesn't understand line continuations.  Here are a few ways you can
avoid this error:

1) Remove the 'C' flag from 'cpoptions' so that line continuations are
   recognized.  "set cpoptions-=C"
2) Do not break up the command onto multiple lines.
3) Add "set nocompatible" to the top of your ~/.vimrc

> Is this the expected behaviour? Is starting vim as vi different in
> upstream or is this a Debian addition?

Yes, this is expected behavior.  They vim-tiny package will be an editor
in the base system.  Since it provides an alternative for vi, it was
deemed that invoking Vim as vi should have it behave as much like vi as
possible.  This would cause the least amount of surprise to people that
expect vi to be vi-like.  It is Debian specific since we had to patch
Vim to read the virc file.  If you do not like this behavior, the simple
solution (aside from typing vim instead of vi) is to add a shell alias
so that vi invokes vim.

> If I read about "compatible" in the vim-help I could not find a
> information. The help says: If a .vimrc is found it always
> starts in compatible mode.

I think you meant nocompatible here and the help is a little misleading.
The way it actually works is if a .vimrc is found AND the compatible
option hasn't been explicitly set, then Vim will start in nocompatible
mode.  If the option is explicitly set (e.g., in /etc/vim/virc) then
that takes precedence.

> Summarize: If vim is started as vi it also reads .vimrc which could lead
> to warnings and errors about unknown syntax (and maybe options, too --
> did not try that).

Unknown syntax is a possibility, but it's possible to write everything
in a way that can be parsed in compatible mode.  All options are
recognized regardless of which compatibility mode is being used.

James
-- 
GPG Key: 1024D/61326D40 2003-09-02 James Vega <[EMAIL PROTECTED]>

Attachment: signature.asc
Description: Digital signature


--- End Message ---

Reply via email to