Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Experimental Operation of ​ Redhat Linux Virtual Machine about Vim

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

This is the virtual machine I built myself. The command in shell starts [rht-vmctl strat workstation] directly, and workstation is the virtual machine I built.

The first is the vim operation:

Vim is divided into three modes: command mode, insert mode and exit mode.

Use [vim file name] to open the file to be edited, [I] enter insert mode, launch [Esc] when finished, and finally [: wq] save and exit.

"what is explained is that the final exit vim is divided into several other modes. [: Q] only exit, [: Q!] does not save editing content forced exit, [: wq!] permission allows forced editing and saving of read-only files."

[: set] parameter settings are divided into temporary vim, current user's personal parameter settings [vim ~ / .vimrc], and full-user parameter settings [vim / etc/vimrc].

[/ character] can perform a character search, [n] look down for the searched characters, [N] look up for the searched characters, and [: number] the cursor moves to a specific number of lines.

Vim character management, divided into copy "[yl] copy current character, [yw] copy current word, [yy] copy current line", delete "[dl] delete current character, [dw] delete current word, [dd] delete current line", cut and paste "[cl] cut and paste current character, [cw] cut and paste current word, [cc] cut and paste current line", [p] paste, [u] undo, [Ctrl r] return revocation.

Visual mode operation, [Ctrl v] enters visualization mode, moves the cursor up and down the selection, then [I] goes in and out of editing, and then [Esc] exits, and the edited content is applied to the selected line.

Split screen operation: [Ctrl w] [s] or [ctrl w] [v] split screen, use [Ctrl w] plus keys to switch different windows, the content edited in each window will be applied to all windows, and each window can be named and saved separately, [:-sp] can open and edit other files at the same time, [Ctrl w] [c] can close redundant windows after split screen.

In command mode, the cursor moves, [gg] moves to the last line, [G] moves to the front line, and [: number] moves to the specified number of lines.

Shortcut key to enter insert mode: [I] move the cursor to the front of the line to insert, [I] the current position to insert, [A] move the cursor to the last start of the line, [a] insert after the current word, [O] insert a line on the line, [o] insert a row under the line, [S] delete the line insert, [s] delete the word insert.

The above is my summary after learning to edit vim. It may not be very comprehensive, it is purely personal understanding.

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report