Resolution setting and vim color scheme in Linux

Source: Internet
Author: User

I recently learned some configuration items in Linux, and now I have recorded the learning process for easy reference. System Environment: Linux debian

I. su, sudo

After Linux is installed, we often need to use the permission switch command su, sudo. The difference between the two commands is:

By default, after Linux is installed, the su command is run. "su" indicates switching users from average users to administrator users.

The sudo command must be installed before it can be used. sudo: assign an administrator permission to the current general user and then execute the command to be executed.

Install the sudo command: First switch to the administrator user, and then apt-get install sudo

Ii. modify resolution 800*600 = "1024*768

First clear knowledge points:
HWiNFO: a professional system information tool that supports the latest technologies and standards. Allow you to check all the hardware of your computer. It can display the processor, motherboard and chipset, pcmcia Interface, bios version, memory, Etc ..
Fbset sets the frame buffer. The fbset command can be used to set the size of the frame buffer, adjust the screen resolution, position, height, width, and depth, and determine whether to enable the hardware features of the first card.

1: Installation
Go to the Linux shell Command Line and enter the command: sodu apt-get install hwinfo fbset
(When entering this command line, make sure that the sodu command is already installed in the system. Otherwise, switch to the Administrator command: su)
There is a place to insert the optical drive during the installation process. In the case of 99%, the virtual optical drive is loaded.



3: After installation, run the following command: sudo hwinfo -- framebuffer to view the system information, including the resolution supported by the system.
The resolution corresponding to model 0x0317 is 1024*768 16bit.
If this record exists, your computer supports 1024*768 resolution.


4: Enter the boot program of the Linux system and modify the resolution at startup.
Command: sudo vim/etc/default/grub (grub is the Bootstrap program)
Use vim to open the file and modify quiet vga = 0x0317



In this way, the Linux Startup will have a resolution of 1024*768.

5: The modified file must be updated and submitted.
Command: sudo update-grub

Then restart the system and complete the settings.

3. Change the vim color scheme in Linux

Knowledge points to be clarified:

Linux is a multi-user system. Different users have different logon permissions and vim configurations. each user has a _ vimrc configuration file, for example: /username/_ vimrc. When we configure _ vimrc for the current user, this setting is only valid for the current user and belongs to a local configuration. However, when we switch to the administrator user, the configuration item is blank and does not have any effect. So it is not the best practice.
Generally, we can configure the global vimrc file, directory address/etc/vim/vimrc, so that all users share the effect of the current configuration.

1: Download the color file. molokai ------------ is the current color configuration.

Command: wget http://www.vim.org/scripts/download_script.php? Src_id = 9750-O molokai. vim
Download molokai to the current directory. You can use ls to check whether the file has been downloaded.


2: Put the file in the vim installation directory:
/Usr/share/vim/vim73/colors/molokai. vim (the installed tools are usually in the/usr/share folder)

Run the mv molokai. vim/usr/share/vim/vim73/colors/command to move the file to the colors directory.

(Or directly go to the colors folder in the installation directory of the cd file, and then download the file. This eliminates the need to move the file .)
There are many other color schemes in the colors folder. To enable the molokai color scheme, add the following command to the vim system configuration file:/usr/vim/vimrc

3: Enable the color scheme of molokai

Use vim to open the vimrc file and add the following command:

Set t_co= 256
Colorscheme molokai
After configuration, save and exit (: wq) and reboot the system.

Other Vim configurations are configured based on this article: The http://nonocast.cn/gvim-config/ can be selected based on your needs.

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.