Simple to write a text editor, the function is very simple, but enough to the file IO related operations familiar with the possible function or the size of the allocation is not perfect. Please refer to the reference:
#include #include #include #
1. Cursor movement
L
Move one character to the right
H
Move one character to the left
W
Move one word to the right
W
Move right One blank separator word
B
Move one word
situation 1: in CentOS or Debian and other Unix systems, when using VIM to edit the file, input Chinese, Chinese garbled:
#vim/ROOT/.VIMRC
Enter the following configuration:
Syntax on
set fileencodings=ucs-bom,utf-8,utf-16,gbk,big5,gb18030,latin1
Http://blog.sina.com.cn/s/blog_94a93cff0101b5gv.html
To replace text in VIM:1. Replace the contents of the current line:: s/from/to/(S-substitude): s/from/to/: Replaces the first from in the current row with the to. If the current row
Install VIM general instruction: sudo apt-get install vim is done.
But there is: reading the list of packages ... Completing the dependency tree that is analyzing the package is reading status information ... Complete the currently unavailable
One, VIM: is the enhanced version of VI, Visual Interface improved, it is full screen editor, modal editor, text version processing tool.Vim Editor four modes: Edit mode (command line mode), input mode, last line mode, visual mode.Second, vim open
Original: https://www.ibm.com/developerworks/cn/linux/l-cn-vimcolumn/Before you beginThe human brain's processing of words is flat, so we browse articles, find materials, or refactor code, either horizontally or vertically, or use search to make
Vim is the most common type of text editing software for Linux systems, and almost any Linux distribution will install this software by default. Although there are many text editing software for Linux Now, there is no substitute for the power of vim.
June 21 Task5.5 Entering edit mode5.6 VIM Command mode5.7 Vim PracticeExtendedSpecial usage of vim http://www.apelearn.com/bbs/thread-9334-1-1.htmlVim Common shortcut key summary http://www.apelearn.com/bbs/thread-407-1-1.htmlVim quickly deletes a
"%s//second/g"People with vim know that this is to replace all the "most" with the meaning of "second". In fact, Vim's search and replace function is very powerful, good use can greatly improve efficiency.The Find and replace command for VIM is as
VI Common usagedescription, all commands do not include "", If "" "(half-width double quotes), is a command character, please note the distinction. Insert:"I" starts before the cursor positionthe "I" cursor moves to the beginning of the current
Vi/vim is a text editor under the Unix/linux operating system.Due to the nature of unix/linux files, Vi/vim can edit any file in any format.The following are common knowledge points, for informational purposes only:
Editing mode: Vi/vim + file
Method Piece Selection ModeInsert Comment:Enter virtual mode with VUse the up and down keys to select the number of lines you want to commentPress CTRL + V to enter column modePress Capital I into insert mode, enter the comment ' # ' or '//', then
Press I to enter edit modePress I (I in uppercase) to enter edit mode and the cursor jumps to the beginning of the cursor positionPress O to start editing from the next line of the cursorPress O (capital O) to start editing from the previous line on
Vim's commands are too many to forget, so I decided to sort out the various commands of VIM, including vim insertion and deletion, cursor Movement, Multi-window editing, copy-and-paste, find-and-replace, and some common commandsDelete operationDD
Vim, Gedit is a common Linux editor, today we will talk about Vim.Note: Vim is an upgraded version of VI that is not only compatible with all VI directives, but also has some new features in it. Therefore, some time vim, VI will be mixed, sometimes
VI Most original versionVim modified version, more powerfulOpen FileVim file path (command line mode)The command line mode enters edit mode:A append to the current positionI insert forward in the current positiono Edit the next line in the current
Vim is a text editor developed from VI. With color display, code completion, compilation and error jump and other convenient programming features are particularly rich, in the programmer is widely used. To put it simply, VI is an old-fashioned word
Vim command quite a lot, the basis of the preservation, exit, insert, move, etc., trouble points of multi-line selection, split screen and so on.Vim commands are also available in three modes, command mode, edit mode, and bottom line mode. There are
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