
Resize windows
command :reseze / :res
To set window height to 60
:resize 60
To change the height by increments of 5
:res +5
:res -5
To change window width :vertical resize
:vertical resize 80
:vertical resize +5
:vertical resize -5
key C-w ...
C-w +/C-w -: height +1 / -1 rowC-w </C-w >: width +1 / -1 column
Split window
C-w s/C-w v: split window horizontal / vertical:split/sp [path]/:vsplit/vs [path]: split window horizontal / vertical and open a file optional
Delete window
C-w o/C-w C-o: will delete all other windows
Move between windows
C-w <ARROW>: will move to windowspointed to
Diffsplit
set diffopt+=iwhite: ignore white spacedo: copy from other windowdp: copy to other window]c: 次の差分へ移動[c: 前の差分へ移動
Mark
Normal operations
- Each file can have mark
a–– use a lowercase mark to jump within a file. - There is only one file mark
A–– use an uppercase mark to jump between files.
Regexp
Copy & Paste
- y (yank) d (delete) c (change) すると、その文字列は
無名レジスタに蓄えられます。 "ayyとか"bdwとすると、明示的に a レジスタや b レジスタに書き込みます。- 明示的にレジスタを指定して貼り付ける時は
"apや"bPなどとします。
レジスタを表示
:di:reg
0 レジスタ
y-> 内容1を無名レジスタに格納d-> 内容2を無名レジスタに格納、もともと無名レジスタに格納していた内容1を0レジスタに退避d-> 内容3を無名レジスタに格納、もともと無名レジスタに格納していた内容2を0レジスタに退避 しない
これで、yした内容を"0pで貼り付けできる
dを実行時は、無名レジスタを 退避しない
Highlight
色がなくなったとき
set filetype=c
Search & Rplace
When searching:
.,*,,[,^, and$are metacharacters.+,?,|,&,{,(, and)must be escaped to use their special function./is/(use backslash + forward slash to search for forward slash)tis tab,sis whitespace (space or tab)nis newline,ris CR (carriage return = Ctrl-M = ^M){#}is used for repetition./foo.{2}will match foo and the two following characters. Theis not required on the closing}so/foo.{2}will do the same thing.(foo)makes a backreference tofoo. Parenthesis without escapes are literally matched. Here theis required for the closing).
When replacing:
ris newline,nis a null byte (0x00).&is ampersand(&is the text that matches the search pattern).




近期评论