Skip to content

Instantly share code, notes, and snippets.

@Pafuxu
Created March 24, 2009 13:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pafuxu/84090 to your computer and use it in GitHub Desktop.
Save Pafuxu/84090 to your computer and use it in GitHub Desktop.
""" .vimrc
" 文字コード判定
set fencs=iso-2022-jp,euc-jp,cp932
" ステータスラインを常に表示
set laststatus=2
" ステータスラインに文字コードと改行文字を表示する
set statusline=%<%f\ %m%r%h%w%{'['.(&fenc!=''?&fenc:&enc).']['.&ff.']'}%=%l,%c%V%8P
" ESCキー2度押しでハイライトを消す
set hlsearch
nnoremap <Esc><Esc> :<C-u>set nohlsearch<Return>
nnoremap / :<C-u>set hlsearch<Return>/
nnoremap ? :<C-u>set hlsearch<Return>?
nnoremap * :<C-u>set hlsearch<Return>*
nnoremap # :<C-u>set hlsearch<Return>#
" インデント設定
set shiftwidth=4
set tabstop=4
set autoindent
" Omni 補完をタブキーで行う
function InsertTabWrapper()
if pumvisible()
return "\<c-n>"
endif
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k\|<\|/'
return "\<tab>"
elseif exists('&omnifunc') && &omnifunc == ''
return "\<c-n>"
else
return "\<c-x>\<c-o>"
endif
endfunction
inoremap <tab> <c-r>=InsertTabWrapper()<cr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment