In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "what commands does the Linux vim Editor have". In the operation of actual cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Brief introduction:
Vim editor is a standard editor in Linux/Unix system, an indispensable editing tool in Linux system, and an upgraded version of vi editor. The use of vim editor will also be involved in the use of Mac system terminal functions.
Most Linux systems come with a vi editor. If you need to install vim yourself, the instructions are as follows:
Sudo apt install vim
The Mac system comes with a vim editor, or you can install it using brew:
Brew install vim
The terminal inputs the vim+ file path or file name to create or open the vim file.
Three modes of vim:
There are usually three modes of vim: general mode, insert mode, and last line mode. This article introduces common operations in general mode.
General mode:
General mode is also called normal mode or command line mode. Whatever it is, this is the pattern you see by default when you enter the vim file. Here, you can use the up and down keys to move the cursor, delete, copy and other operations to deal with file data, but can not insert data freely.
Beginners should not be frightened by the interface which is full of symbols and seems to have no response to anything. in fact, it has its own unique mode of instruction operation.
(note: after creating an empty file, you can press [I] to enter INSERT mode for free input, which is convenient for practice. After the input is completed, press [ESC] to exit INSERT mode and return to general mode)
Copy and paste:
1. By character:
Enter the character [v] (lowercase) in general mode to enter VISUAL by character selection mode, move the cursor through [h, j, k, l] or direction keys to select the string to be copied, then press y to copy, move to the target and press p to paste.
2. By line:
Enter the character [V] (uppercase) in general mode to enter VISUAL LINE select by line mode, select the line to copy, press y to copy, press p to paste
3. Press the block:
Enter the character [ctrl+v] (uppercase) in general mode to enter VISUAL BLOCK by block selection mode, select the block range to copy, press y to copy, press p to paste
Move the cursor
G: move the cursor to the beginning of the last line
NG: move the cursor to the beginning of the nth line
Gg: move to the beginning of the file, which is equivalent to 1G
0: move the cursor to the beginning of the line
$: move the cursor to the end of the line
W or e: the beginning or end of the next word
Ctrl+b: previous page
Ctrl+f: the next page
Find
/: look from top to bottom
?: look from the bottom up
N: find the next place
Shift*: quickly finds the word where the current cursor is located
Modify:
R or R: replaces the current cursor character (R enters REPLACE mode)
J: merge the upper and lower lines
> or
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.