Vim Learning git for windows

Source: Internet
Author: User



This is my second article in the blog Park, tonight is the special day of the online, should be small requirements do not want to talk about, drink a bit of wine, feel pressure and challenge, smoked a few cigarettes, now a bit of the feeling of being stoned. At the 6 floor of the 11 teaching of Changjiang University, is the office of growing up online, this evening always does not turn off the lamp office front is the Jingzhou ancient city wall, behind is the spray scouring how many truly great men Yangtze River, also has the levee and the south.



As mentioned before, git for Windows can solve the Gvim plugin installation problem.



1. Install git



Run cmd input git--version enter D:\Git\cmd the git version number indicates that the installation was successful.



2. Write Curl Script



This script is required under Windows to connect with the Vundle plug-in manager.



Create a new Curl.cmd file under D:\Git\cmd and write the following information:

1 @rem Do not use "echo off" to not affect any child calls.
 2 @setlocal
 3
 4 @rem Get the abolute path to the parent directory, which is assumed to be the
 5 @rem Git installation root.
 6 @for / F "delims =" %% I in ("% ~ dp0 ..") do @set git_install_root = %% ~ fI
 7 @set PATH =% git_install_root% \ bin;% git_install_root% \ mingw \ bin;% git_install_root% \ mingw64 \ bin;% PATH%
 8 @rem !!!!!!! For 64bit msysgit, replace ‘mingw’ above with ‘mingw64’ !!!!!!!
 9 
10 @if not exist "% HOME%" @set HOME =% HOMEDRIVE %% HOMEPATH%
11 @if not exist "% HOME%" @set HOME =% USERPROFILE%
12
13 @ curl.exe% *
After saving, run cmd, enter curl --version, and press Enter to display the version information, indicating that the installation was successful. (Some of the script code on the Internet is incomplete, and finally found the problem in the github repository of this plugin)

3. Install Vundle plug-in manager (I am the new version, there is an old version do not confuse)

 git clone https://github.com/VundleVim/Vundle.vim.git D: Vim / vimfiles / bundle / Vundle.vim

4. Configure Vundle

Write in _vimrc:

 1 "vundle environment settings
 2 set nocompatible "be iMproved, required
 3 filetype off
 4 set rtp + = $ VIM / vimfiles / bundle / Vundle.vim
 5 "The list of plugins managed by vundle must be between vundle # begin () and vundle # end ()
 6 call vundle # begin (‘$ VIM / vimfiles / bundle’)
 7
 8 Plugin ‘VundleVim / Vundle.vim’
 9 Plugin ‘vim-airline / vim-airline’ "Status bar, buffer beautification
10 Plugin ‘vim-airline / vim-airline-themes’
11
12 "End of plugin list
13 call vundle # end ()
14 filetype plugin indent on
"Common commands
": BundleList-displays a list of plugins
": BundleInstall-install the plugin
": BundleInstall!-Update the plugin
": BundleClean-Clean up useless plugins
5. Solve the error report. Vim is a Unix-like editor. It is normal to use some errors under Windows. This is also the difficulty of learning gvim. Many online tutorials are based on Linux. It takes a lot of time.

At the time I was operating: The error reported by PluginInstall was

E484: Ca n‘t open file C: \ Users \ <userid> \ AppData \ Local \ Temp \ ... Error
My solution is to modify the temp and tmp environment variables of the system. For details, please refer to: https://github.com/VundleVim/Vundle.vim/wiki/Vundle-for-Windows

6. Open gvim to enter normal state execution: PluginInstall, our buffer beautification plug-in vim-airline is installed

7. Add the font of vim-airline to the system https://github.com/eugeii/consolas-powerline-vim

8. Vim-airline configuration, write in _vimrc:

 1 "Display the coordinates of the cursor
 2 set ruler
 3
 4 "Highlight the entire line
 5 set cursorline
 6
 7 "Auto indent
 8 set noautoindent
 9 set cindent
10 set smartindent
11
12 "Width of Tab key
13 set shiftwidth = 4
14 set tabstop = 4
15
16
17 "Set buffer theme
18 let g: airline_theme = ‘solarized’
19
20 set laststatus = 2 "Always show the status bar
21 let g: airline_powerline_fonts = 1
22 let g: airline # extensions # tabline # enabled = 1
twenty three 
24 if! Exists (‘g: airline_symbols’)
25 let g: airline_symbols = {}
26 endif
27
28 "unicode symbols
29 let g: airline_left_sep = ‘?’
30 let g: airline_left_sep = ‘?’
31 let g: airline_right_sep = ‘?’
32 let g: airline_right_sep = ‘?’
33
34
35 "Set to double-character wide display, otherwise it cannot be displayed completely like: ☆
36 set ambiwidth = double
37 set encoding = utf-8
38 set laststatus = 2
39 set bs = 2
40 set guifont = Courier_New: h12: cANSI
41 set rop = type: directx
42 let symbols = {‘maxlinenr‘: "\ u33d1", ‘linenr‘: "\ u2630"}
43 let & stl = ‘% f% {g: symbols.linenr}% 2l /% L% {g: symbols.maxlinenr}’
44
then. . . . . . . . .

In fact, the arrow of the buffer still has bugs. I hope to find a solution in the future. The purpose of the editor is not to look good. Next, I will use gvim to write html to test his friendliness to the front-end language.

 

vim learning git for windows

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.