You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 年之前
12 年之前
12 年之前
12 年之前
12 年之前
12 年之前
12 年之前
12 年之前
12 年之前
12 年之前
12 年之前
12 年之前
12 年之前
12 年之前
12 年之前
12 年之前
12 年之前
12 年之前
12 年之前
12 年之前
12 年之前
12 年之前
12 年之前
12 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. " 外部ファイル読み込み
  2. " if filereadable(expand('~/filepath'))
  3. " source ~/filepath
  4. " endif
  5. if !isdirectory(expand('~/.vim'))
  6. call mkdir(expand('~/.vim'))
  7. endif
  8. """""""""""""""""""""""""""""""""""
  9. set compatible " vi compatible
  10. " バックアップファイルを作るディレクトリ
  11. if !isdirectory(expand('~/.vim/backup'))
  12. call mkdir(expand('~/.vim/backup'))
  13. endif
  14. set backup " バックアップ
  15. set backupdir=$HOME/.vim/backup
  16. set swapfile " スワップファイル用のディレクトリ
  17. set directory=$HOME/.vim/backup
  18. set viminfo+=n~/.vim/viminfo " viminfo
  19. set list " タブ文字、行末など不可視文字を表示する
  20. set listchars=tab:>-,extends:<,trail:-,eol:$ " listで表示される文字のフォーマットを指定する
  21. set showmatch " 閉じ括弧が入力されたとき、対応する括弧を表示する
  22. "set whichwrap=b,s,h,l,<,>,[,] " カーソルを行頭、行末で止まらないようにする
  23. set showmode " モード表示
  24. set title " display editting file on titlebar
  25. "set incsearch
  26. set wrapscan " 折り返し検索
  27. set showmatch " 括弧を閉じた時、対になる括弧を一瞬ハイライトする
  28. set ignorecase
  29. set smartcase " 検索時に大文字を含んでいたら大/小を区別
  30. set incsearch
  31. set wildmode=longest,list,full
  32. set ruler " 行番号、カーソル位置を表示
  33. set nonumber " do not show line number at left side
  34. "set laststatus=2 " ステータスラインを常に表示
  35. set showcmd
  36. set scrolloff=2 " 常に前後2行を表示
  37. syntax enable " シンタックス
  38. set hidden " 編集中でも他ファイルへ移動可
  39. "set backspace=indent,eol,start " バックスペースでなんでも消せるように
  40. "set autochdir " 自動的にカレントディレクトリを現在のファイルのディレクトリにする macだと出来ないってゆわれた
  41. set encoding=utf-8 " 言語設定
  42. set fileencodings=utf-8,shift-jis,euc-jp,latin1
  43. set mouse=h " マウス使わない
  44. set clipboard+=unnamed " クリップボードをWindowsと連携
  45. set visualbell " ビープしない
  46. set browsedir=buffer " バッファで開いているファイルのディレクトリ
  47. set tabstop=4 " タブの画面上での幅
  48. set softtabstop=4
  49. set shiftwidth=4 " width of indent
  50. set expandtab " タブをスペースに展開する
  51. set autoindent " オートインデント
  52. set smartindent
  53. set cindent
  54. filetype plugin indent on
  55. let g:netrw_liststyle = 1
  56. let g:netrw_list_hide = '\(^\|\s\s\)\zs\.\S\+'
  57. " gvimrc分けるのめんどい
  58. if has('gui_running')
  59. " ツールバー、スクロールバー消す
  60. set guioptions-=T
  61. set guioptions-=r
  62. set lines=45
  63. set columns=110
  64. set guifont=DejaVu\ Sans\ Mono\ 9
  65. endif
  66. if has('win32')
  67. " prefs for Windows
  68. endif
  69. """""""""""""""""""""""""""""""""""""""
  70. " マップ
  71. " imap <c-j> <esc> でC-Jをescにできる。?
  72. " nmap
  73. " vmap
  74. " map でそれぞれのモードでマップを指定
  75. " キーマッピングには大きく分けて map と noremap の 2 つの種類があります。
  76. " * map はキーシーケンスを展開したあと、さらに別のマップを適用しようとします。
  77. " * noremap は一度だけ展開します。
  78. " →マップを再帰的に展開するときはmap、決め打ちはnoremap(キーの入れ替えなど)
  79. " 割と保存
  80. inoremap <ESC> <ESC>:<C-u>w<CR>
  81. inoremap <C-c> <ESC>:<C-u>w<CR>
  82. noremap <C-c> <ESC>:<C-u>w<CR>
  83. " highlight current line
  84. " set cursorline
  85. " カレントウィンドウにのみ罫線を引く
  86. augroup cch
  87. autocmd! cch
  88. autocmd WinLeave * set nocursorline
  89. autocmd WinEnter,BufRead * set cursorline
  90. augroup END
  91. hi clear CursorLine
  92. highlight CursorLine term=underline cterm=underline gui=underline
  93. " 入力モード時、ステータスラインのカラーを変更
  94. augroup InsertHook
  95. autocmd!
  96. autocmd InsertEnter * highlight StatusLine guifg=#ccdc90 guibg=#2E4340
  97. autocmd InsertLeave * highlight StatusLine guifg=#2E4340 guibg=#ccdc90
  98. augroup END
  99. " save window position and size
  100. if has('gui_running')
  101. let g:save_window_file = expand('~/.vimwinpos')
  102. augroup SaveWindow
  103. autocmd!
  104. autocmd VimLeavePre * call s:save_window()
  105. function! s:save_window()
  106. let options = [
  107. \ 'set columns=' . &columns,
  108. \ 'set lines=' . &lines,
  109. \ 'winpos ' . getwinposx() . ' ' . getwinposy(),
  110. \ ]
  111. call writefile(options, g:save_window_file)
  112. endfunction
  113. augroup END
  114. if filereadable(g:save_window_file)
  115. execute 'source' g:save_window_file
  116. endif
  117. endif