There are many articles on the internet about how to configure the. vimrc file to achieve a key in vim to compile, looked more complex. I generally do not have any big program to write, General small program a single c file is OK, so simplified the
Vim/vi Mode of work
First, insert text
Command
Describe
I
Inserts text match either the current character
I
Inserts text at the beginning of a line
A
Add text after the current
6, Vim profile User level: ~/.VIMRC (hidden, directly created) system level/ETC/VIM/VIMRC
Use vim--version to view details GCC related (emphasis) 1, GCC workflow GCC calls other processors to complete the process preprocessing-e (using
In Linux we often encounter coding inconsistencies resulting in garbled display problem, in fact, VIM provides us with a very powerful code conversion commands, including document encoding and display coding.
Enter in VIM: Set fenc= encoding
Ctags CV include header file index
At some point, in order to easily see the definition of the related structure or data type in the header file, we want to delve into the head file, where Vim is not as visible as the various IDE tools under
1, first install Vim (Linux is the Vi,vim is the VI Upgrade enhanced version): sudo apt-get installVim (before executing this command, it is best to configure Ubuntu with a software source and update it so that the version of Vim installed will be a
after adding the following code in. VIMRC, restarting Vim enables you to press TAB to produce 4 spaces:
Set ts=4 (Note: TS is the abbreviation of TabStop, set tab width 4 spaces)Set Expandtab
for saved files, you can use the following method for
After you install VIM, if you have not highlighted it, set the following way:
First, if there is no ~/.VIMRC, create
$vi ~/.VIMRC
Second, switch to insert mode, the following settings directly copied into:
Set AutoindentSet
"Ctags function":
Generate index files for source variables/objects, structures/classes, functions/interfaces, macros, etc. for quick positioning. There are currently 41 languages supported, only for example C + +: Ctags can produce index files of
VIM is the God of editors
1.vimtutor (Vim comes with)2.vim-adventures3.vim Configuration
Set nocompatible
set lines=40 columns=150
set number
set go=
set ruler
syntax on
set ShowCmd
syntax enable
set Background=dark
colorscheme Molokai
set t_co=25
Each time you copy the code, if the code has//such comments are easy to let the format out of the way, the following settings can be avoided this situation.
Cancel Auto indent when pasting code
Vim in the paste code will be automatically indented,
Vim Full-screen plain text editorVim Use1 Vim file namelast-line modecommand----> input a append i insert O open (line break)command----> Last line: w Save: q! do not save exit: Wq Save and exit: N moves to the first line (n refers to a number): Set
1.1 Installing VIMTerminal Input Command InstallationInstalling Vim:yum install vim under CentOSUbuntu installation Vim:sudo Apt-get install vimNote: If you are not prompted for permission at the time of installation, you are need to being root to
ObjectiveAll said that the use of VIM, the programming experience feel silky, but the starting slope is indeed a bit steep, always daunting.I have previously tried vim more than two times, each time because of confusion of its various modes, a
0 indicates the beginning of a line, and $ indicates the endG moves to the end of the line, Ng moves to n rows, GG moves to the beginning[ENTER] jumps to the next line of the current cursor/word down looking for word this wordWord looks up word this
The following error occurred when installing VIM on Fedora today=================================================================Downloading packages:Running transaction CheckRunning Transaction TestTransaction Check
Recently operation a text file more than 30MB, the commonly used editor opens to die. The last use of vim is very smooth. It's a history-tested editor.How to change a space to \ t in vimThis uses the \s feature. The specific command is: \s\
Vim configuration file is VIMRC, location under/etc/vimSet nu--sets the line number, where Nu is the abbreviatedSet autoindent--setting Auto IndentSet ts=4--sets the indentation of the TAB key to 4 spaces, where TS is the abbreviation for TabStop,
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