跳转到内容
View in the app

A better way to browse. Learn more.

彼岸论坛

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
欢迎抵达彼岸 彼岸花开 此处谁在 -彼岸论坛

[程序员] 求助, vim 相关 (括号跳转)

发表于

vim 中的四个按起来很舒服的键 ,好像是默认按照 C 语言的语法规则来的

[[ ,   ]] ,   [] ,   ][ 

经测试,功能如下:

[[                  # 跳转到上一个行首是{的那一行  
]]                  # 跳转到下一个行首是{的那一行
[]                  # 跳转到上一个行首是}的那一行  
][                  # 跳转到下一个行首是}的那一行

一、问题是我写 java 代码的时候:

  1. { 通常只会在行尾;

  2. } 前可能会有缩进 ;

所以 vim 的默认功能好像不适配...我想问一下是我食用方式不够正确吗?

二、会不会在 ideavim 中会有优化呢? 目前我测试好像和 vim 一样的情况;

三、为了解决这个问题,我配置了:

" 跳转到上一个成员函数开头(光标移动到{那里)
nnoremap [[   [m

" 跳转到下一个成员函数开头(光标移动到{那里)
nnoremap ]]   ]m

" 跳转到上一个成员函数结尾(光标移动到}那里)
nnoremap []   [M

" 跳转到下一个成员函数结尾(光标移动到}那里)
nnoremap ][   ]M

用起来还不错,但是怕会影响其他功能, 所以想问一问有没有其他的优化方式或者插件, 尤其是在 ideavim 里面.

Featured Replies

No posts to show

创建帐户或登录来提出意见

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.