Advanced usage of VIM

Source: Internet
Author: User

1:vim Three mode command mode insert mode command extension mode

The 2:vim registers have 26 named registers and a nameless register

"TP paste" "Ayy Sticky to register a

YY non-specified registers

2: Open file in binary mode

Vim-b Binaryfile

%! Xxd into hexadecimal extension mode-R returns to binary file

V for character v line Ctrl +V Select data Block

3: Multi-file mode

Next jumps to the next file prev back to the first file

Wqall quit all Wall Save All

4: Use multiple Windows ctrl-w down ARROW key down

Ctrl +w+s +o Cancel all windows

5: Show Red's color

CTRL +y input into VIM mode

Hexdump Viewing hex files

>> > Expansion < indentation

6: Extended mode: Set Nember (n u) plus line number set Nono Cancel line number

~/.VIMRC VIM configuration File set IC ignores case

Set Noic do not ignore case set AI automatically and last line alignment Noai cancel

Set Si smart indent nosi cancel syntax on syntax highlight off remove highlight

Set list View tab and $

7:set Fileformat=unix enable UNIX format set Ff=dos|unix shorthand

Set cul add line set paste Preserve original format

Disable the front Plus no

8:set Show current options Help list vim

9: Specification of scripts

The scripting code has a convention.

The first line is typically the language used for the call

Program name, avoid changing the file name to not find the correct file

Version number

The time after the change

Author related information

The role of the program, and precautions

Finally, a brief description of each version of the update

10:vim Mode Conversion

Insert mode-esc-> Command mode

Command mode-:---> Extended command mode

Extended Command mode--esc,enter-I command mode

11: Editing binary files

Open file Vim-b bin in binary mode

Extended command mode, using%! Xxd converted to a readable hexadecimal

Edit binary file extension command mode, with%! Xxd-r back into binary

Press QW to save the exit

12: Visualization Mode: v is copied or deleted as a block in the case of a character that is not moving. V can be deleted or copied as a block in a row

Tap ESC to toggle Mode

13: Multi-file Mode: Next Next prev

First one last wall save all Qall quit all

Wqall Save and exit

14: Use multiple windows

Multi-file Segmentation: Vim-o horizontal Split-O vertical Split

Single File segmentation: Ctrl+w,s horizontal split Ctrl+w,v Vertical segmentation

Ctrl+w,q Cancel adjacent window ctrl+w,o cancel all windows

Wqall exit

14: Extended mode: Set no plus line number set Nonu remove line number

The row number is set to a permanent configuration file: Global:/ETC/VIMRC

Personal: ~/.VIMRC Auto indent: Enabled: Set AI

Disabled: Set NOAI ignores character casing: Set IC set Noic

Do not ignore

Set shows some of the commands that are currently being selected Vimtutor is a few manuals, you can open it without any relationship.

Extended mode

Q Exit q! Force exit, discard the modifications made

Wq Save exit X Save exit

Command mode

ZZ Save exit ZQ do not save exit


Advanced usage of VIM

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.