On Fri, Feb 23, 2007 at 11:36:40AM +0300, Alexey Vakhov wrote:
> I mean If I press enter end next press { system should to understand
> that it is new block and add right bracket also. But if I press Enter
> and start line with another symbol system should do nothing. Thanks
> for :inoremap tip. It's useful )
Try this:
inoremap { <c-r>=getline('.')=~'^\s*$'?"{\<lt>cr>}\<lt>c-o>O":"{"<cr>
It inserts
{
cursor
}

only if the line contains only spaces (is empty)
But this doesn't depend on you pressing Enter.

Marc

Reply via email to