Skip to content

Instantly share code, notes, and snippets.

@gomasaba
Created December 27, 2011 14:37
Show Gist options
  • Save gomasaba/1523835 to your computer and use it in GitHub Desktop.
Save gomasaba/1523835 to your computer and use it in GitHub Desktop.
vimの設定メモ
syntax on
set autoindent
set number
if has('gui_macvim')
set showtabline=2 " タブを常に表示
set imdisable " IMを無効に
set antialias " アンチエイリアスを有効に
set cindent " Cインデントを利用
set expandtab " タブを空白文字で
set tabstop=2 " タブに使われる空白文字数
set shiftwidth=2 " 自動インデントの深さ
set guioptions-=T " ツールバーを非表示に
colorscheme Dark " カラースキーマの設定
endif
"行頭のスペースの連続をハイライトさせる
"Tab文字も区別されずにハイライトされるので、区別したいときはTab文字の表示を別に
"設定する必要がある。
function! SOLSpaceHilight()
syntax match SOLSpace "^\s\+" display containedin=ALL
highlight SOLSpace term=underline ctermbg=LightGray
endf
"全角スペースをハイライトさせる
function! JISX0208SpaceHilight()
syntax match JISX0208Space " " display containedin=ALL
highlight JISX0208Space term=underline ctermbg=LightCyan
endf
"syntaxの有無をチェックし、新規バッファと新規読み込み時にハイライトさせる
if has("syntax")
syntax on
augroup invisible
autocmd! invisible
autocmd BufNew,BufRead * call SOLSpaceHilight()
autocmd BufNew,BufRead * call JISX0208SpaceHilight()
augroup END
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment