set tags=./tags,../tags,../../tags,../../../tags,tags
function! Komment()
if getline(".") =~ '\/\*'
let hls=@/
s/^\/\*//
s/*\/$//
let @/=hls
else
let hls=@/
s/^/\/*/
s/$/*\//
let @/=hls
endif
endfunction
function! C_comment()
let hls=@/
s/^/\/\//
let @/=hls
endfunction
function! C2_comment()
let hls=@/
s/^/"/
let @/=hls
endfunction
function! C3_comment()
let hls=@/
s/^/#/
let @/=hls
endfunction
function! UNcomment()
let hls=@/
if getline(".") =~ '\/\/'
s/^\/\/// "for c
elseif getline(".") =~ '\"'
s/^"//
elseif getline(".") =~ '#'
s/^#//
elseif getline(".") =~ '#$'
s/^#$/$/
endif
let @/=hls
endfunction
map ,/ :call C_comment()
map ,\ :call Komment()
map ," :call C2_comment()
map ,# :call C3_comment()
map ,c :call UNcomment()
colorscheme torte
set nu
set hlsearch
set nocompatible
set backspace=2
set autoindent
set cindent
set smartindent
set textwidth=90
set nowrapscan
set nobackup
set novisualbell
set nojoinspaces
set ruler
set tabstop=4
set shiftwidth=4
set keywordprg=man\ -a
set showcmd
set showmatch
set ignorecase
set incsearch
set autowrite
"set linespace=2
set linespace=1
set title
set keywordprg=wdic
set statusline=\ %<%l:%v\ [%P]%=%a\ %h%m%r\ %F\ set expandtab set matchpairs+=<:>
syntax on
""UTF-8, euc-kr 﨑懋ク・ク・・・ク・・ ・エ・ー
""if v:lang =~ "^ko"
""
""" set encoding=cp949
"" set fileencodings=utf-8,cp949
"" set guifontset=-*-*-medium-r-normal--16-*-*-*-*-*-*-*
""elseif v:lang =~ "^ja_JP"
""
"" set fileencodings=euc-jp
"" set guifontset=-misc-fixed-medium-r-normal--14-*-*-*-*-*-*-*
""endif
"
" 文字コードの自動認識
if &encoding !=# 'utf-8'
set encoding=japan
set fileencoding=japan
endif
if has('iconv')
let s:enc_euc = 'euc-jp'
let s:enc_jis = 'iso-2022-jp'
" iconvがeucJP-msに対応しているかをチェック
if iconv("\x87\x64\x87\x6a", 'cp932', 'eucjp-ms') ==# "\xad\xc5\xad\xcb"
let s:enc_euc = 'eucjp-ms'
let s:enc_jis = 'iso-2022-jp-3'
" iconvがJISX0213に対応しているかをチェック
elseif 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
" fileencodingsを構築
if &encoding ==# 'utf-8'
let s:fileencodings_default = &fileencodings
let &fileencodings = s:enc_jis .','. s:enc_euc .',cp932'
let &fileencodings = &fileencodings .','. s:fileencodings_default
unlet s:fileencodings_default
else
let &fileencodings = &fileencodings .','. s:enc_jis
set fileencodings+=utf-8,ucs-2le,ucs-2
if &encoding =~# '^\(euc-jp\|euc-jisx0213\|eucjp-ms\)$'
set fileencodings+=cp932
set fileencodings-=euc-jp
set fileencodings-=euc-jisx0213
set fileencodings-=eucjp-ms
let &encoding = s:enc_euc
let &fileencoding = s:enc_euc
else
let &fileencodings = &fileencodings .','. s:enc_euc
endif
endif
" 定数を処分
unlet s:enc_euc
unlet s:enc_jis
endif
" 日本語を含まない場合は fileencoding に encoding を使うようにする
if has('autocmd')
function! AU_ReCheck_FENC()
if &fileencoding =~# 'iso-2022-jp' && search("[^\x01-\x7e]", 'n') == 0
let &fileencoding=&encoding
endif
endfunction
autocmd BufReadPost * call AU_ReCheck_FENC()
endif
" 改行コードの自動認識
set fileformats=unix,dos,mac
" □とか○の文字があってもカーソル位置がずれないようにする
if exists('&ambiwidth')
set ambiwidth=double
endif
"set encoding=euc-jp
"set fileencodings=iso-2022-jp,sjis,utf-8
if has("gui_running")
"set gfn=Fixedsys\ Excelsior\ 2.00\ 14
"set gfn=MiscFixed\ Semi-Condensed\ 10
"set gfw=Hangang\ Bold\ 10
"set gfw=Osaka\ 12
"set gfn=Terminal:h10:cSHIFTJIS
"set gfn=Osaka-等幅:h11:cSHIFTJIS
"set gfw=Osaka-等幅:h11:cSHIFTJIS
"set gfn=Fixedsys_Excelsior_2.00:h12:cANSI
set gfn=Terminal:h10:cSHIFTJIS
"set gfn=Osaka-等幅:h11:cSHIFTJIS
set gfw=Osaka-等幅:h11:cSHIFTJIS
set columns=120
set lines=50
" instead in /etc/vim/gvimrc
endif
highlight SpecialKey cterm=underline ctermfg=darkgrey
"highlight ZenkakuSpace cterm=underline ctermfg=lightblue guibg=white
highlight ZenkakuSpace guibg=DarkRed
"highlight ZenkakuSpace guibg=gray40
"match ZenkakuSpace / /
"認識されないケースがある
au BufNew,BufRead * match ZenkakuSpace / /
highlight NOTE1 cterm=bold ctermfg=Magenta guibg=Yellow guifg=Magenta
"match NOTE1 /NOTE/
au BufNew,BufRead * match NOTE1 /NOTE/
" dictionary
autocmd FileType perl :set dictionary=$HOME/vim71/runtime/syntax/perl.vim
autocmd FileType cgi :set dictionary=$HOME/vim71/runtime/syntax/perl.vim
autocmd FileType c :set dictionary=$HOME/vim71/runtime/syntax/c.vim
autocmd FileType sh :set dictionary=$HOME/vim71/runtime/syntax/shell.vim
autocmd FileType html :set dictionary=$HOME/vim71/runtime/syntax/html.vim
autocmd FileType php :set dictionary=$HOME/vim71/runtime/syntax/php.vim
autocmd FileType sql :set dictionary=$HOME/vim71/runtime/syntax/sql.vim
" Jeff's cscope settings
if has("cscope")
" set csprg=/usr/bin/cscope
set csprg=~/bin/cscope
set csto=0
set cst
set nocsverb
" add any database in current directory
if filereadable("cscope.out")
cs add cscope.out
" else add database pointed to by environment
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
set csverb
" Using 'CTRL-\' then a search type makes the vim window
" "shell-out", with search results displayed on the bottom
nmaps :cs find s =expand("")
nmapg :cs find g =expand("")
nmapc :cs find c =expand("")
nmapt :cs find t =expand("")
nmape :cs find e =expand("")
nmapf :cs find f =expand("")
nmapi :cs find i ^=expand("")$
nmapd :cs find d =expand("")
" Using 'CTRL-spacebar' then a search type makes the vim window
" split horizontally, with search result displayed in
" the new window.
nmaps :scs find s =expand("")
nmapg :scs find g =expand("")
nmapc :scs find c =expand("")
nmapt :scs find t =expand("")
nmape :scs find e =expand("")
nmapf :scs find f =expand("")
nmapi :scs find i ^=expand("")$
nmapd :scs find d =expand("")
" Hitting CTRL-space *twice* before the search type does a vertical
" split instead of a horizontal one
nmaps :vert scs find s =expand("")
nmapg :vert scs find g =expand("")
nmapc :vert scs find c =expand("")
nmapt :vert scs find t =expand("")
nmape :vert scs find e =expand("")
nmapi :vert scs find i ^=expand("")$
nmapd :vert scs find d =expand("")
endif
function! Komment()
if getline(".") =~ '\/\*'
let hls=@/
s/^\/\*//
s/*\/$//
let @/=hls
else
let hls=@/
s/^/\/*/
s/$/*\//
let @/=hls
endif
endfunction
function! C_comment()
let hls=@/
s/^/\/\//
let @/=hls
endfunction
function! C2_comment()
let hls=@/
s/^/"/
let @/=hls
endfunction
function! C3_comment()
let hls=@/
s/^/#/
let @/=hls
endfunction
function! UNcomment()
let hls=@/
if getline(".") =~ '\/\/'
s/^\/\/// "for c
elseif getline(".") =~ '\"'
s/^"//
elseif getline(".") =~ '#'
s/^#//
elseif getline(".") =~ '#$'
s/^#$/$/
endif
let @/=hls
endfunction
map ,/ :call C_comment()
map ,\ :call Komment()
map ," :call C2_comment()
map ,# :call C3_comment()
map ,c :call UNcomment()
colorscheme torte
set nu
set hlsearch
set nocompatible
set backspace=2
set autoindent
set cindent
set smartindent
set textwidth=90
set nowrapscan
set nobackup
set novisualbell
set nojoinspaces
set ruler
set tabstop=4
set shiftwidth=4
set keywordprg=man\ -a
set showcmd
set showmatch
set ignorecase
set incsearch
set autowrite
"set linespace=2
set linespace=1
set title
set keywordprg=wdic
set statusline=\ %<%l:%v\ [%P]%=%a\ %h%m%r\ %F\ set expandtab set matchpairs+=<:>
syntax on
""UTF-8, euc-kr 﨑懋ク・ク・・・ク・・ ・エ・ー
""if v:lang =~ "^ko"
""
""" set encoding=cp949
"" set fileencodings=utf-8,cp949
"" set guifontset=-*-*-medium-r-normal--16-*-*-*-*-*-*-*
""elseif v:lang =~ "^ja_JP"
""
"" set fileencodings=euc-jp
"" set guifontset=-misc-fixed-medium-r-normal--14-*-*-*-*-*-*-*
""endif
"
" 文字コードの自動認識
if &encoding !=# 'utf-8'
set encoding=japan
set fileencoding=japan
endif
if has('iconv')
let s:enc_euc = 'euc-jp'
let s:enc_jis = 'iso-2022-jp'
" iconvがeucJP-msに対応しているかをチェック
if iconv("\x87\x64\x87\x6a", 'cp932', 'eucjp-ms') ==# "\xad\xc5\xad\xcb"
let s:enc_euc = 'eucjp-ms'
let s:enc_jis = 'iso-2022-jp-3'
" iconvがJISX0213に対応しているかをチェック
elseif 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
" fileencodingsを構築
if &encoding ==# 'utf-8'
let s:fileencodings_default = &fileencodings
let &fileencodings = s:enc_jis .','. s:enc_euc .',cp932'
let &fileencodings = &fileencodings .','. s:fileencodings_default
unlet s:fileencodings_default
else
let &fileencodings = &fileencodings .','. s:enc_jis
set fileencodings+=utf-8,ucs-2le,ucs-2
if &encoding =~# '^\(euc-jp\|euc-jisx0213\|eucjp-ms\)$'
set fileencodings+=cp932
set fileencodings-=euc-jp
set fileencodings-=euc-jisx0213
set fileencodings-=eucjp-ms
let &encoding = s:enc_euc
let &fileencoding = s:enc_euc
else
let &fileencodings = &fileencodings .','. s:enc_euc
endif
endif
" 定数を処分
unlet s:enc_euc
unlet s:enc_jis
endif
" 日本語を含まない場合は fileencoding に encoding を使うようにする
if has('autocmd')
function! AU_ReCheck_FENC()
if &fileencoding =~# 'iso-2022-jp' && search("[^\x01-\x7e]", 'n') == 0
let &fileencoding=&encoding
endif
endfunction
autocmd BufReadPost * call AU_ReCheck_FENC()
endif
" 改行コードの自動認識
set fileformats=unix,dos,mac
" □とか○の文字があってもカーソル位置がずれないようにする
if exists('&ambiwidth')
set ambiwidth=double
endif
"set encoding=euc-jp
"set fileencodings=iso-2022-jp,sjis,utf-8
if has("gui_running")
"set gfn=Fixedsys\ Excelsior\ 2.00\ 14
"set gfn=MiscFixed\ Semi-Condensed\ 10
"set gfw=Hangang\ Bold\ 10
"set gfw=Osaka\ 12
"set gfn=Terminal:h10:cSHIFTJIS
"set gfn=Osaka-等幅:h11:cSHIFTJIS
"set gfw=Osaka-等幅:h11:cSHIFTJIS
"set gfn=Fixedsys_Excelsior_2.00:h12:cANSI
set gfn=Terminal:h10:cSHIFTJIS
"set gfn=Osaka-等幅:h11:cSHIFTJIS
set gfw=Osaka-等幅:h11:cSHIFTJIS
set columns=120
set lines=50
" instead in /etc/vim/gvimrc
endif
highlight SpecialKey cterm=underline ctermfg=darkgrey
"highlight ZenkakuSpace cterm=underline ctermfg=lightblue guibg=white
highlight ZenkakuSpace guibg=DarkRed
"highlight ZenkakuSpace guibg=gray40
"match ZenkakuSpace / /
"認識されないケースがある
au BufNew,BufRead * match ZenkakuSpace / /
highlight NOTE1 cterm=bold ctermfg=Magenta guibg=Yellow guifg=Magenta
"match NOTE1 /NOTE/
au BufNew,BufRead * match NOTE1 /NOTE/
" dictionary
autocmd FileType perl :set dictionary=$HOME/vim71/runtime/syntax/perl.vim
autocmd FileType cgi :set dictionary=$HOME/vim71/runtime/syntax/perl.vim
autocmd FileType c :set dictionary=$HOME/vim71/runtime/syntax/c.vim
autocmd FileType sh :set dictionary=$HOME/vim71/runtime/syntax/shell.vim
autocmd FileType html :set dictionary=$HOME/vim71/runtime/syntax/html.vim
autocmd FileType php :set dictionary=$HOME/vim71/runtime/syntax/php.vim
autocmd FileType sql :set dictionary=$HOME/vim71/runtime/syntax/sql.vim
" Jeff's cscope settings
if has("cscope")
" set csprg=/usr/bin/cscope
set csprg=~/bin/cscope
set csto=0
set cst
set nocsverb
" add any database in current directory
if filereadable("cscope.out")
cs add cscope.out
" else add database pointed to by environment
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
set csverb
" Using 'CTRL-\' then a search type makes the vim window
" "shell-out", with search results displayed on the bottom
nmap
nmap
nmap
nmap
nmap
nmap
nmap
nmap
" Using 'CTRL-spacebar' then a search type makes the vim window
" split horizontally, with search result displayed in
" the new window.
nmap
nmap
nmap
nmap
nmap
nmap
nmap
nmap
" Hitting CTRL-space *twice* before the search type does a vertical
" split instead of a horizontal one
nmap
nmap
nmap
nmap
nmap
nmap
nmap
endif
Comments