Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 61882 - Devrel handbook vim instructions need changing
Summary: Devrel handbook vim instructions need changing
Status: RESOLVED FIXED
Alias: None
Product: [OLD] Docs-developer
Classification: Unclassified
Component: Developers HOWTO (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo Community Relations Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-08-26 20:39 UTC by Ciaran McCreesh
Modified: 2004-10-09 00:08 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ciaran McCreesh 2004-08-26 20:39:47 UTC
proj/en/devrel/handbook/handbook.xml?part=2&chap=1 says:

Code Listing 3: Configuring vimrc for ebuild-editing

if (getcwd() =~ 'gentoo-x86\|gentoo-src\|portage')
  set tabstop=4 shiftwidth=4 noexpandtab
endif

This is pretty nasty. It only works if you do "vim foo.ebuild", not if you start vim and then :e foo.ebuild. It also breaks editing multiple files. The better way to do it is:

au BufRead,BufNewFile *.e{build,class} let is_bash=1|setfiletype sh
au BufRead,BufNewFile *.e{build,class} set ts=4 sw=4 noexpandtab

which we already have in the default global vimrc anyway.

For even better results, emerge app-vim/gentoo-syntax and you'll get proper syntax highlighting (including error highlighting for some common mistakes), filetype settings and detection for ebuild and eclass files.
Comment 1 Xavier Neys (RETIRED) gentoo-dev 2004-08-28 13:43:49 UTC
Doc devs can't fix anything in there.
Passing it on to devrel.
Comment 2 Ciaran McCreesh 2004-10-08 07:04:10 UTC
*prod* anyone alive?
Comment 3 Tim Yamin (RETIRED) gentoo-dev 2004-10-08 11:45:02 UTC
Hrm, did not see this bug before. Ciaran, I assume all that is needed is for the "if(get...endif" stuff to be replaced by the new two lines and that's it?
Comment 4 Ciaran McCreesh 2004-10-08 13:01:59 UTC
Well... I'd suggest removing the code listing and stating something like:

--- start ---
The default Gentoo vimrc file (/etc/vim/vimrc) ensures that correct indentation and filetype settings are used for ebuild and eclass files. For better results, including special syntax highlighting for ebuild keywords, emerge app-vim/gentoo-syntax.

On non-Gentoo systems, you can obtain similar results by using the following lines in your vimrc:

au BufRead,BufNewFile *.e{build,class} let is_bash=1|setfiletype sh
au BufRead,BufNewFile *.e{build,class} set ts=4 sw=4 noexpandtab

Or, better yet, by manually installing the gentoo-syntax package (https://developer.berlios.de/projects/gentoo-syntax/). Note that vim 6.3 or later is probably required.
--- end ---

Please rephrase to compensate for my low caffeine levels :)
Comment 5 Tim Yamin (RETIRED) gentoo-dev 2004-10-09 00:08:56 UTC
Added in to CVS (should reach the webnodes in an hour or two, hopefully), slightly edited in a place or two. I left the "probably required" bit out, if you definitely know that it breaks on earlier Vim versions then just please reopen this bug and I'll add that in. Thanks!