VIM Installation:
The code is as follows
Copy Code
# yum-y Install vim*
Vim usage
The choice of text, for the editor, is a very basic thing, is often used, summed up as follows:
V starts at the current
Using 4-Space tab in most files, a true 8-width tab is used in Makefile, and colleagues are automatically indented based on the type of file.
Edit
Vim ~/.VIMRC
If the file does not exist new, the file already exists, append to the tail
Add to
Linux is often encountered with vim edited the file, save when prompted the current file is read-only.
E45: ' readonly ' option is set (add! To override)
The reason is also simple, because the user does not have write permission to the currently
First, the preparatory work before installing VIM7.4
1
The code is as follows
Copy Code
Apt-get Update
Problem encountered:W: The key for the following ID does not have a public key available:8b48ad6246925553
A detailed introduction to VIM coding
Vim, like all popular text editors, is a good way to edit a variety of character-encoded files, including, of course, popular Unicode encodings such as UCS-2 and UTF-8.
Vim has four options related to
Vim is the most famous text/code Editor on Linux systems, and the enhanced version of the Vi editor in the early years, and GVim is its Windows version. Its biggest feature is the full use of keyboard commands for editing, while leaving the mouse to
First, the current file name
We know that Vim has 48 registers, where the current file path is kept in the% read-only registers. For example /home/harttle/ , at the bottom open src/main.cpp , we print the% value:
: Echo @% file path
Before you start writing plug-ins, you need to verify that Vim supports Ruby by using the following command to identify:
$ VIM--version | grep +ruby
If the output is empty, your current vim does not support Ruby, you need to recompile,
Let's give you a description of the problem.
Reinstalling the Ubuntu system and installing Vim has the following problems:
sudo apt-get install vim
Reading Package List ... Complete
Analyzing Dependency tree for Package
Reading status
First, vim updates to the latest version yum -y install vim , and install Vim's enhanced version vim-enhanced to install support color componentsyum -y install vim-enhanced
Second, configure the Vim configuration file to vi /etc/vimrc add a
FRM: http://www.linuxidc.com/Linux/2013-05/84031p2.htm
Learn about the three basic modes of VIMWhen we finish installing an editor, we will definitely open it and then enter something in it, but after you open vim, you want to enter something
There are two ways to set the VIM editing environment configuration:1, is set in/ETC/VIMRC, this setting method will function with all users logged into the Linux environment. It is not recommended.2, create a. vimrc file in the ~ directory where
Noremap Non-recursive mode (recursive mode refers to map a C if map a B is first and map B c)Nmap Normal ModeVmap Visual modeIMAP INSERT modeCMAP command-line modeOmap operation mode (enter operation mode when the first operation of the input
Vim mode switchingWhen you turn on VIM as the default command mode, do the following to edit:Input IAfter editing, press the ESC key, enter:, enter the last line mode, enter Wq, save to exit, q! Force exit.Common commands: command-line mode
After adding the following code to the. VIMRC, restart Vim to create 4 spaces by pressing TAB:Set ts=4 (Note: TS is the abbreviation for TabStop, set tab width 4 spaces)Set ExpandtabFor a saved file, you can use the following method to replace the
Environment: Window can be used Gvim editing software learning is mainly in the UBUNTU15 percussion commandLearn videos from Zhipu education vim using video1. sudo apt show vi to view the installed version of VI, of course, my Ubuntu two can see the
Original address: http://www.libenfu.com/vim-shortcut key Finishing
As a back-end code farming, the most commonly used is vim , then vim the common shortcut keys, you know how much?Move cursor1. Move left, h right l , Move down, move j upk2.
Originally did not want to write, then think about the benefit of the people who need it, because really admire a key to the author. I know a lot of people can configure their own vim plug-in, but it is estimated that it will play anything for a
In command line mode:% The current complete file name%: H indicates the header of the file name, that is, the file directory. For example, ../path/test. c will be ../path%: The end of t file name. For example, ../path/test. c will be test. c%: R
As follows:Because UTF8 encoding is set, vim always garbled when displaying the error message of the VC compiler.Check the quick fix help and find a ready-made solution:"Compiler information transcoding The code is as follows:Copy code Function!
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.