Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 87866 - vim indent
Summary: vim indent
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Vim Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-03 21:27 UTC by Jason Carlson
Modified: 2005-04-08 19:44 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
new indentation file for php (php.vim,3.78 KB, text/plain)
2005-04-03 21:55 UTC, Jason Carlson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Carlson 2005-04-03 21:27:15 UTC
After emerging the vim editor I wanted it to properly indent my files.  In the /etc/vim/vimrc file, it gives instructions to uncomment the following line to have indentation rules loaded based on the filetype.

filetype indent on

Setting that up does have it parse the $VIMRUNTIME/indent.vim file but it does not seem to go from there and parse the for example $VIMRUNTIME/indent/php.vim file.



Reproducible: Always
Steps to Reproduce:
1. emerge vim
2. uncomment 'filetype indent on' in /etc/vim/vimrc file
3. open a test.php script and start programming

Actual Results:  
Does not indent and move braces as it should (does do any indentation rules at all)

Expected Results:  
It should indent, move braces as typing, etc.  Sort of like cindent does.  

(By the way "cindent" was failing too, I have to use "set cin!")
Comment 1 Jason Carlson 2005-04-03 21:55:16 UTC
Created attachment 55244 [details]
new indentation file for php

Found if I replaced /usr/share/vim/vim63/indent/php.vim with this attached file
(it's the newer version I got from vim website), then this issue goes away.

I had only tested it on a php file, I did a quick check of another filetype and
it seems to be working.

Obviously I was mistaken and it does parse this file, I had put code in the old
file just to test if it took affect and it didn't so I assumed the file was
never loaded.
Comment 2 Ciaran McCreesh 2005-04-05 10:59:46 UTC
I'd prefer not to override upstream-provided vim-core stuff where possible, it gets very messy. You can install this kind of thing into ~/.vim/indent/ to override yourself. If you'd like this one included with the default vim runtime snapshot, it's best to ask upstream, although they don't tend to do major runtime changes during stable releases.
Comment 3 Jason Carlson 2005-04-07 21:16:10 UTC
Thanks for this clear response.  I'm beginning to understand how packages are built and why upstream is usually left in tact.  I have a Fedora box as well and it has the same version of the indent file, yet it worked just fine.  So I wasn't sure at first if this was an upstream thing.  I do realize however that Fedora packages are sometimes heavily customized from the original upstream.

I did not know you could override simply with ~/.vim/indent/  This is very useful information.  Thank you.  Too bad there wasn't a global equivalent for all the users.  

Thanks again for the info. 
Comment 4 Ciaran McCreesh 2005-04-08 17:07:04 UTC
/usr/share/vim/vimfiles/indent is for all users. Still, if the vim-supplied file works with a Fedora vim, I'd expect it to work with ours... Neither of us modify vim too heavily. Do you have identical configuration on each?
Comment 5 Jason Carlson 2005-04-08 19:44:58 UTC
At the start of this problem both boxes had identical ~/.vimrc files on an otherwise default vim installation.  (Also have same ~/.vimrc file on an old RedHat 7.3 box).

At first I could only get them to behave the same if I changed a line that forced cindent on files with php extensions.  Gentoo needed "set cim!" while the other boxes worked fine with "set cindent".

The original .vimrc file I used never tried the "filetype indent on" option (I didn't know about that until reading the /etc/vim/vimrc file on the gentoo box).  I went back and tried it on the Fedora box and it worked without the newer indent/php.vim file but I now realize I still had not pulled out the set cindent from my .vimrc file.  Removing that the behaviour is the same.  So it appears the vim/indent/php.vim file in the default vim distro is faulty.  It doesn't explain however why I needed to use set cim! in the gentoo config instead of set cindent though.

I'm going to contact vim and let them know about the php.vim file needing updating.

I've made a lot of changes to the different ~/.vimrc files on my systems as reading docs I've discovered a lot of my ~/.vimrc file is redundant or obsolete.  If I set them both to use just have the line "filetype plugin indent on" then they both appear to run the same (ie php indentation broken).