syntax on
set nocompatible
set laststatus=2
set statusline=[%n]%F\ \ \ \ \ \|%{(&fenc!=''?&fenc:&enc).'\|'.&ff.'\|'}%m%r%=<%l/%L>
if exists('&ambiwidth')
set ambiwidth=double
endif
set ambiwidth=double
set ignorecase
set smartcase
set backspace=indent,eol,start
set autoread
set noswapfile
set hidden
set formatoptions=lmoq
set ts=4
set shiftwidth=4
set expandtab
set guicursor=a:blinkon0
set ruler
set sm
let loaded_matchparen = 1
set list
set listchars=tab:>.,trail:_,extends:>,precedes:<" 不可視文字の表示形式
set display=uhex
hi NonText ctermfg=darkgray
hi Folded ctermfg=blue
hi SpecialKey cterm=underline ctermfg=darkgray
hi Folded term=standout cterm=bold ctermfg=4 ctermbg=0
hi Pmenu cterm=bold ctermfg=4 ctermbg=7
hi PmenuSel cterm=bold ctermfg=0 ctermbg=6
hi PmenuSbar ctermfg=4 ctermbg=7
hi Search term=NONE cterm=NONE ctermfg=black ctermbg=LightGray
hi Search ctermbg = 4 ctermfg = 7
hi TabLineSel term=bold cterm=bold,underline ctermfg=7 ctermbg=0
hi TabLineFill ctermfg=white ctermbg=black
hi StatusLine term=NONE cterm=NONE ctermfg=black ctermbg=white
hi MatchParen term=standout ctermbg=LightGrey ctermfg=Black guibg=LightGrey guifg=Black
noremap j gj
noremap k gk
vnoremap j gj
vnoremap k gk
nmap n nzz
nmap N Nzz
nmap * *zz
nmap # #zz
nmap g* g*zz
nmap g# g#zz
nnoremap <C-h> gT
nnoremap <C-l> gt
nnoremap <Leader>1 1gt
nnoremap <Leader>2 2gt
nnoremap <Leader>3 3gt
nnoremap <Leader>4 4gt
nnoremap <Leader>5 5gt
nnoremap <Leader>6 6gt
nnoremap <Leader>7 7gt
nnoremap <Leader>8 8gt
nnoremap <Leader>9 9gt
set wildmenu
set wildchar=<tab>
set wildmode=list:full
set history=1000
function! InsertTabWrapper()
let col = col('.') - 1
if !col || getline('.')[col - 1] !~ '\k'
return "\<TAB>"
else
return "\<C-N>"
endif
endfunction
inoremap <tab> <c-r>=InsertTabWrapper()<cr>
set wrapscan
set ignorecase
set smartcase
set incsearch
set hlsearch
vnoremap <silent> // y/<C-R>=escape(@", '\\/.*$^~[]')<CR><CR>
vnoremap /r "xy:%s/<C-R>=escape(@x, '\\/.*$^~[]')<CR>//gc<Left><Left><Left>
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>#
if has("syntax")
syntax on
function! ActivateInvisibleIndicator()
syntax match InvisibleJISX0208Space " " display containedin=ALL
highlight InvisibleJISX0208Space term=underline ctermbg=Blue guifg=#999999 gui=underline
syntax match InvisibleTrailedSpace "[ ]\+$" display containedin=ALL
highlight InvisibleTrailedSpace term=underline ctermbg=Red guifg=#FF5555 gui=underline
syntax match InvisibleTab "\t" display containedin=ALL
highlight InvisibleTab term=underline ctermbg=Cyan guibg=#555555
endf
augroup invisible
autocmd! invisible
autocmd BufNew,BufRead * call ActivateInvisibleIndicator()
augroup END
endif
nmap <Tab> :tabn<CR>
nmap <C-t> :tabnew_
set showtabline=2
set tabline=%!MyTabLine()
function MyTabLine()
let s = ''
for i in range(tabpagenr('$'))
if i + 1 == tabpagenr()
let s .= '%#TabLineSel#'
else
let s .= '%#TabLine#'
endif
let s .= '%' . (i+1) . 'T'
let s .= ' ' . (i+1) . (1==getwinvar(i+1,'&modified')?'[+]':'') . ' %{MyTabLabel(' . (i+1) . ')} '
endfor
let s .= '%#TabLineFill#%T'
if tabpagenr('$') > 1
let s .= '%=%#TabLine#%999Xclose'
endif
return s
endfunction
function MyTabLabel(n)
let buflist = tabpagebuflist(a:n)
let winnr = tabpagewinnr(a:n)
return bufname(buflist[winnr - 1])
endfunction
let howm_dir = '~/.vim/howm/'
let howm_filename = '%Y/%m/%Y-%m-%d-%H%M%S.howm'
let howm_fileencoding = 'utf-8'
let howm_fileformat = 'unix'
let mygrepprg = 'grep'
let MyGrep_ShellEncoding = 'utf-8'
let g:yankring_history_dir = "~/.vim/tmp/"
nmap ,y :YRShow<CR>
noremap! <7f> <08>
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'
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'
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
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
if has('autocmd')
function! AU_ReCheck_FENC()
if &fileencoding =~# 'iso-2022-jp' && search("[^\x01-\x7e]", 'n') == 0
let &fileencoding=&encoding
endif
endif
unlet s:enc_euc
unlet s:enc_jis
endif
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