Configuring viPlugin Eclipse Plugin for Soft Tabs

I’m not sure I blogged about this or not, but at Christmas my friend Chris Weldon got me a license for viPlugin for Eclipse. It’s a plugin that, like the name implies, makes Eclipse behave like vi. It’s an awesome plugin and it has really increased my efficiency (and use) of Eclipse. I’ve pretty much kicked everything else – except straight vim – to the curb in terms of IDEs for everything other than .NET.

I was getting frustrated though because all my code standards tools look for tabs to be converted to spaces. Eclipse “says” it does this, but it hasn’t really worked, so I went off in Google land to find out if viPlugin could override it. I found exactly what I was looking for in the User Manual that is put in the <eclipse_dir>\plugins\com.mbartl.viplugin.eclipse.layer_<version>\doc\UserManual.html . It gives a great example of how to set up a viPlugin_rc.xml file in the root of your eclipse directory. An example from the documentation is below:

<?xml version="1.0"?>
<xml>
    <shiftwidth>4</shiftwidth>
    <vimcursor>true</vimcursor>
    <ignorecase>true</ignorecase>
    <expandtab>true</expandtab>
    <hlsearch>true</hlsearch>
    <incsearch>true</incsearch>
    <undolevels>1000</undolevels>
    <wordseparators>.,(,), ,TAB,ENTER,:,;,?,+,=,ANGLE_BRACKET_RIGHT,ANGLE_BRACKET_LEFT,*,{,},",|,COMMA,-,\,/,@,[,],},~,!,#,$,%,^,',`,ยด,AND</wordseparators>
</xml>

And that’s it. Soft tabs, shift width of 4, etc.

And since I know Chris will likely read this, his gift is in the mail. Enjoy!

This entry was posted in PHP, Programming and tagged , , , . Bookmark the permalink.

Leave a Reply