How to move one word left in vi editor

久未见 提交于 2019-12-02 13:49:18
Wazery

use b to move back one word

use w to move forward one word

and here is a cheat sheet that might be useful for you

Source: http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html

It's b.

You can see other motions here:

http://vimdoc.sourceforge.net/htmldoc/motion.html#word-motions

Generally a Vim command is consisted of

count action motion

Where:

count is number of times you want it to execute, default is 1

action is obviously an action: d for delete, c for change, default is empty and it means simply move

motion is the direction, you got that already

In addition to the b movement mentionned in the other answers, another movement which may be interesting is ge.

It brings you to the last letter of the word on the left. When b is considered as the opposite of w, ge can be considered as the opposite of e which brings you to the end of the current word.

Also note that all of those word-wise movement have a WORD-wise equivalent: W, B, E and gE which are "faster". For the difference between words and WORDS see: :h word.

yes, you can use "b" to backforward a word, and in advance, "2b" to move back 2 words

As the title asks, you want to move left (back). b does it.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!