One thing that would also be great, was if you were able to "tab" your way out of it, ie move to the outside of the bracket, once you're done. Now you need to either press right, to move ahead (which is not quite vim-ish), or hit escape and Shift_A, to resume editing.
Only possible way I can think of, is to use a snippet system, like snippetsEmu[1] or something. Any other suggestions? [1] http://www.vim.org/scripts/script.php?script_id=1318 On 4/2/07, A.J.Mechelynck <[EMAIL PROTECTED]> wrote:
Zarko Coklin wrote: > It is hard to expand on Tony's feedback, ever. Still, > I found the following works a bit better. Not only > that it creates a right brace but it also places a > cursor on the right spot (taking into consideration > indentation if you set it). > > > :inoremap { {<CR>}<Up><CR><End> > :inoremap [ []<Left> > :inoremap ( ()<Left> > > Regards, > Zarko Coklin "The right spot" depends on your C coding style: your mapping might apply for if (condition) { statement; statement; } and void function functionname(void* p) { statement; statement; } though it might be better to place <CR> _after_ <End> in the {rhs} to avoid splitting a word in the middle. Mine is better for if (condition) { statement; statement; } and void function functionname(void* p) { statement; statement; } and can still be used for yours, by hitting <Enter> after the mapped { Best regards, Tony. -- Taxes are going up so fast, the government is likely to price itself out of the market.
-- Panos Laganakos