Great information Gary. Even though I've used Vim for a number of years 
now, I still know so little about it.

Chris Jean
http://gaarai.com/
http://wp-roadmap.com/



Gary Johnson wrote:
> On 2009-05-15, Gaarai wrote:
>
>   
>> Gary Johnson wrote:
>>     
>>> On 2009-05-15, Chris Jean wrote:
>>>   
>>>       
>>>> I love the auto-indenting feature in Vim. It saves a ton of time when 
>>>> coding. However, there are two behaviors that I do not like.
>>>>
>>>>    1. The auto-indent clears when I move the cursor after creating an
>>>>       auto-indented line (I solved this).
>>>>    2. The auto-indent clears when I press enter to create a new line.
>>>>
>>>> I was able to change the first behavior by adding set cpo+=I. However, I 
>>>> am unable to find a way to disable the second behavior, and it kills my 
>>>> efficiency as I constantly have to go in and manually insert tabs.
>>>>
>>>> Does anyone know a way to prevent Vim from clearing the auto-indent 
>>>> without having to put in a junk character and remove it before pressing 
>>>> enter?
>>>>     
>>>>         
>>> What language are you using?  It could be a deficiency in the indent
>>> plugin for that language, because I don't see that behavior when
>>> using C, sh or plain text.  That is, I can hit Enter as many times
>>> as I want and the indentation level doesn't change.
>>>       
>
>   
>> Thanks for the response Gary. I'm coding in PHP.
>>     
>
> I don't know the first thing about PHP, but I tried editing a new
> foo.php file and I see what you mean.  The indentation is controlled
> by 'indentexpr', which is set to "GetPhpIndent()", which in turn is
> defined in $VIMRUNTIME/indent/php.vim.  The last change to that file
> was made in November, 2008, so it's probably being actively
> maintained.  I'd try contacting the author, whose name and address
> are at the top of that file.
>
> Sorry I can't be of more immediate help.
>
> Regards,
> Gary
>
>
>
> >
>
>   

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to