現在の .vimrc をメモしておく

随時ここに書き足していく予定。
何だか楽しくなってきた。

" .vimrc for mac

" common settings
:set textwidth=78
:set nocompatible
:set background=dark
:syntax on
:set number
:set tabstop=4
:set shiftwidth=4
:set expandtab
:set shiftround
:set incsearch
:set hidden
":set fenc=utf-8
:set fileencodings=euc-jp,iso-2022-jp,cp932
:set enc=utf-8

" set list mode (show tab as sequence of ">-")
:set list
:set listchars=tab:>-

" set colorscheme
:colorscheme desert

" refer to :help filetype
:filetype on
" disable cindent when you want to use smartindent.
":set nocindent
":set smartindent
:filetype indent on
" refer to :help ftplugins
:filetype plugin on

":nmap ,e :!open %<CR>
augroup filetypedetect
"au BufNewFile,BufRead *.xul>---setf xul
"au BufNewFile,BufRead *.xul>---set ft=xul
au BufNewFile,BufRead *.xul>setlocal ft=xul
augroup END 

" key mappings
:inoremap <c-j> <CR>
:nnoremap <c-k> :bnext<CR>
:nnoremap <c-l> :bprevious<CR>
:nnoremap ,ptv <Esc>:'<,'>! perltidy<CR>
:nnoremap ,ctv <Esc>:! cc % && ./a.out<CR>
:nnoremap ,cp :w !pbcopy<CR>

設定したら、「:source %」で再読み込みできる。

TODO

インデントまわりのことがよく分かってないので、help読む
*30.3*  Automatic indenting
:help 30.3
読んだ。
30.4 Other indenting
によると、
'smartindent' is not as smart as 'cindent', but smarter than 'autoindent'.
ということらしい。じゃあ cindent を常に使えばいいんじゃ・・・。