LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] vim's perl mode...

[ILUG] vim's perl mode...

Darragh Bailey felix at compsoc.nuigalway.ie
Wed Aug 18 16:28:24 IST 2004


Quoting kevin lyda <kevin+dated+1093271536.15a773 at ie.suberic.net>:

> so has anyone found a vim perl mode that does auto- indenting/deindenting
> like vim's c mode?  for instance when i type this in vim's c mode:
> 
>     if (drink()) {<ret>tea();<ret>} else {<ret>coffee();<ret>}
> 
> i get:
> 
>     if (drink()) {
>         tea();
>     } else {
>         coffee();
>     }
> 
> however when i do that in perl i get:
> 
>     if (drink()) {
>     tea();
>     } else {
>     coffee();
>     }

cindent seems to work just fine with most perl syntax, not sure whether you use 
the au commands to determine if the file just been opened is perl or not but I 
use the following in my ~/.vimrc
au BufNewFile,BufRead *.pl setlocal cindent

seems to work just fine, although I do need to workout how to get it to use the 
correct tabbing distance. (it still uses 8 when I have it set to 4)

-- 
Darragh

"Nothing's foolproof to a sufficently talented fool"



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell