Installation and configuration of the Linux operating system vim
Installation of Vim
VI is the most established Linux editing tools, and Vim is the upgrade version of VI, Linux system must ah.
1. Press the TAB key after typing "VI" on the command line and you can see that only VI and Vim.tiny are installed in the current system. Vim is a text editor developed from VI that is more powerful. And Vim.tiny is a lite version of Vim, so it's imperative to install Vim
2.ubuntu system: Normal user under input command: sudo apt-get install VIM-GTK CentOS System: Normal user under input command: yum-y install vim*
Pictures with Ubuntu as an example
3. Here, enter "Y" and return.
4. Do not need any action afterwards, wait for the installation to complete. After the installation is complete, enter VI at the command line and press the TAB key. As you can see, there is already a vim command in existence. The installation was successful.
Configuration of Vim
Just installed Vim, perhaps the interface is not very friendly, which requires us to change the vim configuration file, according to our needs to modify it.
Under command line, enter the command: sudo vim/etc/vim/vimrc
You must add sudo, otherwise you are not authorized to edit VIMRC.
In this document, there is a sentence:
Syntax on
It means syntax highlighting, and if you're commented out, please "let it out." Just like in the show
Vim configuration for small series.
Please enter them in the last line of your vim to make your vim more beautiful and comfortable.
Set Nu//on the left line number
Set TabStop//tab length to 4 # Linux normal user after entering terminal, set vim./VIMRC, enter set nu set tabstop=4, is a simple way to configure VIM
Set nobackup//Overwrite files without backup
Set Cursorline//Highlight when forward
Set ruler//display status line at cursor position in lower right corner
Set autoindent//Auto Indent
After saving, the configuration is complete. The above configuration, in fact, is very simple, such as some color scheme, and so on, small and not written, if you have other needs, suggest Baidu.
OK, let's write a small program, as shown, it can be seen that the interface has been more beautiful, at least the small part of him to write programs, read documents, or feel very friendly.
Vim Installation and Configuration