Bug 623654

Summary: vi (vim-minimal) chokes on .vimrc
Product: [Fedora] Fedora Reporter: Clemens Buchacher <drizzd>
Component: vimAssignee: Karsten Hopp <karsten>
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: karsten, psabata, scott
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 603151 Environment:
Last Closed: 2011-05-18 11:43:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Clemens Buchacher 2010-08-12 12:53:17 UTC
vi from the vim-minimal package is trying to read ~/.vimrc, but complains because it contains vim-specific commands. In my case, output looks like this.

$ /bin/vi
Error detected while processing /home/drizzd/.vimrc:
line   63:
E488: Trailing characters: ^I0put!=line_empty . line_file . line_empty . line_copy . line_empty
line  103:
E488: Trailing characters: ^I0put!=header
Press ENTER or type command to continue

Comment 1 Petr Ĺ abata 2011-05-18 07:23:10 UTC
/bin/vi really acts strange after reading some of my options in .vimrc, making it quite annoying/unusable editor...

Comment 2 Karsten Hopp 2011-05-18 11:43:45 UTC
Works for me, so it looks like you're using a custom .vimrc that doesn't have the necessary checks if a feature is supported.

You need to enclose the offending part of our .vimrc with a feature check so that /bin/vi doesn't try to use it.
A check looks like this:

if has("cscope")
  set csprg=cscope
  ....
endif

You can get a list of feature names that you can use here with :help feature-list

If that still doesn't help, reopen this bugzilla and attach your .vimrc, please

Comment 3 Clemens Buchacher 2011-05-18 17:48:04 UTC
This is a minimal .vimrc that will reproduce my particular problem: (This was part of a function body in case you are wondering.)

put='hi'

IMO it makes no sense for vim-minimal to even try to read a file called .vimrc. There is already a mechanism in the package to not read /etc/vimrc (it's replaced with /etc/virc). I believe the same should apply to the user specific configuration file.