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

What is the meaning of vim in linux

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces "what is the meaning of vim in linux". In daily operation, I believe that many people have doubts about the meaning of vim in linux. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "what is the meaning of vim in linux?" Next, please follow the editor to study!

In linux, vim is a text editor developed from vi, which has the functions of code completion, compilation and error jump, and can actively identify the correctness of syntax with font color to facilitate code writing. Vim can run on many operating platforms such as unix, windows, mac and so on.

The operating environment of this tutorial: CentOS 6 system, Dell G3 computer.

Vim is a text editor developed from vi. The convenient programming functions such as code completion, compilation and error jump are particularly rich and are widely used by programmers.

To put it simply, vi is an old-fashioned word processor, but it has a full range of functions, but there is still room for improvement. Vim can be said to be a very useful tool for program developers.

Vim is not only compatible with all vi instructions, but also has some new features in it.

These advantages of vim are mainly reflected in the following aspects:

1. Multi-level undo

We know that in vi, pressing u can only undo the last command, while in vim you can undo it indefinitely.

2. Ease of use

Vi can only run in unix, while vim can not only run on unix,windows, mac and other multi-operating platforms.

3. Highlight the grammar

Vim can highlight your code in different colors.

4. Visual operation

That is to say, vim can run not only on terminals, but also on x window, mac os, and windows.

5. Full compatibility with vi

In some cases, you can use vim as a vi.

Both vi and vim are editors in Linux, except that vim is more advanced and can be seen as an upgraded version of vi. Vi is suitable for text editing, but vim is more suitable for coding.

Why use vim?

Although there are many text editors under linux, and these tools have their own advantages, there are several points that other editing tools cannot match.

All Unix-like systems have built-in vi, while other editing tools are not necessarily, and vim is equivalent to an upgraded version of vi.

Many software's editing interfaces will call vi, such as crontab, edquota and so on.

Vim has the ability of program editing, which can actively identify the correctness of syntax by font color, which is convenient for code writing.

The program is simple and the editing speed is very fast.

To sum up, this is an old-fashioned word processing tool, but it has a full range of functions, not only a text processing tool, but also a program editing tool, even the official website says that vim is a program development tool rather than a word processing software, because it contains many additional functions, such as: multi-file editing, block copying, etc., these functions make it more convenient for us to modify the configuration file.

Precautions in use

Since individual versions of linux only install vi by default, you need to install additional vim software packages. We will explain how to install the software packages later. In addition, vim cannot enter Chinese under the character interface, while whether you can enter Chinese under the graphical interface depends on whether the Chinese input method is installed in the system.

Character difference

Due to the systematic differences between linux and windows, they also have different representations for some special symbols in the file, such as the symbols used to indicate line breaks, such as

[root@manage01 ~] # cat-A hello-linux.txt hello$$ [root@manage01 ~] # cat-A hello-windows.txt Helo ^ M $^ M $

It would be fine if the file was copied from windows to linux, but it would be a problem if it was a shell script that we needed to perform the specified work, because the linux did not understand the meaning of the symbol, which would cause the shell script to fail to execute. So at this point, we have to deal with this kind of file.

[root@manage01 ~] # unix2dos [- kn] file [newfile]

Options and parameters:

-k: keep the original mtime time format of the file

-n: keep the old file and output the converted content to the new file, such as dos2unix-n old new

At this point, the study of "what is the meaning of vim in linux" is over. I hope I can solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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