practical problem: under Linux system, using cat to view text files containing Chinese is normal, but using vim to open it is garbled
Workaround: When you open a text file with Vim, enter it in command mode:
: Set Encoding=utf8
can be solved.
Http://homepage.ttu.edu.tw/u9106240/page_main/vim_menu.html
Enter input mode
Enter the following instruction in command mode, and the program will enter the input (insert) modeThe user can then modify the file,If you want to jump out of the input
Java EE Development of various types of resources download list, the history of the most complete IT resources, personal collection summary.
Vim replacement and batch modification
1 Simple substitution Expressions:%s/four/4/gThe "%" range prefix
Reproduced a VIM plug-in installation strategy
Original source: http://littlewhite.us/archives/212
C + + is the highest proportion of the programming language, and Vim is designed for the programmer to develop the editor, when the combination of
one. Vim
VIM has three modes: Command mode, insert mode, exit mode
its simple introduction please own Baidu, this article mainly introduces the more detailed common and uncommon but important operation
Vim File # #对file进行编辑
Go to command mode by
VI is a strong function of Linux editor, we often use only the tip of the iceberg, as the saying goes: 工欲善其事, its prerequisite. So use VI to create a good environment is very important, the following several articles by chance, reproduced treasures,
The global catalog under Linux and Mac is in the/usr/vim/share/vim directory
• The user's words must be changed ${HOME}/.VIMRC
It is best to configure one individually for each user or for your own users:
First step: Copy the. vimrc file
: ~#
CTRL +F PAGE DOWN CTRL+B Page Down u cancel the last operation u cancel the current line Operation ZZ Saves the current content and exitsGG Jump to the first lineG Jump to last line#gg Jump to # Line:w /root/123~///old/new/find character and replace
1.vim Editor: Command mode, edit mode, extended mode2. Command-line commands:A. Delete cursor line: DD left undo: U Right undo: Ctr+rB. Delete the down n rows (including the current line) where the cursor is located: NDDC. Copy cursor line: YY copy
Original blog: https://www.cnblogs.com/zknublx/p/6058679.htmlAdvanced 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
Vi/vim Powerful editor
command to enter VI
VI filename : Opens or creates a new file and places the cursor at the beginning of the first vi +n filename : Opens the file and places the cursor at the beginning of nth vi + filename :
Set
Description
Set IM
"Sets the mode to enter at startup
Set Magic
The Set Magic
ColorScheme Slate
The Set theme
Set Shortmess=ati
"When it starts, it doesn't
Delete command-delete character before deleting the character: x (uppercase X) Delete the character after the cursor: x (lowercase x)-word: DW Deletes the entire word, the cursor should be at the top of the word-delete the cursor before the string:
The IDE under the Mac is really bad, eventually giving up the IDE ready to use VIM to see the code, then you need to set up vim.Place the home directory below. The VIMRC in Vim is replaced with the following:"Set vundle Settings here"git clone https:
Method One ( the most embarrassing method ):1, display the current line number, in the VI command mode input
: Nu
2, display all line numbers, in the VI command mode input
: Set nu #这是: Shorthand for set number
When using VIM to split the screen, you can enter directly at the terminalvim-on 1.php 2.php 3.phpVertical split screen three filesWhat if you want to open another file in a window?Press ESC, and then press the colon to enterEnter to getOf course I
Call Pathogen#infect () call Pathogen#helptags () Let g:syntastic_always_populate_loc_list = 1let G:syntastic_auto_jump = 1set Numberset encoding=utf-8 "wrap" set textwidth=80 "automatic line wrapping set Wrapnnoremap " Ctrl-j to Move down a split
5.1-5.4vim move cursor copy and pasteYum install-y vim-enhanced InstallationGeneral mode, edit mode, command modeDifferent positions, the color after the CP does not necessarily exist, the color is related to the specific contentmultiple restores
VIM frequently used shortcut keysH-Move the cursor left one character J-Move the cursor down one characterK-Move the cursor up one character L-move the cursor right one character down 15 lines-15jCTRL + F-the screen moves down one page Ctrl +
The previous blog shows how to use Vim to build a C + + development environment on UBUNTU16:Linux base 12Building a C + + IDE with vimThis blog will show you how to use Vim to build a similar C + + development environment on CENTOS7. The two sets of
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.