windows上安裝Gvim記錄

來源:互聯網
上載者:User

標籤:art   his   git   http   cto   version   方便   git安裝   log   

  起因是對編程的興趣,也撿起在學校時學的東西,想從頭學習一門新的程式設計語言,經過篩選定為Python。編輯器想要選擇一款輕量級又方便好用的軟體,不需要龐大的IDE,經過在Linux上的試用,覺得VIm不錯,網上也有在win上安裝vim的教程,由此入坑,折騰得夠嗆。。。

 

一、下載安裝Gvim

參考:http://www.cnblogs.com/zhcncn/p/4151701.html

   http://http://www.vim.org/ugrankar.pdf

1:安裝Gvim,注意安裝選項為“Full”

2. 在vimfiles 檔案夾下,會有許多空檔案夾。將它們全刪掉。

3. 將vim74檔案夾下的“autoload”檔案夾 剪下 到 vimfiles 檔案夾下。

4. 在vimfiles 檔案夾下建立檔案夾 bundle。

二、安裝Git

1、在Windows 下安裝和使用 Git(Cygwin篇) (參考連結:http://book.51cto.com/art/201107/278802.htm)

此方法在Cygwin上安裝使用Vim沒發現有什麼大問題,但我需要的是在Windows下使用,徹底擺脫Linux環境,而文中沒有涉及到,自己又對Cygwin、git及Vim在win上的相互關係不熟悉,對此毫無頭緒,暫且擱置,以後有功夫再搗鼓。

2、安裝msysGit

參考連結:http://www.cnblogs.com/zhcncn/p/4151701.html

3、在Git安裝目錄/cmd檔案夾下建立curl.cmd檔案,在檔案中添加如下代碼:

 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;%PATH% 8  9 @if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%10 @if not exist "%HOME%" @set HOME=%USERPROFILE%11 12 @curl.exe %*

4、在windows命令列下輸入curl --version驗證curl是否配置成功,顯示如下:

curl 7.54.0 (x86_64-pc-win32) libcurl/7.54.0 WinSSL zlib/1.2.11Protocols: dict file ftp ftps gopher http https imap imaps ldap pop3 pop3s rtsp smb smbs smtp smtps telnet tftpFeatures: AsynchDNS IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL libz

5、安裝Pathogen,原文是使用curl命令進行安裝(注意:需要在Vim安裝目錄\vimfiles\autoload下):

C:\Users\Admin\Vim\vimfiles\autoload>curl -LSso pathogen.vim https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim

但是此連結目次因為太過久遠已經失效,在Github上找到如下連結進行替換(也可以直接複製代碼粘貼到autoload/pathogen.vim中):

https://github.com/tpope/vim-pathogen/blob/master/autoload/pathogen.vim

6、配置_vimrc

_vimrc檔案位於Vim安裝目錄下,適當備份

在檔案最後添加如下代碼:

1 "Personal Settings.2 "More to be added soon. 3 execute pathogen#infect() 4 filetype plugin indent on5 syntax on

7、使用Git命令安裝一個顏色主題,檢驗Pathogen是否正常工作

7.1 運行如下代碼,注意:需要在bundle目錄下運行Git命令

C:\Vim\vimfiles\bundle>git clone https://github.com/zeis/vim-kolor

7.2 測試外掛程式是否安裝成功,重新開啟Gvim,命令列模式下輸入下面代碼,如果Gvim介面顏色改變,說明外掛程式安裝成功。

:colorscheme kolor

7.3 上條測試命令只在當前Gvim視窗起作用,如想儲存配置,修改_vimrc檔案:

"Set Color Schemecolorscheme kolor

7.4 進一步設定_vimrc

 1 "Set the status line options. Make it show more information. 2 set laststatus=2 3 set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\[POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")} 4 "Set Color Scheme and Font Options 5 colorscheme idle 6 set guifont=Consolas:h12 7 "set line no, buffer, search, highlight, autoindent and more. 8 set nu 9 set hidden10 set ignorecase11 set incsearch12 set smartcase13 set showmatch14 set autoindent15 set ruler16 set vb17 set viminfo+=n$VIM/_viminfo18 set noerrorbells19 set showcmd20 set mouse=a21 set history=100022 set undolevels=1000

 最終:

windows上安裝Gvim記錄

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.