常用基础Vim命令
2013-08-06 09:30
190 查看
最近学习Ubuntu,时常需要用Vim来查看和编辑文件,整理出下列常用的命令作为备忘录。
完整版的Vim Manual可以在 这里 找到, 也可以在打开vim之后输入命令 “:help” 来查看。
左侧是命令,右侧是简单的命令说明,在左侧的命令中 N一般都代表输入命令前可以输入的数字。
完整版的Vim Manual可以在 这里 找到, 也可以在打开vim之后输入命令 “:help” 来查看。
左侧是命令,右侧是简单的命令说明,在左侧的命令中 N一般都代表输入命令前可以输入的数字。
Move Command
N h | Move to left |
N l | Move to right |
0 | Move to line start |
^ | Move to first non-blank character in the line |
$ | Move to line end |
gm | Move to the middle of the screen line |
N | | Move to column N, default to column 1 |
N k | Move to N lines up |
N j | Move to N lines down |
G | Move to the last line |
gg | Move to the first line |
N % | Move N percentage down in the file, N must be given |
CTRL-F | Page downwards |
CTRL-B | Page upwards |
z<CR> | redraw, current line at top of window |
z. | redraw, current line at center of window |
z- | redraw, current line at bottom of window |
Search Command
/{pattern} | Search forward for the {pattern} |
?{pattern} | Search backward for the {pattern} |
n | Repeat last search |
N | Repeat last search in opposite direction |
* | Search forward for the identifier under the cursor |
# | Search backward for the identifier under the cursor |
Insert Command
a | append text after the cursor |
A | append text at the end of the line |
i | insert text before the cursor |
I | insert text before the first non-blank in the line |
N o | open a new line below the current line, append text N times |
N O | open a new line above the current line, append text N timesjj |
Undo and Redo
u | undo last change |
CTRL-R | redo last undone changes |
U | restore last changed line |
Other
CTRL-G | show current file name with path and cursor position |
ga | show ascii value of character under cursor in decimal, hex and octal |
g8 | show utf-8 encoding: show byte sequence for character under cursor in hex |
g CTRL-G | show cursor column, line and character position |
CTRL-C | during searches: Interrupt the search |
CTRL-W s | split to two window |
CTRL-W j | move to window below |
CTRL-W k | move to window above |
q! | quit vim and discard all changes |
wq | quit vim and save all changes |
w | save changes |
相关文章推荐
- Vim命令#Vim常用基础命令
- linux 目录结构+常用命令+压缩命令+vim使用+及一些基础知识(非常好)
- linux 目录结构+常用命令+压缩命令+vim使用+及一些基础知识(非常好)
- vim基础知识和常用命令
- 基础篇七---vim编辑器常用快捷命令
- linux 目录结构+常用命令+压缩命令+vim使用+及一些基础知识(非常好)
- VIM基础 之总揽最常用的命令
- vim 常用命令【转】
- vim编译器常用命令
- vim常用命令
- vi(vim)常用命令汇总(转)
- vim常用命令技巧及基本配置
- vim常用命令 vim键盘布局
- Linux 系统基础常用命令总结
- Linux下Vim的常用命令
- linux常用基础命令
- linux常用基础命令
- LINUX常用命令(基础)
- vim常用命令
- [Vim] Vim的常用命令