ダン・クァン・ミン Blog

はじめまして

Vim Config

.vimrc

set number
set ruler
set showmatch
set hlsearch

"--- tab ----
set tabstop=4
set shiftwidth=4

"--- indent ----
" 'autoindent' depends on a above line.
"set autoindent

" 'smartndent' analies several lines.
set smartindent

" 'cndent' is greatest for C-launguage.
"set cindent

"--- status ---
set laststatus=2

"--- ctags ---
set tags=.tags

"--- list ----
set list
set listchars=tab:>-

"--- decoration ----
highlight SpecialKey ctermfg=grey
highlight ZenkakuSpace cterm=underline ctermfg=darkgrey

"--- xml sort ---
command XmlSort %s/></>\r</g | setf xml | normal gg=G

"--- open binary ----
augroup BinaryXXD
    autocmd!
    autocmd BufReadPre  *.bin let &binary =1
    autocmd BufReadPost * if &binary | silent %!xxd -g 1
    autocmd BufReadPost * set ft=xxd | endif
    autocmd BufWritePre * if &binary | %!xxd -r | endif
    autocmd BufWritePost * if &binary | silent %!xxd -g 1
    autocmd BufWritePost * set nomod | endif
augroup END

Comments