Reputation: 1141
I have try to use this plugin: http://www.vim.org/scripts/script.php?script_id=1717.
But indented code in GVim(for vim it work as I expected) is not looks as I have expect.
For example when I indent this code:
if { $cond1 != 1 } {
#comment
if { $cont2 != 2 } {
return
} else {
#comment 2
return
}
}
It's become:
if { $cond1 != 1 } {
#comment
if { $cont2 != 2 } {
return
} else {
#comment 2
return
}
}
Is it possible to ignore comments when indenting the code?
For same reason whenever I type #
the cursor position changed to the start of the line.
Upvotes: 1
Views: 335
Reputation: 247210
I have this in my .vimrc, it may help you here
" the following line prevents forcing # to be inserted in column 1
inoremap # X<BS>#
If you use compatible
, then ensure <
is not in cpoptions
: cpoptions-=<
Upvotes: 1