3. Alternatively, you can also use :x command to save and exit Vim. Simply type :x and press Enter. 如果您不想保存更改并直接退出,请使用以下命令:1. 按下Esc键,确保正处于命令模式;2. 输入:q!,然后按下Enter键。这将强制退出而不保存任何更改。 除了上述方法,你也可以使用其他常用的Vim退出命令:...
(find the match pater and execute a command) global具体自行方法是g/pattern/command :g/abc/p-> 查找并显示出只有abc的行 (only print line with “abc” ) :g/abc/d-> 删除所有有abc的行 (delete all line with “abc”) :v/abc/d-> 这个会把凡是不是行里没有abc的都删掉 (delete all line...
(find the match pater and execute a command) global具体自行方法是 g/pattern/command :g/abc/p -> 查找并显示出只有abc的行 (only print line with “abc” ) :g/abc/d -> 删除所有有abc的行 (delete all line with “abc”) :v/abc/d -> 这个会把凡是不是行里没有abc的都删掉 (delete al...
:wqall -> 保存并退出所有屏 (write and quite all windows) :qall! -> 退出所有屏,不保存任何变动 (quite all windows without save) 开启文件的时候,利用 -o选项,就可以直接开启多个文件在分屏中 (with -o option from command line, it will open files and display in split mode) vim -o a.txt ...
4. Saving and quitting Vim: To save the changes you’ve made to a file and quit Vim, use the following command: “` :wq “` This command will save the changes and exit Vim. If you want to quit without saving, use the following command: ...
command。例如 :%g/^ xyz/normal dd。表示以一个空格和xyz开头的行执行normal模式下的dd命令。 关于range的规定为: 如果不指定range,则当前行。 m,n: 从m行到n。 0: 最开始一行(可能是这样)。 $: 最后一行 .: 当前行%: 所有行 7.3 正则 高级的查找替换就要用到正则。 \d: 表示...
S - delete line at cursor and substitute text (same as cc) xp - transpose two letters (delete and paste, technically) u - undo . - repeat last command Marking text (visual mode) v - start visual mode, mark lines, then do command (such as y-yank) ...
First, press the Esc key a few times. This will ensureviis out of Insert mode and in Command mode. 首先,按几次Esc键。 这将确保vi退出插入模式和命令模式。 Second, type:q!and press Enter. This tellsvito quit without saving any changes. (If you do want to save your changes, type:wqinst...
3.Get back here by executing the command that got you into this tutor. That might be:vimtutor <ENTER> 4.If you have these steps memorized and are confident, execute steps 1 through 3 to exit and re-enter the editor. NOTE: :q! <ENTER> discards any changes you made. In a few lesson...
Exit this tutor as you did in lesson 1.2: :q! Or, if you have access to another terminal, do the following there. 像1.2节一样,退出本教程: :q! 或者,你也可以访问其它的终端,并执行以下几步。 At the shell prompt type this command: vim tutor 'vim' is the command to start the Vim ed...