" is the current cursor position):

问题描述 投票:12回答:4
...and I hit enter, I would like to get this:

...while currently, I'm getting this:

$('#something').click(function(){|})

The same thing happens with function definitions in PHP. Is there a way to automatically insert the extra new line and indent the cursor position when hitting enter inside braces like that?

$('#something').click(function(){
    |
})

(Apologies if this has been asked before - it seems like a common request but I searched for awhile and couldn't find it.)

$('#something').click(function(){
|})

For example, if I'm coding jQuery in vim, and I have this in insert mode ("
javascript vim indentation
4个回答
© www.soinside.com 2019 - 2024. All rights reserved.