photo
Jordan Sissel
geek

Fri, 24 Oct 2003

vim - indenting

So rather than start writing my own indent function, I decided to read more about cindent. The option, cinoptions, lets you tell vim how to react to things. What I was looking for was:
When I am typing a function call, and break the line because it's too long, I'd like the new line to start aligned with the open parenthesis, like this:

System.out.println("Hello there, how are you? kthx." + 
                   "Java is fun");
		   ^

I want vim to automatically indent to the column position marked by the caret, ^ - Turns out vim has this functionality already (duh, it has almost evrything).

:set cinoptions=(0

This, when cindent is enabled, will cause vim to auto indent to match your parentheses usage.

Comments: 0 (view comments)
Tags:
Permalink: /productivity/80
posted at: 09:56


0 responses to 'vim - indenting'


Leave a reply

You need javascript enabled to use this form. Anti-spam efforts ongoing. Also, if the comment doesn't show up, it's because the form expired. Go back and copy your comment, reload the form, and resubmit. Apologies if this is a hassle, I'm just playing with antispam methods right now. If this insists on not working, please email me about it.

Name (required)
E-mail (optional, if you want me to be able to email you back)
URL (also optional)
Comment:


Search this site

Navigation

Metadata

Home About Resume My Code (SVN)

Articles

ARP Security Dynamic DNS with DHCP OpenLDAP+Kerberos+SASL PPP over SSH SSH Security: /bin/false Week of Unix Tools Work Efficiency

Projects

fex firefox tabsearch firefox urledit grok keynav liboverride newpsm (FreeBSD) nis2ldap pam_captcha poor man's backup Solaris audio utility xboxproxy xdotool xmlpresenter xpathtool misc scripts

Presentations

Yahoo! Hack Day '06 Unix Essentials Vi/Vim Essentials

Tag Cloud

Calendar

< October 2003 >
SuMoTuWeThFrSa
    1 2 3 4
5 6 7 8 91011
12131415161718
19202122232425
262728293031 

Friends

BarCamp Kent Brewster Tantek Çelik John Resig Wesley Shields Tyler Shields

Technorati