Configuration file path:/ETC/VIM/VIMRC
SYN on; syntax highlighting
Set tabstop=4 tab width
Set shiftwidth=4, line indent width
Set backspace=2, setting backspace available
Set Incsearch Search Auto-complement
Set ai! ; Set Automatic
My knowledge of vim is just a source code editor, used under Linux to edit the program source code or some service configuration files. Recently inadvertently seen in Vim can execute shell commands. The first time to see, to tell the truth feel good
: Network Disk DownloadVim is a rich and powerful text editor, its code completion, compilation and error jump and other convenient programming features are particularly rich, in the programmer is very widely used. Vim can greatly improve the
To move from one file to anotherCopy and paste between different files
Edit another file:edit foo.txt 关闭当前文件,打开指定文件,当前文件未保存会出现错误信息:e! foo.txt 缩写,强制打开指定文件错误有对应的 ID 号, :help E37 查看错误帮助Open multiple files at the same timevi a.ts main.lisp:files
I. Linux BASIC instructions
Find
-name: Search by file name
File Search
When you do not set a parameter, find finds its subdirectories and files in the current directory by default, and displays all
Two steps:1. Remove the annoying VI consistency pattern and avoid some bugs and limitations of previous versionsSet nocompatible2.backspace has several ways of working, which are VI compatible by default. Very unaccustomed to beginners. People who
Vim enters vim on the command line and goes to the VIM editorI press the I key and the lower end shows the--insert--insert commandESC exit I (insert) command for other commands to use: R file name reads into a file content and writes to the current
[VI]VI Editor Command *******************VI Create/edit filename FilePress I to enter insert mode to edit the file.Press ESC to exit insert mode.: W Save: Q exit: Wq Save and exit: q! Force exit (do not save): Set Nu Adds an asterisk to each line
Enter edit mode1, [[email protected] ~]# vi/etc/services2, the input lowercase I and then issued will appear--insert--, you can edit## Each line describes one service, and is of the form:## service-name Port/protocol [aliases ...] [#
Directory
1, vim mode of operation
2. Insert command
3. Positioning commands
4. Delete command
5. Copy and Cut commands
6. Replace and Cancel commands
7. Search and search replacement commands
8. Save and Exit
They are multi-mode editor, the difference is that Vim is the upgrade version of VI, it is not only compatible with all VI directives, but also some new features inside.These advantages of vim are mainly reflected in the following aspects:1.
Vim new starter VIM Advanced Advanced Tutorial vim keying diagram Vim Official document
h or LEFT ARROW key (←) The cursor moves one character to the left
J or DOWN ARROW key (↓) cursor moves down one character
K or Up ARROW key (↑) The
Vim Text EditorWhat is the 1:vim text editor?Vim is a well-known, powerful, highly customizable text editor similar to VI, which improves and adds many features on the basis of VI. Vim is free software. (from Baidu Encyclopedia)2:vim Editing
Say in front--a byte of Vim is the best book I've ever seen about vim, someone who wants to learn about the powerful vim, or someone who is already using VIM and intends to learn more about it, I think I should look at this, the content is refined
1.vim editing process after entering the command lineAbout the edit:A converts the command-line mode to edit mode, with the cursor at the beginning,I insert, O lowercase means go to the next line to edit; Capital O means to go to the previous line
I. Packaging and compression of files1. Vertical merging of files: Cat file1 file2 > File3.txt Overlay MergeCat file1 file2 > File3.txt Append Merge2, File archiving: Packaging many files as a file, the purpose is to facilitate the backup, restore
Step 1: Go to VIM website vim.org, click on the left Download option, select the corresponding installation system Pc:ms-dos and Ms-windows Step 2: Click to download the vim version you want to install, for example I choose to download Gvim80.exe.
For users who often need to switch to Linux/Unix terminals, VI is often used to edit text. EmacsAlthough powerful, it is more steep to learn, and some systems do not have Emacs by default. For those who do not have a lot of attention about VI, maybe
Scenario:
When writing a Python script using vim, the default tab is inconvenient because python is strictly aligned with spaces. We can change the vim configuration file to four spaces when writing a Python script.
Supplement:
You can learn
After struggling, we made a compromise to GBK. All three projects will be based on the GB encoding. I think I will miss the utf8 age in the future. In fact, if you are familiar with the relationship between these encodings and pay more attention to
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.