Vim Find replacement: n1,n2s/word1/word2/g N1,n2 is a number, find N1 to N2 line, word1 Replace with Word2: 1, $s/word1/word2/g find the first line to the last row, word1 replace Word2: 1, $s/word1/word2/gc find the first line to the last row, word1
There are several forms of executing shell commands in vim:1):!commandDo not exit vim and execute shell command commands to display the command output in the VIM command area without altering the contents of the currently edited
The command vim can start the VIM editor normally we use Vim in the form of a vim target file path if the target file exists, use VIM to open the file if the destination file does not exist, then create and open the file. Vim has three modes: 1,
1. Install Vim#vim +n filename # #n是数字, you can navigate to the nth row of the file2. Shortcut keysIn the general mode:J down K up H left L rightThe number 0 or shift+6 moves to the beginning of the bankShift+4 move to the end of bank lineGG move to
Vim Wangyunpeng.txt Create a wangyunpeng.txt fileEnter "I" into insert modeDisplay line number, you need to enter ": Se nu" in command modeCp/etc/services/tmp/services Copy the Services file under the ETC directory to the TMP directory name is also
1. Under Vim paste a large piece of Python code, but from a line start all more back a tab, there are more than 100 lines, one by one, I manually adjusted, tired half dead.Solution:In Vim, it's best to go to paste mode before pasting the code, which
Work needs to use VIM for a long time, has been stupid with the mouse point, a good way, today on the Internet to write the basic use of VIM command, for later query use:Switch to Input mode:
Key
Function
I
The console version of Vim is released with Ubuntu, so there is no need to install it. However, if you prefer vim under the GUI interface, please install the VIM-GTK package from the new installation or enter it in the terminal: sudo apt-get install
How to move the cursorh or LEFT ARROW key (←) The cursor moves one character to the leftJ or DOWN ARROW key (↓) cursor moves down one characterK or Up ARROW key (↑) The cursor moves up one characterL or right ARROW key (→) The cursor moves one
vi : visual interface Visual Interface Because we frequently write scripts and configure the server, we need a powerful text editor. Vim:vi improved vi enhanced Vim is a full-screen, modal editor with three modes of VIM mode: Edit mode
Common operations for VimI. Find and Replace in vim
Modify when moving forward:s/str1/str2/Modifies the first str1 of the current line to STR2:s/str1/str2/gModifies all str1 of the current line to STR2
Modify line N to line
The common configuration of all users is in/ETC/VIMRC or/ECT/VIM/VIMRCZ, and there may be other configuration files, such as Vimrc.tiny, which are described in the specific scenario file.Vim configuration for a particular user in ~/.VIMRC
Vim
In vim to edit the code want to copy out to the browser or other places, with YY copied to another place to stick to find that is not the original copy of the content, very headache ...This is because VIM has its own set of Clipboard systems
In vim to edit the code want to copy out to the browser or other places, with YY copied to another place to stick to find that is not the original copy of the content, very headache ...This is because VIM has its own set of Clipboard systems
Original address: Http://blog.csdn.net/AbnerChai/archive/2005/09/03/470824.aspxMove cursorOn: K NK: Move up n rows 9999k or GG can move to the first line G move to the last rowUnder: J NJ: Move Down n rowsLeft: H NH: Move n columns to the leftRight:
Everything has to start with this article.Vim It was a little bit like a sister of Lin. But who would like to have a sister at home, the light of her own girl as illustrated dress is not good, must start from scratch to form a. And even if it really
Installing CygwinSlightly
Install Vim
Configure VIM
Configure vim under Programming and code reading environment
Common configuration
set fenc=utf-8 “设定默认解码set
Vim (multiline comment and delete multiline comment ).--- All in ESC mode:1. Comments in multiple lines in vim.(1) press Ctrl + v to enter the column mode;(2) select to end at the specified position at the beginning of the line to be commented. (Use
Vi and vim Editor (15): main improvements to vi by vim, vivim
Vim has made a lot of improvements to vi. This chapter will discuss the main functions added to vim: includes built-in help functions, startup and initialization options, new mobile
Learn vi and vim editors (3): simple text editing (2), vivim
In the previous article, I will continue to explain some simple text editing commands in the vi editor. This article mainly involves commands such as text deletion, copying, and
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