Vim 相關資料

因為工作的關係,又重新把 Vim 給找回來用,不過很多東西都忘了。把找到的資料整理一下,方便以後用。

    字型
    網路上有兩套比較熱門的字型,分別是

  • Microsoft 所推出的 Consolas。
  • 由 Mac 上所衍生出的 Monaco。
  • 可以到 KAI 的網頁下載。

    而在 vimrc 中的設定為

    set guifont=monaco:h10:cANSI

    色彩設定
    個人喜歡使用黑色背景,所以選用 ir_black 這個 color scheme,不過這套配色在 Tsung 中有提到在 16 色的模式中會偏暗。

    " 開啟256 色
    syntax on
    set t_Co=256
    " set colors
    colors ir_black

    而這份 scheme 可以在作者的網頁中找到。

    其他設定

  • 編碼方式

    " set charset
    if has("multi_byte")
    set bomb
    set fileencodings=ucs-bom,utf-8,enc-cn,gb2312,big5,latin1
    set fileencoding=utf-8
    " VIM 內部預設編碼
    set encoding=big5
    else
    echoerr "Sorry, this version of (g)vim was not compiled with +multi_byte"
    endif

    請自行使用 :help fileencoding … etc 查詢

  • 排板方式和外觀

    " set editor display
    set autoindent
    set ruler
    set expandtab
    set shiftwidth=4
    set softtabstop=4
    set tabstop=4
    set incsearch
    " always present botton scrollbar
    set guioptions+=b

    縮排的方式可以參考這一篇 “程式的縮排 Coding Style(Indent style) 使用 K&R

Tags:

Leave a Reply