Vim和Emacs一個稱為神之編輯器一個被稱為編輯器之神,固然很是誇張,但也足以說明這兩 款軟體的優秀和在程式員界的地位。但是它們都已漫長的學習曲線讓人望而生畏,阻止了大 多數人進入。作為一名幾乎完全使用Vim寫各種代碼、文檔的人,我想把我自己平時使用的 插件和配置整理下來,友善自己的總結和歸納,如果能有幸幫助到一些想學習Vim但是又不知 道如何入門的人來說,那就再榮幸不過了。
先貼一張我的Vim的截圖:

從上面那種截圖中肉眼能看到的插件說起,把整個界面按照左視窗、主視窗、右視窗和下窗 口命名,依次介紹出現在這個視窗中的主要插件。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<code>" Switch syntax highlighting on, when the terminal has colors</code>
<code>if</code> <code>(t_Co > 2 || has(</code><code>"gui_running"</code><code>)) && !exists(</code><code>"syntax_on"</code><code>)</code>
<code> </code><code>syntax on</code>
<code>endif</code>
<code>" Javascript syntax hightlight</code>
<code>syntax</code><code>enable</code>
<code>" Set syntax highlighting</code><code>for</code> <code>specific</code><code>file</code> <code>types</code>
<code>autocmd BufRead,BufNewFile Appraisals</code><code>set</code> <code>filetype=ruby</code>
<code>autocmd BufRead,BufNewFile *.md</code><code>set</code> <code>filetype=markdown</code>
<code>autocmd Syntax javascript</code><code>set</code> <code>syntax=jquery</code>
<code>" Color scheme</code>
<code>colorscheme molokai</code>
<code>highlight NonText guibg=</code><code>#060606</code>
<code>highlight Folded guibg=</code><code>#0A0A0A guifg=#9090D0</code>
在標明了一個适合自己的主題之後,就需要一些配置去解決排版的問題,比如字元編碼和縮 進等問題。