" -------------------------------------------------------------- " 日本語マニュアル " -------------------------------------------------------------- set runtimepath+=~\Desktop\Vim\vimdoc-ja-master set helplang=ja,en " -------------------------------------------------------------- " フォント " -------------------------------------------------------------- set guifont=BIZ_UDゴシック:h12 " -------------------------------------------------------------- " 表示幅設定 " ギリシャ・キリル・CJK漢字・かな・絵文字等 (0x0370 - 0xFF60) " 半角カナ直後から全Unicodeの末尾まで (0xFFA0 - 0x10FFFF) " -------------------------------------------------------------- call setcellwidths([ \ [0x0370, 0xff60, 2], \ [0xffa0, 0x10ffff, 2] \ ]) " -------------------------------------------------------------- " 画面の表示位置 " -------------------------------------------------------------- " ウィンドウ情報を保存するファイルのパス let g:save_window_file = expand('~/Desktop/vim/_gvimwinpos') augroup SaveWindow autocmd! autocmd VimLeavePre * call s:save_window() augroup END function! s:save_window() abort let options = [ \ 'set columns=' . &columns, \ 'set lines=' . &lines, \ 'winpos ' . getwinposx() . ' ' . getwinposy(), \ ] call writefile(options, g:save_window_file) endfunction " 保存ファイルが存在する場合は読み込んで位置・サイズを復元 if filereadable(g:save_window_file) execute 'source' g:save_window_file endif " -------------------------------------------------------------- " 画面の表示色 " -------------------------------------------------------------- if has('gui_running') colorscheme desert else colorscheme blue endif set background=dark syntax on " -------------------------------------------------------------- " 検索 " -------------------------------------------------------------- " 大文字小文字を無視するが、検索文字に大文字が混じったら無視しない set ignorecase set smartcase " 検索中に同じ単語をハイライト表示 set hlsearch " -------------------------------------------------------------- " インデント " -------------------------------------------------------------- " オートインデントを利用する set autoindent " 古いインデント機能は使わない set nosmartindent set nocindent " ファイルタイプを見てインデント方式を変える機能を使う filetype plugin indent on " Markdownファイルのインデント autocmd FileType markdown setlocal expandtab shiftwidth=4 tabstop=4 softtabstop=4 " -------------------------------------------------------------- " ベル " -------------------------------------------------------------- set belloff=all set visualbell t_vb= " -------------------------------------------------------------- " 日本語入力のコントロール " -------------------------------------------------------------- " 前回のIMEの状態を保存 let s:lastiminsert = 0 " Insertモード終了時 autocmd InsertLeave * \ if v:insertmode !=# 'r' | \ let s:lastiminsert = &iminsert | \ set iminsert=0 | \ endif " Insertモード開始時 autocmd InsertEnter * \ if v:insertmode ==# 'i' | \ let &iminsert = s:lastiminsert | \ endif