.vimrc 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. so $VIMRUNTIME/mswin.vim
  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 'git://github.com/Shougo/echodoc.git'
  81. NeoBundle 'git://github.com/Shougo/neocomplcache.git'
  82. NeoBundle 'git://github.com/Shougo/neobundle.vim.git'
  83. NeoBundle 'git://github.com/Shougo/unite.vim.git'
  84. "NeoBundle 'git://github.com/Shougo/vim-vcs.git'
  85. NeoBundle 'git://github.com/Shougo/vimfiler.git'
  86. NeoBundle 'git://github.com/Shougo/vimshell.git'
  87. "NeoBundle 'git://github.com/Shougo/vinarise.git'
  88. NeoBundle 'Shougo/vimproc'
  89. NeoBundle 'thinca/vim-quickrun'
  90. NeoBundle 'tsukkee/lingr-vim'
  91. NeoBundle 'Shougo/neocomplcache-snippets-complete'
  92. NeoBundle 'browser.vim'
  93. NeoBundle 'synmark.vim'
  94. NeoBundle 'tyru/open-browser.vim'
  95. NeoBundle 'mattn/gist-vim'
  96. NeoBundle 'mattn/webapi-vim'
  97. NeoBundle 'mru.vim'
  98. NeoBundle 'VimClojure'
  99. NeoBundle 'ujihisa/neco-ghc'
  100. filetype plugin on
  101. filetype indent on
  102. set ww+=h,l,>,<,[,]
  103. set mouse=a
  104. set ttymouse=xterm2
  105. set clipboard+=unnamed
  106. " ,is: シェルを起動
  107. nnoremap <silent> ,is :VimShell<CR>
  108. " ,ipy: pythonを非同期で起動
  109. nnoremap <silent> ,ipy :VimShellInteractive python<CR>
  110. " ,irb: irbを非同期で起動
  111. nnoremap <silent> ,irb :VimShellInteractive irb<CR>
  112. " ,ss: 非同期で開いたインタプリタに現在の行を評価させる
  113. vmap <silent> ,ss :VimShellSendString<CR>
  114. " 選択中に,ss: 非同期で開いたインタプリタに選択行を評価させる
  115. nnoremap <silent> ,ss <S-v>:VimShellSendString<CR>
  116. let g:neocomplcache_enable_at_startup = 1
  117. "tabで補完候補の選択を行う
  118. inoremap <expr><TAB> pumvisible() ? "\<Down>" : "\<TAB>"
  119. inoremap <expr><S-TAB> pumvisible() ? "\<Up>" : "\<S-TAB>"
  120. let g:netrw_nogx = 1 " disable netrw's gx mapping.
  121. nmap gx <Plug>(openbrowser-smart-search)
  122. vmap gx <Plug>(openbrowser-smart-search)
  123. if has('win32') || has('win64')
  124. let g:quickrun_config = { }
  125. let g:quickrun_config['cs'] = {
  126. \ 'command' : 'c:/Windows/Microsoft.NET/Framework/v4.0.30319/csc.exe',
  127. \ 'runmode' : 'simple',
  128. \ 'exec' : ['%c /nologo %s:gs?/?\\? > /dev/null', '"%S:p:r:gs?/?\\?.exe" %a', ':call delete("%S:p:r.exe")'],
  129. \ 'tempfile' : '{tempname()}.cs',
  130. \ }
  131. endif
  132. augroup plugin-lingr-vim
  133. autocmd!
  134. autocmd FileType lingr-messages nmap <silent> <buffer> t <Plug>(lingr-messages-show-say-buffer)
  135. autocmd FileType lingr-say let &syntax='clojure'
  136. augroup END
  137. augroup vimrc
  138. autocmd!
  139. augroup END
  140. function! s:SID_PREFIX()
  141. return matchstr(expand('<sfile>'), '<SNR>\d\+_')
  142. endfunction
  143. set titlelen=100
  144. set guioptions-=e
  145. autocmd vimrc BufEnter * let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  146. autocmd vimrc User plugin-lingr-unread let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  147. if exists('$TMUX') || exists('$WINDOW')
  148. set t_ts=k
  149. set t_fs=\
  150. endif
  151. function! s:titlestring()
  152. if &filetype =~ '^lingr'
  153. let &titlestring = 'lingr: ' . lingr#unread_count()
  154. else
  155. let &titlestring = bufname('')
  156. endif
  157. endfunction
  158. " tabline
  159. set showtabline=2 " always show tabline
  160. let &tabline = '%!' . s:SID_PREFIX() . 'tabline()'
  161. function! s:tabline()
  162. " show each tab
  163. let s = ''
  164. for i in range(1, tabpagenr('$'))
  165. let list = tabpagebuflist(i)
  166. let nr = tabpagewinnr(i)
  167. let current_tabnr = tabpagenr()
  168. "let title = bufname('')
  169. if i == current_tabnr
  170. let title = fnamemodify(getcwd(), ':t') . '/'
  171. "let title = bufname('')
  172. else
  173. let title = fnamemodify(gettabvar(i, 'cwd'), ':t') . '/'
  174. endif
  175. let title = empty(title) ? '[No Name]' : title
  176. let s .= i == current_tabnr ? '%#TabLineSel#' : '%#TabLine#'
  177. let s .= '%' . i . 'T[' . i . '] ' . title
  178. let s .= ' '
  179. endfor
  180. " show lingr unread count
  181. let lingr_unread = ""
  182. if exists('*lingr#unread_count')
  183. let lingr_unread_count = lingr#unread_count()
  184. if lingr_unread_count > 0
  185. let lingr_unread = "%#ErrorMsg#(" . lingr_unread_count . ")"
  186. elseif lingr_unread_count == 0
  187. let lingr_unread = "()"
  188. endif
  189. endif
  190. " build tabline
  191. let s .= '%#TabLineFill#%T%=%<[' . getcwd() . ']' . lingr_unread
  192. return s
  193. endfunction
  194. let g:github_user = 'raa0121'
  195. let g:github_token = 'e3ded9cf6669cc31dbca'
  196. let vimclojure#HighlightBuiltins = 1
  197. let vimclojure#ParenRainbow = 1
  198. let vimclojure#connector#nailgun#Client = "/usr/bin/ng"
  199. if executable('pdftotext')
  200. command! -complete=file -nargs=1 Pdf :r !pdftotext -nopgbrk -layout <q-args> -
  201. endif