I am finding that the default indentation settings used for perl code
are not very intuitive.
After spending some time scourging through help files, google etc., I
arrived at these
autocmd FileType perl set autoindent | set smartindent
autocmd FileType perl inoremap # X ^H#
My question is why are these options not turned on by default? These
would make life so much easier for a novice perl programmer using the
vim editor. Often learning a new language is hard enough... why add
the additional pain of mastering the editor?
There are probably tons of other vim settings that the majority of
perl programmers find useful. But I am not knowledgeble enough to
speak for all of them. In any case turning on the above should be
least controversial, no?
FWIW the default behavior in emacs is very similar to what I get with
the above settings. In fact, emacs does something even better. If a
line does not end in ';' it automatically adds an indent.
For example, if I have
$ emacs parse.pl
sub read_data()
{
a=1
pressing enter takes me here
sub read_data()
{
a=1;
pressing enter takes me here
How can I get similar behavior in vim?
raju
--
Kamaraju S Kusumanchi
http://malayamaarutham.blogspot.com/
--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Saturday, January 3, 2015
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment