" vi:set ts=8 sts=2 sw=2 tw=0: " vim:fdm=marker fdl=0 fdc=0 fdo+=jump,search: " vim:fdt=substitute(getline(v\:foldstart),'\\(.\*\\){\\{3}','\\1',''): " Yasuhiro Matsumoto "************************************************** "************************************************** "* Vim Environment {{{ "-------------------------------------------------- if $MSYSTEM != '' finish endif if &compatible==1 set nocompatible endif set cmdheight=2 set ignorecase set smartcase set tabstop=4 set shiftwidth=4 set history=50 set noexpandtab set autoindent set backspace=indent,eol,start set wrapscan set noshowmatch set wildmenu set nonumber set ruler set nolist set listchars=tab:>-,trail:-,eol:\| set nowrap set laststatus=2 set showcmd set noswapfile set nobackup set nohlsearch set cinoptions=>4 set visualbell set incsearch set isprint=@,~-247,249-255 set tags=./tags,tags,../tags if executable('grep') if globpath(substitute($PATH, ';', ',', 'g'), 'grep.exe') =~ 'borland' set grepprg=grep\ -no else set grepprg=grep\ -n endif endif set shellslash if $SSH_CLIENT != '' set clipboard=autoselect,exclude:cons\\\|linux\\\|cygwin\\\|rxvt\\\|screen\\\|xterm else set clipboard=autoselect,exclude:cons\\\|linux\\\|cygwin\\\|rxvt\\\|screen endif set diffopt=filler,iwhite if has('unix') && $SHELL == '' set shell=/bin/bash endif if $TERM=='jfbterm' "fixdel endif "let $GTK_IM_MODULE = 'xim' "let $GDK_USE_XFT = 0 " }}} "************************************************** " ignore bram's example script. let no_gvimrc_example=1 let no_vimrc_example=1 "************************************************** "* System Environment {{{ "-------------------------------------------------- if filereadable($VIM . '/vimrc') && filereadable($VIM . '/ViMrC') set tags=./tags,tags endif if $HOME=='' && has('win32') let $HOME=$USERPROFILE endif if $OSTYPE=='cygwin' || $TERM=='cygwin' || has('unix') let $DESKTOP=$HOME.'/Desktop' else let $DESKTOP=$USERPROFILE."/\x83\x66\x83\x58\x83\x4e\x83\x67\x83\x62\x83\x76" if !isdirectory($DESKTOP) let $DESKTOP=$USERPROFILE."/\xC3\xDE\xBD\xB8\xC4\xAF\xCC\xDF" endif let $MYDOCUMENT=$USERPROFILE.'/My Documents' endif " }}} "************************************************** "************************************************** "* Japanese Environment {{{ "-------------------------------------------------- if version >= 600 if has('win32') " if using win32 ... if $LANG=='' || ($OSTYPE=='cygwin' && $TERM=='cygwin') let $LANG='ja' set encoding=cp932 lang mes ja endif else " if using cygwin console ... if exists("$HOMEDRIVE") set background=dark if $LANG=='' let $LANG='ja_JP.SJIS' set encoding=cp932 endif if $TERM=='xterm-color' && !has('gui_running') let $LANG='ja_JP.utf-8' set encoding=utf-8 language ja_JP.utf-8 set langmenu=ja_jp.utf-8 elseif $LANG=='ja.SJIS' || $LANG=='ja_JP.SJIS' set encoding=cp932 set langmenu=japanese_japan.932 else set encoding=euc-jp set langmenu=ja_jp.eucjp endif " if using unix console ... elseif $TERM=='kon' || $TERM=='kterm' if $LANG =~ 'UTF' set termencoding=euc-jp set ambiwidth=double else let $LANG='ja' set encoding=euc-jp endif else "let $LANG='ja' "set langmenu=ja_jp.eucjp "set encoding=eucjp endif endif endif if has('iconv') let s:enc_euc = 'euc-jp' let s:enc_jis = 'iso-2022-jp' " check the supporting JISX0213 for iconv if iconv("\x87\x64\x87\x6a", 'cp932', 'euc-jisx0213') ==# "\xad\xc5\xad\xcb" let s:enc_euc = 'euc-jisx0213' let s:enc_jis = 'iso-2022-jp-3' endif " build fileencodings set fileencodings=iso-2022-jp-3,iso-2022-jp,euc-jisx0213,euc-jp,utf-8 set fileencodings+=utf-8 if &encoding =~# '^euc-\%(jp\|jisx0213\)$' let &encoding = s:enc_euc silent! let &encoding = 'eucjp-ms' else let &fileencodings = &fileencodings .','. s:enc_euc . ',eucjp-ms' endif set fileencodings+=cp932 unlet s:enc_euc unlet s:enc_jis elseif executable('iconv') function! CharConvert() call system("iconv -f " . v:charconvert_from . " -t " . v:charconvert_to . " <" . v:fname_in . " >" . v:fname_out) return v:shell_error endfun set charconvert=CharConvert() endif " if windows, detect mac format if $OSTYPE=='cygwin' || $TERM=='cygwin' || exists("$HOMEDRIVE") set fileformats+=mac endif set fileformats+=mac " for printing if has('printer') if has('win32') set printfont=FixedSys:h10 elseif has("unix") set printencoding=euc-jp if exists('&printmbcharset') set printmbcharset=JIS_X_1983 set printmbfont=r:Ryumin-Light,b:Ryumin-Light,a:yes,c:yes endif endif endif if exists('&formatoptions') set formatoptions+=mB let format_join_spaces=2 let format_allow_over_tw=1 endif if exists('&ambiwidth') && (has('gui_running') || $TERM=="cygwin") " some xterm don't support cjk width set ambiwidth=double endif " }}} "************************************************** "************************************************** "* Key Maps {{{ "-------------------------------------------------- if !exists('g:mapleader') " for all mapleader let g:mapleader = '\' endif " expand path cmap =expand('%:p:h')/ " expand file (not ext) cmap =expand('%:p:r') " try tab completion cmap " like windows vnoremap p :let current_reg = @"gvs=current_reg vmap >gv vmap gZZ :set t_te= t_ti= :quit:set t_te& t_ti& " shell with no erase nmap gsh :set t_te= t_ti= :sh:set t_te& t_ti& " for file complete cnoremap nmap te :tabedit nmap tc :tabclose if exists('&iminsert') set iminsert=0 set imsearch=0 if !exists('&imoptions') " for im_custom inoremap :let &iminsert=(&iminsert==2?0:2) endif endif " toggle list nmap :let &list=(&list == 1 ? 0 : 1) " rotate tab size nmap :let &ts=(&ts*2 > 16 ? 2 : &ts*2):echo "tabstop:" . &ts " toggle highlight search nmap :let &hls=(&hls == 1 ? 0 : 1) " like visual studio nmap :copen\|:cnext " like visual studio nmap :copen\|:cprev " download nmap !D :exec "!wget " . expand('') function! Date() return \ strpart("SunMonTueWedThuFriSat", strftime("%w") * 3, 3). \ strftime(", %d "). \ strpart("JanFebMarAprMayJunJulAugSepOctNovDec", (strftime("%m")-1) * 3, 3). \ strftime(" %Y") endfunction inoremap =Date() " }}} "************************************************** "************************************************** "* Autocmd {{{ "-------------------------------------------------- autocmd BufNewFile,BufReadPost *.pc setf esqlc autocmd FileType jsp,asp,php,xml,perl syntax sync minlines=500 maxlines=1000 autocmd FileType python setlocal ts=4 sw=4 sta et sts ai " }}} "************************************************** "************************************************** "* Syntax And Colorscheme {{{ "-------------------------------------------------- if isdirectory($VIMRUNTIME.'/syntax') if &t_Co > 2 || has("gui_running") syntax on endif if has("autocmd") filetype plugin indent on endif autocmd BufReadPost * \ silent! if line("'\"") > 0 && line("'\"") <= line("$") | \ exe "normal g`\"" | \ endif endif " colorscheme if has("gui_running") colorscheme rainbow_autumn else if $TERM=='rxvt' silent! colorscheme blue elseif $TERM=='cygwin' silent! colorscheme autumn else silent! colorscheme torte endif endif " }}} "************************************************** scriptencoding utf-8 "************************************************** "* Script Parameters {{{ "-------------------------------------------------- " for menu.vim menutranslate Plugin プラグイン(&P) " for 2html.vim let g:use_xhtml = 1 let g:html_use_css = 1 let g:html_no_pre = 1 " calenar.vim let g:calendar_erafmt = '平成,-1988' let g:calendar_mruler = \'睦月,如月,弥生,卯月,皐月,水無月'. \',文月,葉月,長月,神無月,霜月,師走' let g:calendar_wruler = '日 月 火 水 木 金 土' let g:calendar_weeknm = 4 let g:calendar_navi_label = '前月,今月,次月' let g:calendar_diary = "~/.vim_diary" let g:calendar_mark = 'left' let g:calendar_navi = 'both' "* taglist.vim autocmd CursorHold __Tag_List__ normal p let g:icomplete_loaded = 1 " }}} "**************************************************