把vim配置成編程利器

工欲善其事,必先利其器

最近在學習python編程,喜歡使用vim,輕便精悍。於是上網查了一下,發現了很多vim配置的方案。大牛真多!!!從很經典的molokai到neocomplete,spf13,知乎網友的wklken,還有終極的John Anderson 的配置把vim變成一個python IDE。比較之後,我決定使用喜歡的顏色方案和安裝最簡單的spf13。linux系統下只需要1命令行!!!不需要手動下載和手動配置任何東西~

安裝過程(linux 或 *nix)

1.requirement

1)確保已經安裝下面的vim版本之一。下面四個分別是不同桌面系統的vim版本。我的是gnome

  • vim-nox
  • vim-gtk
  • vim-gnome
  • vim-athena

2)確保已經安裝Git 1.7以上。若沒有安裝,請sudo apt-get install git或sudo rpm install git

2.命令行安裝

方法1(對大多數情況):

在terminal中輸入:

curl https://j.mp/spf13-vim3 -L > spf13-vim.sh && sh spf13-vim.sh

我在下載完安裝時報錯:

spf13-vim.sh: 2: spf13-vim.sh: Syntax error: newline unexpected

打開該文件查看代碼並沒有發現什麼不對,於是我使用方法2安裝

方法2(shell 必須與bash兼容):

在terminal中輸入:

 sh <(curl https://j.mp/spf13-vim3 -L)

等待2分鐘左右,安裝成功!

安裝成功

下面是用VIM打開隨意一個python代碼的界面。很帥有木有!!!

python代碼顏色

這時用GVIM打開的另一個代碼,很護眼~

Gvim

3.設置其他主題和配置(一般用不着)

1)Before File

Create a ~/.vimrc.before.local file to define any customizations that get loaded before the spf13-vim .vimrc.

For example, to prevent autocd into a file directory:

echo let g:spf13_no_autochdir = 1 >> ~/.vimrc.before.local

For a list of available spf13-vim specific customization options, look at the ~/.vimrc.before file.

2)Customization

Create ~/.vimrc.local and ~/.gvimrc.local for any local customizations.

For example, to override the default color schemes:

echo colorscheme ir_black  >> ~/.vimrc.local
發佈了39 篇原創文章 · 獲贊 58 · 訪問量 44萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章