.vimrc 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. " coding:utf-8
  2. " 検索時に大文字小文字を無視 (noignorecase:無視しない)
  3. set ignorecase
  4. " 大文字小文字の両方が含まれている場合は大文字小文字を区別
  5. set smartcase
  6. " タブの画面上での幅
  7. set tabstop=2
  8. " タブをスペースに展開しない (expandtab:展開する)
  9. set expandtab
  10. " 自動的にインデントする (noautoindent:インデントしない)
  11. set autoindent
  12. " バックスペースでインデントや改行を削除できるようにする
  13. set backspace=2
  14. " 検索時にファイルの最後まで行ったら最初に戻る (nowrapscan:戻らない)
  15. set wrapscan
  16. " 括弧入力時に対応する括弧を表示 (noshowmatch:表示しない)
  17. set showmatch
  18. " コマンドライン補完するときに強化されたものを使う(参照 :help wildmenu)
  19. set wildmenu
  20. " テキスト挿入中の自動折り返しを日本語に対応させる
  21. set formatoptions+=mM
  22. set softtabstop=2
  23. set shiftwidth=4
  24. set fileencodings=utf-8,cp932,euc-jp,default,latin
  25. " 行番号を非表示 (number:表示)
  26. set number
  27. " ルーラーを表示 (noruler:非表示)
  28. set ruler
  29. " タブや改行を表示 (list:表示)
  30. set nolist
  31. " 長い行を折り返して表示 (nowrap:折り返さない)
  32. set wrap
  33. " 常にステータス行を表示 (詳細は:he laststatus)
  34. set laststatus=2
  35. " コマンドラインの高さ (Windows用gvim使用時はgvimrcを編集すること)
  36. set cmdheight=2
  37. " コマンドをステータス行に表示
  38. set showcmd
  39. " タイトルを表示
  40. set title
  41. "シンタックスハイライトを有効にする
  42. syntax on
  43. " ファイル名に大文字小文字の区別がないシステム用の設定:
  44. " (例: DOS/Windows/MacOS)
  45. "
  46. if filereadable($VIM . '/vimrc') && filereadable($VIM . '/ViMrC')
  47. " tagsファイルの重複防止
  48. set tags=./tags,tags
  49. endif
  50. " コンソールでのカラー表示のための設定(暫定的にUNIX専用)
  51. if has('unix') && !has('gui_running')
  52. let uname = system('uname')
  53. if uname =~? "linux"
  54. set term=builtin_linux
  55. elseif uname =~? "freebsd"
  56. set term=builtin_cons25
  57. elseif uname =~? "Darwin"
  58. set term=beos-ansi
  59. else
  60. set term=builtin_xterm
  61. endif
  62. unlet uname
  63. endif
  64. " コンソール版で環境変数$DISPLAYが設定されていると起動が遅くなる件へ対応
  65. if !has('gui_running') && has('xterm_clipboard')
  66. set clipboard=exclude:cons\\\|linux\\\|cygwin\\\|rxvt\\\|screen
  67. endif
  68. " タブページの切り替えをWindowsのように
  69. " CTRL+Tab SHIFT+Tabで行うように.
  70. if v:version >= 700
  71. nnoremap <C-Tab> gt
  72. nnoremap <C-S-Tab> gT
  73. endif
  74. set nocompatible
  75. filetype off
  76. if has('vim_starting')
  77. set runtimepath+=~/.vim/neobundle.vim.git
  78. call neobundle#rc(expand('~/.bundle'))
  79. endif
  80. NeoBundle 'Shougo/echodoc.git'
  81. NeoBundle 'Shougo/neocomplcache.git'
  82. NeoBundle 'Shougo/neobundle.vim.git'
  83. NeoBundle 'Shougo/unite.vim.git'
  84. NeoBundle 'Shougo/vimfiler.git'
  85. NeoBundle 'Shougo/vimshell.git'
  86. NeoBundle 'Shougo/vimproc'
  87. NeoBundle 'thinca/vim-quickrun'
  88. NeoBundle 'tsukkee/lingr-vim'
  89. NeoBundle 'Shougo/neocomplcache-snippets-complete'
  90. NeoBundle 'browser.vim'
  91. NeoBundle 'synmark.vim'
  92. NeoBundle 'tyru/open-browser.vim'
  93. NeoBundle 'mattn/gist-vim'
  94. NeoBundle 'mattn/webapi-vim'
  95. NeoBundle 'mru.vim'
  96. NeoBundle 'thinca/vim-ft-clojure'
  97. NeoBundle 'ujihisa/neco-ghc'
  98. NeoBundle 'sudo.vim'
  99. NeoBundle 'ujihisa/vimshell-ssh'
  100. NeoBundle 'Shougo/unite-ssh'
  101. NeoBundle 'tyru/skkdict.vim'
  102. NeoBundle 'tyru/eskk.vim'
  103. NeoBundle 'ujihisa/neco-look'
  104. NeoBundle 'dag/vim2hs'
  105. NeoBundle 'eagletmt/ghcmod-vim'
  106. NeoBundle 'git://vim-latex.git.sourceforge.net/gitroot/vim-latex/vim-latex'
  107. filetype plugin indent on
  108. set ww+=h,l,>,<,[,]
  109. set mouse=a
  110. set ttymouse=xterm2
  111. set clipboard+=unnamed
  112. " ,is: シェルを起動
  113. nnoremap <silent> ,is :VimShell<CR>
  114. " ,ipy: pythonを非同期で起動
  115. nnoremap <silent> ,ipy :VimShellInteractive python<CR>
  116. " ,irb: irbを非同期で起動
  117. nnoremap <silent> ,irb :VimShellInteractive irb<CR>
  118. " ,ss: 非同期で開いたインタプリタに現在の行を評価させる
  119. vmap <silent> ,ss :VimShellSendString<CR>
  120. " 選択中に,ss: 非同期で開いたインタプリタに選択行を評価させる
  121. nnoremap <silent> ,ss <S-v>:VimShellSendString<CR>
  122. let g:neocomplcache_enable_at_startup = 1
  123. "tabで補完候補の選択を行う
  124. inoremap <expr><TAB> pumvisible() ? "\<Down>" : "\<TAB>"
  125. inoremap <expr><S-TAB> pumvisible() ? "\<Up>" : "\<S-TAB>"
  126. let g:netrw_nogx = 1 " disable netrw's gx mapping.
  127. nmap gx <Plug>(openbrowser-smart-search)
  128. vmap gx <Plug>(openbrowser-smart-search)
  129. augroup plugin-lingr-vim
  130. autocmd!
  131. autocmd FileType lingr-messages nmap <silent> <buffer> t <Plug>(lingr-messages-show-say-buffer)
  132. autocmd FileType lingr-say let &syntax='clojure'
  133. augroup END
  134. augroup vimrc
  135. autocmd!
  136. augroup END
  137. function! s:SID_PREFIX()
  138. return matchstr(expand('<sfile>'), '<SNR>\d\+_')
  139. endfunction
  140. set titlelen=100
  141. set guioptions-=e
  142. autocmd vimrc BufEnter * let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  143. autocmd vimrc User plugin-lingr-unread let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  144. if exists('$TMUX') || exists('$WINDOW')
  145. set t_ts=k
  146. set t_fs=\
  147. endif
  148. function! s:titlestring()
  149. if &filetype =~ '^lingr'
  150. let &titlestring = 'lingr: ' . lingr#unread_count()
  151. else
  152. let &titlestring = bufname('')
  153. endif
  154. endfunction
  155. " tabline
  156. set showtabline=2 " always show tabline
  157. let &tabline = '%!' . s:SID_PREFIX() . 'tabline()'
  158. function! s:tabline()
  159. " show each tab
  160. let s = ''
  161. for i in range(1, tabpagenr('$'))
  162. let list = tabpagebuflist(i)
  163. let nr = tabpagewinnr(i)
  164. let current_tabnr = tabpagenr()
  165. "let title = bufname('')
  166. if i == current_tabnr
  167. let title = fnamemodify(getcwd(), ':t') . '/'
  168. "let title = bufname('')
  169. else
  170. let title = fnamemodify(gettabvar(i, 'cwd'), ':t') . '/'
  171. endif
  172. let title = empty(title) ? '[No Name]' : title
  173. let s .= i == current_tabnr ? '%#TabLineSel#' : '%#TabLine#'
  174. let s .= '%' . i . 'T[' . i . '] ' . title
  175. let s .= ' '
  176. endfor
  177. " show lingr unread count
  178. let lingr_unread = ""
  179. if exists('*lingr#unread_count')
  180. let lingr_unread_count = lingr#unread_count()
  181. if lingr_unread_count > 0
  182. let lingr_unread = "%#ErrorMsg#(" . lingr_unread_count . ")"
  183. elseif lingr_unread_count == 0
  184. let lingr_unread = "()"
  185. endif
  186. endif
  187. " build tabline
  188. let s .= '%#TabLineFill#%T%=%<[' . getcwd() . ']' . lingr_unread
  189. return s
  190. endfunction
  191. let g:github_user = 'raa0121'
  192. let g:github_token = 'e3ded9cf6669cc31dbca'
  193. let g:eskk#directory = "~/.eskk"
  194. let g:eskk#dictionary = { 'path': "~/.skk-jisyo", 'sorted': 0, 'encoding': 'utf-8', }
  195. let g:eskk#large_dictionary = { 'path': "~/.eskk/SKK-JISYO.L", 'sorted': 1, 'encoding': 'euc-jp', }
  196. let g:eskk#enable_completion = 1
  197. " latex
  198. set shellslash
  199. set grepprg=grep\ -nH\ $*
  200. let g:tex_flavor='tex'
  201. let g:Tex_CompileRule_div = 'platex --interaction=nonstopmode $*'
  202. let g:Tex_BibtexFlavor = 'jbibtex'
  203. let g:Tex_ViewRule_dvi = '/cygdrive/c/texlive/2012/bin/win32/dviout.exe'
  204. let g:Tex_FormatDependency_pdf = 'dvi,pdf'
  205. let g:Tex_CompileRule_pdf = 'dvipdfmx $*.dvi'
  206. let g:Tex_ViewRule_pdf = '/cygdrive/d/Program/SumatraPDF/SumatraPDF.exe'
  207. " set imdisable