Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Re: Can't get vim to stop outdenting Perl comments, any ideas?

by rubasov (Friar)
on Jan 14, 2010 at 22:56 UTC ( #817496=note: print w/replies, xml ) Need Help??

in reply to Can't get vim to stop outdenting Perl comments, any ideas?

There are several ways to get vim autoindent your code (set autoindent, set smartindent, set cindent, etc). When I first tried to use autoindenting I also faced your problem with comment outdenting, and later on I found a method to get rid of this "feature". So try this (put this to your .vimrc and comment out any other type of autoindenting)
filetype indent on
Probably this also helps you to get your desired indent level:
autocmd FileType perl set softtabstop=3 autocmd FileType perl set shiftwidth=3 autocmd FileType perl set tabstop=3 autocmd FileType perl set expandtab

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://817496]
[stevieb]: cheers beech. twas totally my mistake, and I got bit. When things work for so long without issue, one becomes complacent (ie. replace we/one with I ;) I've been copy/pasting that around for a few years without a hiccup, so when...
[stevieb]: choroba pointed that out, I was just, you know, *sigh*. In effect, I was lucky and fortunate
[stevieb]: Kind of like my regex-fu went out the window, but only while looking at that specific file ;)

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2017-07-25 23:35 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (383 votes). Check out past polls.