Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I have tried everything I have found in monks supersearch, and all over the web. The suggestions that held the most promise were found at stackoverflow.com, but to absolutely no avail. I have tried so many different things, and so many combinations of different things in my .vimrc file, and none will work.

This problem has frustrated me for so long, and I'm at my wit's end.

To reproduce my woeful situation, one need only open a perl file in vim and type:

sub foo {

.. then hit the carriage return. That automatically indents your code for you, in most default vim installs. Great! That's what it should do! At this point you can start in with your code, which would look something like:

sub foo { my $bar = 'baz';

All is well. Now hit the carriage return again and start a comment. Instantly vim outdents the comment to column zero:

sub foo { my $bar = 'baz'; # some comment

This is exactly what I am so tired of experiencing. The comment should stay, imo, right in line with "my $bar..." at indented column n (where n=three spaces for me).

*Holds back a long string of curses* Please, anyone, can you tell me what I am missing here, and why vim just will NOT allow me to:

sub foo { my $bar = 'baz'; # some comment

Stuck, and so sad in vim indentation hell, I remain...

--
Tommy

In reply to Can't get vim to stop outdenting Perl comments, any ideas? by Tommy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-25 13:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found