When we use VI or vim, if we want to display the row number, we may do this: switch to the command mode, enter SET Nu, and then press the Enter key to display it; and we are writingProgramSometimes, when you want to press the Enter key, the cursor
ArticleDirectory
Replace the _ vimrc file in the installation directory with the following code:
Replace the _ vimrc file in the installation directory with the following
Code You can:
Set nocompatiblesource $
In Vim (1) and VIM (2), the concepts of the mode in vim and some simple text editing commands are introduced, such as the movement of the optical mark, selection, copying, cutting, and pasting of the editing area. Next, I would like to introduce how
In the past few days, I will talk to my colleagues about the basic use of vim and record relevant information here.
This communication should be divided into several parts
1. What is Vim?
2. vim and Emacs
3. Why Learning Vim?
4. Comparison
1. Installation Steps
1) download the installation package [1]
2) copy the plug-in to the plugin directory.
My options are:/usr/share/Vim/vim73/plugin.
3) edit the vimrc File
My directory is at:/etc/vimrc
"F4 quick format JSCode
Nnoremap
1) Some Common Vim configurations, in ~ /. Syntax on in vimrc supports syntax highlighting set nu to display row numbers
Set Nonu does not display the row number set AI sets automatic indent set shiftwidth = 4 sets automatic indent 4 spaces,
Automatic Configuration using scripts
Or this convenient, http://code.google.com/p/vimide/, 1 minute to get .... Recommended...
Http://code.google.com/p/vimide/
Self-asynchronous Configuration
Although it is slow, you can understand the
1. Configuration File Location/etc/Vim/vimrc
2. Change the configuration
set nocompatible does not use the VI default keyboard layout. If not configured, in edit mode, press the arrow key to enter characters. set nu display row number set
Vim allows you to place custom tags in the text. Run the "Ma" command to mark the current cursor position with. You can use 26 tags (A to Z) in the text ). These tags are invisible, but they are only remembered by VIM.
To jump to a tag you defined,
1. Use the * Key to search for words at the cursor position. Otherwise, you can use the # key to search for words at the cursor position forward. After you use * or # For the first search, you can use N or shift-N to continue the search.In addition,
On the Linux server, VIM is used to editing configuration files and programming.
Generally, you need to configure the vim environment on your own to get a new server. Otherwise, you may not feel comfortable.
Vim initial configuration file
I think Vim is a powerful text editing software because it supports function expansion in the form of plug-ins (plugin. Many Vim enthusiasts write plug-ins to implement the required functions and customize their own vim. Vim supports the following
1. Enter Vim to automatically open winmanager
This function is optional and can be set in vimrc:
"Winmanager is automatically enabled when you enter vim.
Let G: autoopenwinmanager = 1You can enable winmanager automatically.In winmanager. Vim,
I have introduced some Vim plug-ins before. There are two plug-ins that are convenient for iOS writing.Program, That is, cocoa and objc_matchbracket (hereinafter referred to as objc_mb ). The cocoa plug-in is mainly used to complete the API name of
: Ls list the buffer list
: Buffer #Open the file in the corresponding buffer area code: Bnext: Bprevious: Bfirst: Blast
: PwdShow Current Directory
: CD directory nameChange current directory
: E file nameCreate a file in the current directory
VimCodeFoldYou can use the "foldmethod" option to set the vim code folding method, for example, set foldmethod = indent.
There are 6 Ways to collapse the code
1. Manual // manually define the folding2. indent // fold with indentation3. expr //
Run the vim command:
Vim filename: open or create a file and place the cursor at the beginning of the first line VIM + N filename: open the file and place the cursor at the beginning of line N VIM + filename: open the file and place the
Download and install python.
Download Vim from the vim website.Self-installing executable.
Edit the vim configuration file _ vimrc
Copy the stuff in vimrc_example to _ vimrc
Remove source $ vimruntime/vimrc_example.vim from _ vimrc.
Set Chinese
In vim, I introduced the concept of mode in vim and how to move the cursor in VIM in multiple ways. This section describes copying, cutting, pasting, undo/Redo, and search operations. Let's get started!
1. Copy, cut and paste
Copy, cut, and paste
In Windows, many people use source insight to write and view code. Vim can be used in Linux. At the beginning, VIM is considered as a notepad in windows. If it is used properly, it is not inferior to source insight. Here, I will do my best 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.