I. Introduction opening
After installing Ubuntu 15.04 system does, playing with Ubuntu, the feeling is still very good. Faster than Windows, you can open a boot program you want, but in Windows you must wait for him to start some items can only be properly enabled. Feel Linux and MacOs you win. Only in Linux software will be a lot less.
Prior wrote a blog post about Vim is simple to use, but also to touch and use Vim from scratch, learn the thing I read Bowen commands, you can use vim to efficiently complete your editing work, of course, if need to control format, the use of vim is not enough, we need to markdown, if vim can add markdown, then edit them perfect it, ha ha.
Vim is not only "editors God" and Vim plugin rich, can fight the development environment IDE, next to record what my vim, the whole process down, feeling like their own to build a IDE, oh well.
Vim as an IDE, you can achieve the effect, first to satisfy desires
II. Introduction to this post Vim configuration capabilities
1. First install the bars
Install it in Linux is very simple, open a terminal and enter a few commands can be completed.
sudo apt-get install vim
sudo apt-get install gvim
sudo apt-get install git (this is very important, to download the plug back in time to use git to download)
This is the first command here that I have installed, without having to install. Installed after the direct input terminal or git vim or gvim you can know whether there are fitted.
It can also be installed using a aptitude, prior to installation aptitude install aptitude first
sudo aptitude install vim
sudo aptitude install gvim
sudo aptitude install git
Then, based on the user's home directory .vim directory listings .vim establish bundle directory, after Vundle automatically download plug-ins are stored here.
vundle can automatically download and install the plug-in, just use the Bundle command behind "My Bundles Here" Note the required plug-listed, each plug-in line, and then run: BundleInstall command. Vundle support github.com and Vim official website vim.org.
mkdir .vim / bundle
Then, enter the Bundle directory, use the git clone command to download vundle.
git clone https://github.com/gmarik/vundle.git ~ / .vim / bundle / vundle
Perform the download is complete, then you can see vundle directory in the bundle.
2. Create a basic configuration and look .vimrc file
You can enter vim in a terminal and enter: echo $ VIM see your vim directory, then look in the directory has no .vimrc file, if not on their own to create.
My .vimrc file under / usr / share / vim directory (do not know the .vimrc is not also in this directory), if not on their own to create a command: touch .vimrc
Let's basic configuration, do not plug more advanced mapping those things before it. It can be done: Code color, tab indentation, auto-save, in particular displays the current edit line, bracket matching, searching to find, with the public system clipboard, code folding and so on. as follows:
NOTE: Changing the .vimrc file need to use sudo vim vimrc vim to modify, you can also use sudo gedit vimrc
My basic configurations:
"Basic ------------- ----------------------------------- -----------------------
"When the processing is not saved or read-only files, the pop-up confirmation
set history = 1000
set fenc = utf-8
set fencs = utf-8, ucs-bom, shift-jis, gb18030, gbk, gb2313, cp936
if has ( "syntax")
"Set the color scheme
"Set the line number
set tabstop = 4
set sts = 4
set softtabstop = 4
set shiftwidth = 4
"Setting Auto format (format problems on the delete this line)
set formatoptions = tcrqn
"Setting bracket pairing
set matchtime = 2
"Setting is not automatic backup
"Setting the longitudinal dotted alignment
Status line "at the bottom of the display position of the cursor
"Search mode ignores case
"If the search pattern contains sensitive not apply ignorecase
"Re-search file search ban ends
"Highlight the searched text
"Highlighted by character
"Use the mouse
"Hold down the shift only by the right-processing operations
set mouse = a
"System and Shared clipboard
set clipboard + = unnamed
"Highlight current line
"On folding, folding and set up a space switch
set foldmethod = syntax
set foldcolumn = 0
setlocal foldlevel = 1
set foldclose = all
nnoremap @ = ((foldclosed (line ()) <0) 'zc' '.':? 'zo')
"When searching for a good setting and undo not expanded collapsed
set foldopen- = search
set foldopen- = undo
Complete here, you can knock on the code, but not enough ah, as the IDE is not enough ah, how no tree? Not a key to compile and run? No syntax completion?