英文:
Modify Vim section jumping with [[ and ]]?
问题
可以将[[和]]更改为跳到第一列的最近的{或}(默认行为),或者在若干个制表符之后的第一列吗?例如,我希望它对以下两种情况都有效:
function a()
{
}
<tab><tab>*function b()
<tab><tab>*{
<tab><tab>*}
英文:
Is it possible to change [[ and ]] to jump to the nearest { or } in the first column (as it does by default), or in the first column after some number of tabs?
For example, I'd like it to work for both of these:
function a()
{
}
<tab><tab>*function b()
<tab><tab>*{
<tab><tab>*}
答案1
得分: 0
不是真的,文档甚至建议创建自定义映射,就像这样:
nnoremap ]] :call search('^\s*}', 'e')<CR>
nnoremap [[ :call search('^\s*{', 'eb')<CR>
请参阅:help search()
。
英文:
Not really and the doc even suggests making custom mappings, like these:
nnoremap ]] :call search('^\s*}', 'e')<CR>
nnoremap [[ :call search('^\s*{', 'eb')<CR>
See :help search()
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论