Open the edited text of Windows under Linux, and there will be an issue with content formatting that is inconsistent with line breaks. The most common is the appearance of ^m.my problem is: in Windows edited files, uploaded to Linux and then opened
Under Linux to do development, or even only to do management and maintenance work, but also the use of vim. As a novice, I am also just in touch, this section of my daily use or collection of vim common commands recorded.Of course, you can learn all
Advanced some of the editor, will contain the macro function, Vim is certainly not missing, the use of macros in Vim is very convenient:: QX starts recording macro and registers the result in register XQ Exit Record mode@x playing macro commands
Configuration path:/etc/Vim/vimrc. This is the vim configuration of the system. If multiple users in a PC use different configurations, create a new one in the user directory. the vimrc file is enough.I currently write the configuration in the
In vim, the tab is automatically converted to a space.In vim, you sometimes need to convert tabs into spaces. Use the RET command (replace tab ).[Range] RET [AB]! [New-tabstop]For example, the tab line from the first line to the end of the file is
Syntax: [ADDR] S/source string/destination string/[Option] global replacement command: % S/source string/destination string/g
[ADDR] indicates the search range. If it is omitted, it indicates the current row.For example, "1st" indicates the number
Vim program editor
1. first introduce the VI Editor
VI is divided into three modes: general mode, edit mode, and command line mode.
Open the file and enter the normal mode.
When you press any letter of "I, I, O, O, a, a, R, R, press [ESC ].
In
Recently, I have re-installed vim and compiled and deployed it to complete the plug-in ycm. The plug-in's completion effect and the error message automatically prompted when writing C code are still very good. I can't help but write it down, you can
I used it a few years ago, but later I became unfamiliar with it. I can't summon up the courage to pick it up again... I have to use it today. Now that I have picked it up, I will record it well.
Introduction and Installation
Ctags is an
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
Nerdtreethe nerd tree allows you to need e your filesystem and to open files anddirectories. it presents the filesystem to you in the form of a tree which youmanipulate with the keyboard and/or mouse. it also allows you to initialize msimple
1. First install the plug-in Manager Pathogen
Install~/.vim/autoload/pathogen.vim
mkdir -p ~/.vim/autoload ~/.vim/bundle && curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vimCreate a. vimrc file in the centos home directory and add:
------------------------------------------------------------------------------------ Gvim has four modes: Normal Mode, insert mode, replace mode, and command mode.
Normal Mode insert mode I/I insert a/A at the beginning of the cursor/line at the
This is the first time I learned how to use the vim editor.
1. First list common shortcut keys
U indicates revoking the previous step.
X indicates deleting the cursor position.
Dd indicates deleting the content of the row where the cursor
Summary of Vim shortcuts and summary of Vim shortcuts
In July, I had to add more than one piece of water each month. Record the simplest shortcut key. (Add a little bit every day)
Alt + 4: move the cursor to the end of the row quickly;
Alt + 6: move
Multi-line comment:
1. Enter the command line mode, press ctrl + v to enter the visual block mode, then press j or k to select multiple lines, and mark the lines to be annotated
2. Press the uppercase letter I and insert the annotator, for example
Sometimes copy and paste the code from the editor to vim, and the code format will be completely messy. The reason is that vim has enabled the smartindent or autoindent mode. To maintain the code format, you can stop the above two modes before
Command history
Commands starting with ":" and "/" have historical records. You can first type ":" or "/" and then press the up or down arrow to select a historical command.Start vim
Enter the following command in the command line window:
Vim
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.