Images: http://www.hutui6.com/vim-wallpapers.html (a lot of beautiful vim desktop)

Introduction to the

Since March of this year [day one of Linux Mint], I’ve been going back and forth and hitting the wall on Linux Mint. Gradually, I am not only used to the entertainment and development under Linux, but also gradually become comfortable with my eyes. Now that I have guaranteed the survival of Linux, I am curious about VIM under Linux.

Although I heard that VIM is an ancient artifact, I only have black interface and white text for VIM image all the time. I only know that after entering the command interface, I can enter the text editing mode, move the cursor with the arrows up and down, and then Ese and :wq can be saved and quit and leave. Generally speaking, I don’t want to tease you, afraid of getting into trouble, and eventually die (spirit of the spirit).

This has not interviewed, ah! The hand is not idle, a few days ago began to start to VIM, gallbladder tremble tremble of go to the net first qiu Qiu others VIM long what kind ah! Google images directly! I’m ready to die. At this point, Watt? Vim can split screen? This guy has a directory on his Vim interface? GIT branch structure sidebar Why is there a line number on the left? These people’s code is so beautifully highlighted? Did I get past that nice status bar at the bottom? I was instantly attracted by the interface of these people. I felt like I had come to the city for the first time from the countryside.

So far I have added the directory structure, code line number, code highlighting theme change, status bar display, using GIT in VIM and so on to my VIM. I learned where to put VIM plug-ins, how to configure them, and learned a wave of basic commands to help me move forward. I think the most important thing about writing code is to have a safe, pleasant environment first, and then fast operation, so that you feel comfortable writing code. Of course, there is to improve a style, set technology, fast, force, efficient and a.

Below is a screenshot of my current VIM interface.

There is a direction you want to reach, all the difficulties are just a process

I’ll start here

Here’s the link: The world’s best editor: Vim 1 Best editor in the world: Vim 2 (original GIF demo all examples!) The best editor in the world: Vim 3 (original GIF demo all examples!)

After reading these three articles, I can understand the basic operation of VIM and install some plug-ins (in fact, I only used a few plug-ins inside, leave the rest useless!). . While you may have installed some plugins for no reason, it’s important to experience the VIM experience first.

The vim/bundle directory is full of plugins. You can download the Github plugin git clone directly to this directory.

.vim/bundle/vundle

  1. If you downloaded the tutorial above.vimThere will be this directory, and the plugin can be searched on Github and updated.
  2. If it’s a downloadable plugin on Github, you don’t have to clone it yourself.vimrcAdd:Plugin 'majutsushi/tagbar'Github address is:htttps://github.com/majutsushi/tagbar), just take the latter part.
  3. Finally, open terminal inputvimPress Enter to enter Vim. Then, enter the command:PluginInstallAll plug-ins in the form of step 2 are automatically downloaded.

From here to understand the Vim plug-in management, how to configure

Here’s the link: Don’t be afraid of Vim

Of course my English is poor and I have to learn more and more English. Look at the general, the above is the introduction, below are some actual examples. There’s a preview, so it’s easy to understand. Inside the introduction of a Vim game http://vim-adventures.com/, very interesting to play after three to money, more than 20 dollars to unlock, diaosi I can only dry hope.

Git command operations can be executed on projects in Vim. Gundo: View submissions displayed in a tree line structure (see figure below)

nerdtree
:Ve

powerline

Or simply record my journey!

At first I thought it was just like any other Plugin, just add Plugin ‘Lokaltog/powerline’ to.vimrc and then PluginInstall to Vim, Very Good. It’s not, you don’t need to add it to.vim/bundle at all, you need to configure Python, you need to configure it in.vimrc.

Not only did I add a status bar to VIM, but I also changed the user state of the command interface. I changed the default font to the Powerline font to make it look nicer. Take a look:

My steps:

  1. Install python-pip and Git packages
sudo apt-get install python-pip git
Copy the code
  1. Install Powerline using PIP
pip install --user powerline-status
Copy the code
  1. Font configuration (if there is no font, then the symbols of Powerline will display garbled characters in mine)
$ git clone https://github.com/powerline/fonts.git
$ cd fonts
$ ./install.sh
Copy the code
  1. Configure the environment, open.bashrcTo add the following information:
export TERM="screen-256color"
export PATH="$HOME/.local/bin:$PATH"
export POWERLINE_COMMAND=powerline
exportPOWERLINE_CONFIG_COMMAND=powerline-config powerline-daemon -q POWERLINE_BASH_CONTINUATION=1 POWERLINE_BASH_SELECT=1 . . ~ / local/lib/python2.7 / site - packages/powerline/bindings/bash/powerline. ShCopy the code

The second line shows the position of the command to join powerline, as shown below.

, ~ / local/lib/python2.7 / site - packages/powerline

Edit > Preferences
powerline semi

.vimrc

setRTP + = ~ / local/lib/python2.7 / site - packages/powerline/bindings/vim /setGuifont = Sauce \ Code \ Powerline: h14.5set laststatus=2
set encoding=utf-8
set t_Co=256
set number
set fillchars+=stl:\ ,stlnc:\
set term=xterm-256color
set termencoding=utf-8
set background=dark
Copy the code
  1. Reboot Vim and see if it’s done!

And finally, a theme that I’m using now

gruvbox

Configuration. Vimrc

Plugin 'morhetz/gruvbox'
colorscheme gruvbox
set background=light
set background=dark
Copy the code

Download it in Vim

:PluginInstall
Copy the code

Well here, other plug-ins to see the individual needs to add, are more or less the same.

End of the summary

Here are a few urls to put: Vim Cheat Sheet: Multiple voice view Vim command vimcolors: A lot of Vim color [AndroidStudio — — — — — — — IdeaVim plug-in] (http://blog.csdn.net/ly0303521/article/details/50761365)

From now on, open the Vim artifact function and enter the endless journey of hacking monsters!


Author: @Xujiaji

This article is my summary after I started VIM to climb the half hill! What a hillside! B, in fact, just into the door, ha ha. If there is any improper place also hope to give correction, if there is any Vim immoral also hope to recommend, thank you!