The configuration of vim under Linux and the simple installation of gcc/g++ and gdb

Note: The method described in this article has only been tested on CentOS 6.5 , and there may be differences between different versions. Please verify by yourself. In addition, this article only introduces the instruction installation method. Downloading the installation package for decompression and installation will not be discussed.

1.  Generally speaking, the CentOS we download will come with gcc , so before installation, we must first check whether gcc already exists in our system, as shown below:

 

At this time, it shows that gcc already exists in my system; if it is detected that gcc does not exist in the system, you need to enter the root authority under the condition that your Linux is connected to the Internet (because my gcc already exists, so I introduce g++ installation will introduce how to enter the root authority to install), use the yum install gcc command to install.

2. First check whether there is g++ in your system (it has been checked in Figure 1 , so the installation instructions are directly introduced) as shown in the figure below, first use the su command and enter the password, press the Enter key to enter the root authority, and then use the instructions in the figure: yum -y install gcc-c++ (this command also requires Linux to be connected to the Internet) to install it.

 

Some screenshots of the installation process:

 

After the installation is complete, check again, as shown below, the g++ path is displayed at this time:

 

3. gdb installation: After checking, it is found that there is no gdb in the system , so use the command: yum install gdb to install

 

Check the installation result:

 

4.  Here are some common configurations of vim :

vim is a powerful compiler under Linux , which allows users to install various configurations and disassembly by themselves, while the vim configuration that comes with Linux is relatively simple, so we use root to enter the ect/ directory under the root directory and list all files :

 


We found: there is a file called vimrc in this directory , which is where the default Linux configuration is stored.

When we generally configure ourselves, we do not change this file, but choose to create a .vimrc file in the home directory of our current user ( the configuration in the home directory of the current user is only valid for the current user ) to store our Configuration.

First use the touch command to create a .vimrc file, and then use the vim .vimrc command to enter the .vimrc file to set the configuration you need

 

Here's some simple configuration I've added:

 

The above is my summary of gcc/g++, gdb installation instructions and vim configuration settings under Linux , I hope it will be helpful to everyone.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326804172&siteId=291194637