Recently learned the Linux shell, understand the VI editor in the common commands, especially when the configuration file is very long, the use of these commands is very convenient. Here is a brief introduction to some common simple commands.VI Common CommandsH cursor moves one character to the leftL MOVE the cursor one character to the righth in edit page click H (uppercase), the cursor will be moved direc
RedHat 9.0 Linux under the VI Editor for simple paste copy cutting function ":If you want to paste the third line in the file into line 15th:1. Enter your file (in command mode, not edit mode)2. Move your cursor to the beginning of your third line (with the arrow keys)3, press V, (you find switching to Visual mode), press the arrow keys, know what you want to select4. Press Y, and then move the cursor to th
Vim is a well-known, powerful, highly customizable text editor similar to VI, which improves and adds many features on the basis of VI. Vim is purely free software.So a well-configured vim will certainly be more handy to use.650) this.width=650; "src=" Http://img.baidu.com/hi/jx2/j_0036.gif "alt=" j_0036.gif "/> That question came, in the end how to configure it???First open the port (terminal) under Linux
The function of Vim editor in Linux is very powerful, many commonly used shortcut keys are very convenient, here will I learn the introduction of vim some of the commonly used shortcut keys to share to everyone, hope to help you.This is the bird in the book I have done a bit, I hope not to deal with copyright issues.1. Shortcut keys available in general mode: cursor movement, copy and paste, search substitu
In the company, most of the people are remote Connection control server, the following to solve a novice use Xshell when the problem occursSome people use Xshell telnet to the Linux server, and then under the VI Editor to edit things appear by keypad number keys appear in the case of English letters, the solution is as follows:1.650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/7A/36/wKioL1alvQ2wR0
in Linux with vi Edit and modify file configuration without color display file content, especially some keywords can not be color display, to configure our service process caused great inconvenience. "In fact, the main is VI itself without color, vim with color" below gives a solution.
VI Editor code highlighting settings
1, check whether to open highlighting, the general default is open.
2, modify the
In the Linux Editor, nano is used. 1. When will nano be used? Generally, the network is very stuck. When using vim/vi for ssh, the window will die, or the server will crash. 2. how to use it? Open www.2cto.com or create a new file # disable automatic line feed for the nano file name # Save the modified nano-w/etc/fstab by pressing Ctrl + O to exit, press Ctrl + X. If you have not modified the file and accid
Next page: Page Down
Up one page: Page up
To the beginning of the line: Home
To end of line: End
Move to the end of the file: G
Move to file header: GG
The cursor moves down n rows: N
Insert a new line below: O
Insert a new line above: O
Search down Word string:/word
Press N again: Search down
Then press N: Search up
Search for word1 between N1 and N2 lines and replace with Word2:: n1,n2s/word1/word2/g
Search for word1 betwee
to save exitWQ: Force Save exitX: Save ExitX: Encrypt exit after saveW/root/file Save as file in/root/directoryM,n W/root/file saves the M rows in a file to n rows as files in the/root/directorys W >> /root/file append S line to file in/root/directoryR/USR/SHARE/DOC/DHCP-/DHCP + ENTER (writes the DHCP file to the current file)Command mode can be used!! To append instructions,!! Can add any command and parameters afterVim +10 filename navigates to line 10th in the fileVim +/id/file navigates to
Delete 5 before cursor (currently unchanged)5+x Backward Delete of 5W Turn backward in Word (word head)e (end of Word)b Flip forward in wordsHJKL up or downI InsertA next character inserto empty line then insert/+ string (backward) lookup? + String Forward Lookup2+l Jump two columnsy+w Sticky wordsr+ letters replaced with lettersShift+r Overall ReplacementC+w Word Delete mode transform to insert mode: Setnu sets line number: Set Nonu cancel line number:q! Force Exit: vs test1.c split screenTh
word string after cursor"? word" to find word strings before the cursor"/keyword": First press "/", then enter the character you want to find, if the first search for the keyword is not desired, you can always press "n", looking for a keyword. “? Keyword ": Press first?" Key, and then enter the character you want to find, and if the keyword you first searched for is not what you want, you can always press "? , look for a keyword later.10. Replacement charactersS/word1/word2/g find word1 on the
lab building environment/ETC/VIM/VIMRC), can open file for modification, but be careful not to affect the normal use of vim2.7.2 Get the current settingsInput in command line mode: Set or: SE shows all modified configurationsInput in command line mode: Set all displays all SetPoint valuesInput in command line mode: SET option? Display the Set value of optioncommand-line Mode input: Set nooption cancel the current set value2.7.3 description of the Set functionInput in command line mode: Set Auto
First, Mode conversionI: Before the character of the current cursor, replace with input modeA:................ After.........O:............ Line below. Create a new row,I: ... HeaderA:................. End of LineO:................. Above, create a new rowZZ: Edit mode forced exitSecond, the cursor movement1. Move by character:H: LeftL: RightJ: NextK: Up#h: Moving a # character2. Move in Word unitsW: Move to the beginning of the next wordE: Jumps to the ending of the current or next wordB: Jump
Development steps:1. Enter Vim Hello.cppThis is not editable at this time.2. Input I (lowercase, into insert mode)The following becomes the INSERT, which represents the ability to edit the file.3. Press ESC4. Re-enter: (colon)If you want to exit and save, enter WA return, or enter q! carriage return if you exit without saving.5. Compiling the programInput g++ Hello.cpp-o HelloRe-enter./helloCopyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced
Switch to the previous file: Last switch to final file: first to switch to file oneExit: QA All exits17, split screen display a fileCtrl+w,s: Horizontal splitter windowCtrl+w,v: Vertical splitter windowToggle the cursor between windowsCtrl+w, W: QA Closes all windows18. Edit multiple files in a windowVim-o: Horizontal Split displayVim-o: Vertical Split display19. Save some of the contents of the current file as a different file: W: Addr1,addr2w/path/to/some/where20. Populate the contents of ano
DD: Delete the entire row where the cursor is located (common)Ndd:n is a number. Delete the down-n line where the cursor is located, for example, 20DD to delete the 20 line below the cursorD1G: Delete all data from the first row of the cursorDG: Remove all data from the last row of the cursord$: Deletes the cursor to the last character of the lineD0: That is the number 0, which deletes the first character of the line to which the cursor is locatedX,x:x remove one character (equivalent to [del] k
About VI1. VI is a widely used text editing program in a variety of UNIX and Linux systems.2. VI is not a typesetting program, but a purely text-editing program.3. VI is a full screen text editor, it has no menus, only commands.4. VI is not window-based, so this multi-purpose editing program can be used to edit a wide variety of files on any type of terminal.5. vi function is very powerful, but command a wi
filenameWQ filenameSave the file being edited as filename and exit VIQ!Discard all changes, exit VISet NuShow line NumbersOr?Find, enter what you are looking for in/afterNwith/or, if the search is not the keyword you are looking for, press N or backwards (with/to) or forward (with?) to continue looking until you find it.For the first use VI, there are a few notes to remind:1. When you open a file with VI, you are in command mode, and you want to switch to insert mode to enter text. Toggle metho
The following environments are installed and configured based on Ubuntu 10.04.
1. The gedit position is located in/usr/lib/gedit-2/plugins
Third-party plug-ins and custom Plug-ins will be copied to the directory.
2. Install gedit Standard plugin sudo apt-get install gedit-plugins
Basic configuration of 3.gedit
A.edit-> Preferences
B. view:enable Text Wrapping
Don't split words over two lines
Display line numbers (show row number) This is very useful.
Highlight current line highlights when moving
"VI Editor"
Show rows, set number
First, the order to enter VI
VI Tech: Open or create a new file and place the cursor at the beginning of the first line
VI +n TECH: Open the file and place the cursor at the beginning of nth
VI + TECH: Open the file and place the cursor at the end of the line
VI +/pattern TECH: Open the file and place the cursor in the first matching string
Vi-r tech: A system crash occurred during the last edit with VI, Recove
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.