There may still be a lot of people who don't want to use VI/Vim in CLI to write things. However, when you get used to it, its efficiency is immeasurable. The figure below is clear at a glance. From now on, learning is no longer difficult.
Note:
Add the following to. vimrc:CodeAfter that, restart Vim to generate four spaces by pressing tab:Set Ts = 4 (Note: ts is the abbreviation of tabstop, with four spaces in the tab width)Set expandtab
For saved files, use the following method to
Add the following to. vimrc:CodeAfter that, restart Vim to generate four spaces by pressing tab:Set Ts = 4 (Note: ts is the abbreviation of tabstop, with four spaces in the tab width)Set expandtab
For saved files, use the following method to
Configuration File Path:/etc/Vim/vimrc
SYN on; syntax highlighting
Set tabstop = 4; tab width
Set shiftwidth = 4; line feed indent width
Set backspace = 2; Set backspace availability
Set incsearch; Search auto-completion
Set Ai! ; Set
Edit a binary file
Vim can easily edit binary files. I personally think it is easier to edit binary files than Emacs. In vim, the binary file is edited by dumping the file into its binary text format through the external program xxd, and then the
The help entry for the commands used in this section:
:help quickfix:help :make:help 'makeprg':help 'errorformat':help 'switchbuf':help location-list:help grep:help :vimgrep:help :grep:help starstar-wildcard
I used to read martial arts novels and
Vim's learning curve is quite large (see the learning curve of various text editors). Therefore, if you see a lot of VIM command classification at the beginning, you will lose interest in this editor. The following article is translated from "Learn
After entering VI, insert the lower-case "I" key after the cursor; insert the lower-case letter "O" key under the cursor; insert a lower-case letter "a" before the cursor.
For example, to copy 5 rows of data under 6th rows (including), put them
For binary file editing, Windows has a very good software winhex, which will make your life very simple. However, there seems to be no dedicated binary editor in Linux, but don't forget vim.Although Vim is not designed for Binary editing, it also
Let Vim use the Chinese help document
Finishing reprint, original address: http://blog.openrays.org/blog.php? Do = showone & tid = 282
Vim Chinese Document home page is: http://vimcdoc.sourceforge.net /. It translates the Help File of VIM
Multi-File Operations
Vim supports multi-file operations, including two methods:
1. open multiple files at the same time. In normal mode, enter:
: E → open a new file. The current file must be saved.: Buffers → list all open files in current vim.:
Vim-complex repeats
Vim can record your operation combinations into registers, and then call this operation combination through the shortcut key, which is very quick. In normal mode, enter:
Q {0-9a-za-z "} → Q starts recording, {0-9a-za-z"}
In VI/vim, you can use the: s command to replace the string. In the past, we used only one format to replace the full text. Today we found that there are many ways to write this command (VI is really powerful, and there are still a lot to learn).
From http://easwy.com/blog/archives/advanced-vim-skills-vim-gdb-pyclewn/
========================================================== ==============
The help entry for the commands used in this section:
:help pyclewn
In the previous article, we
This article introduces the basic usage of VI (Vim), but it is enough for common users!
The VI editor is a standard editor for all UNIX and Linux systems. It is not inferior to any of the latest text editors. Here we just briefly introduce its usage
Document directory
Search options
Cut/copy/paste
VIM: http://dsec.pku.edu.cn /~ Jinlong/VI/vi.html
Delete a row: dd
Delete the remaining word after a word/cursor: DW
Delete current character: x
Part of the row after the cursor: d $
If you need to temporarily enable it in the editor, follow these steps:
Enable CSS:: Set omnifunc = csscomplete # CompleteCSS
Enable HTML:: Set omnifunc = htmlcomplete # CompleteTags
When auto-enabling is enabled ~ /. Configure in
Some advanced editors will contain macro functions, which are certainly not missing in vim. It is very convenient to use Macros in vim:
: QxStart recording macros and store the results into Register xQ exit record mode@ XMacro commands for playing
* Locate the specified row n:
Enter "nG"
Or enter "ngg"
Or enter ": n"
Here, n is the row number of the specified row. Note that sometimes G = gg* Jump to the top of the screen:
Enter "H"
This is the first non-empty character. Adding a number N
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.