.vimrc 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  1. " coding:utf-8
  2. " ζ*'ヮ')ζ ζ(*'ヮ'リ+
  3. "
  4. set ignorecase
  5. set smartcase
  6. set tabstop=2
  7. set expandtab
  8. set autoindent
  9. set backspace=2
  10. set wrapscan
  11. set showmatch
  12. set wildmenu
  13. set formatoptions+=mM
  14. set softtabstop=2
  15. set shiftwidth=4
  16. set fileencodings=utf-8,cp932,euc-jp,default,latin
  17. set number
  18. set ruler
  19. set nolist
  20. set wrap
  21. set laststatus=2
  22. set cmdheight=2
  23. set showcmd
  24. set title
  25. syntax on
  26. " ファイル名に大文字小文字の区別がないシステム用の設定:
  27. " (例: DOS/Windows/MacOS)
  28. "
  29. if filereadable($VIM . '/vimrc') && filereadable($VIM . '/ViMrC')
  30. " tagsファイルの重複防止
  31. set tags=./tags,tags
  32. endif
  33. " コンソールでのカラー表示のための設定(暫定的にUNIX専用)
  34. if has('unix') && !has('gui_running')
  35. let uname = system('uname')
  36. if uname =~? "linux"
  37. set term=builtin_linux
  38. elseif uname =~? "freebsd"
  39. set term=builtin_cons25
  40. elseif uname =~? "Darwin"
  41. set term=beos-ansi
  42. else
  43. set term=builtin_xterm
  44. endif
  45. unlet uname
  46. endif
  47. " コンソール版で環境変数$DISPLAYが設定されていると起動が遅くなる件へ対応
  48. if !has('gui_running') && has('xterm_clipboard')
  49. set clipboard=exclude:cons\\\|linux\\\|cygwin\\\|rxvt\\\|screen
  50. endif
  51. " タブページの切り替えをWindowsのように
  52. " CTRL+Tab SHIFT+Tabで行うように.
  53. if v:version >= 700
  54. nnoremap <C-Tab> gt
  55. nnoremap <C-S-Tab> gT
  56. endif
  57. set nocompatible
  58. filetype off
  59. if has('vim_starting')
  60. set runtimepath+=~/.vim/neobundle.vim.git
  61. endif
  62. call neobundle#rc(expand('~/.bundle'))
  63. NeoBundle 'Shougo/echodoc.git'
  64. NeoBundle 'Shougo/neocomplcache.git'
  65. NeoBundle 'Shougo/neocomplcache-rsense'
  66. NeoBundle 'Shougo/neobundle.vim.git'
  67. NeoBundle 'Shougo/unite.vim.git'
  68. NeoBundle 'Shougo/vimfiler.git'
  69. NeoBundle 'Shougo/vimshell.git'
  70. NeoBundle 'Shougo/vimproc'
  71. NeoBundle 'thinca/vim-quickrun'
  72. NeoBundle 'tsukkee/lingr-vim'
  73. NeoBundle 'Shougo/neosnippet'
  74. NeoBundle 'browser.vim'
  75. NeoBundle 'synmark.vim'
  76. NeoBundle 'tyru/open-browser.vim'
  77. NeoBundle 'mattn/gist-vim'
  78. NeoBundle 'mattn/webapi-vim'
  79. NeoBundle 'mru.vim'
  80. NeoBundle 'thinca/vim-ft-clojure'
  81. NeoBundle 'ujihisa/neco-ghc'
  82. NeoBundle 'sudo.vim'
  83. NeoBundle 'ujihisa/vimshell-ssh'
  84. NeoBundle 'Shougo/unite-ssh'
  85. NeoBundle 'ujihisa/neco-look'
  86. NeoBundle 'vim-jp/vital.vim'
  87. NeoBundle 'dag/vim2hs'
  88. NeoBundle 'eagletmt/ghcmod-vim'
  89. NeoBundle 'git://vim-latex.git.sourceforge.net/gitroot/vim-latex/vim-latex'
  90. NeoBundle 'thinca/vim-singleton'
  91. NeoBundle 'mattn/benchvimrc-vim'
  92. NeoBundle 'ryutorion/vim-itunes'
  93. NeoBundle 'git@github.com:raa0121/vim-ulilith'
  94. NeoBundle 'mattn/libcallex-vim'
  95. NeoBundle 'thinca/vim-splash'
  96. NeoBundle 'mattn/sonictemplate-vim'
  97. NeoBundle 'raa0121/vim-eclim'
  98. NeoBundle 'thinca/vim-github'
  99. filetype plugin indent on
  100. if has('clientserver')
  101. call singleton#enable()
  102. end
  103. set ww+=h,l,>,<,[,]
  104. set mouse=a
  105. set ttymouse=xterm2
  106. set clipboard=unnamedplus
  107. " ,is: シェルを起動
  108. nnoremap <silent> ,is :VimShell<CR>
  109. " ,ipy: pythonを非同期で起動
  110. nnoremap <silent> ,ipy :VimShellInteractive python<CR>
  111. " ,irb: irbを非同期で起動
  112. nnoremap <silent> ,irb :VimShellInteractive irb<CR>
  113. " ,ss: 非同期で開いたインタプリタに現在の行を評価させる
  114. vmap <silent> ,ss :VimShellSendString<CR>
  115. " 選択中に,ss: 非同期で開いたインタプリタに選択行を評価させる
  116. nnoremap <silent> ,ss <S-v>:VimShellSendString<CR>
  117. " ,vs: vimshell
  118. nnoremap <silent> ,vs :tabnew +VimShell<CR>
  119. " ,vr: .vimrc
  120. nnoremap <silent> ,vr :tabnew ~/.vimrc<CR>
  121. nnoremap <silent> ,so :so ~/.vimrc<CR>
  122. nnoremap <silent> ,nu :tabnew +Unite\ neobundle/update<CR>
  123. nnoremap <silent> ,ll :tabnew +LingrLaunch
  124. " Disable AutoComplPop. Comment out this line if AutoComplPop is not
  125. " installed.
  126. let g:acp_enableAtStartup = 0
  127. " " Launches neocomplcache automatically on vim startup.
  128. let g:neocomplcache_enable_at_startup = 1
  129. " " Use smartcase.
  130. let g:neocomplcache_enable_smart_case = 1
  131. " " Use camel case completion.
  132. let g:neocomplcache_enable_camel_case_completion = 1
  133. " " Use underscore completion.
  134. let g:neocomplcache_enable_underbar_completion = 1
  135. " " Sets minimum char length of syntax keyword.
  136. let g:neocomplcache_min_syntax_length = 3
  137. let g:vimfiler_as_default_explorer = 1
  138. let g:neocomplcache#sources#rsense#home_directory = '/opt/rsense-0.3/'
  139. "tabで補完候補の選択を行う
  140. inoremap <expr><TAB> pumvisible() ? "\<Down>" : "\<TAB>"
  141. inoremap <expr><S-TAB> pumvisible() ? "\<Up>" : "\<S-TAB>"
  142. let g:netrw_nogx = 1
  143. nmap gx <Plug>(openbrowser-smart-search)
  144. vmap gx <Plug>(openbrowser-smart-search)
  145. let g:quickrun_config = {}
  146. let g:quickrun_config['markdown'] = {
  147. \ 'outputter': 'browser'
  148. \ }
  149. let g:lingr_vim_footer = ' [vim]'
  150. augroup plugin-lingr-vim
  151. autocmd!
  152. autocmd FileType lingr-messages nmap <silent> <buffer> t <Plug>(lingr-messages-show-say-buffer)
  153. autocmd FileType lingr-say let &syntax='clojure'
  154. augroup END
  155. augroup vimrc
  156. autocmd!
  157. augroup END
  158. function! s:SID_PREFIX()
  159. return matchstr(expand('<sfile>'), '<SNR>\d\+_')
  160. endfunction
  161. set titlelen=100
  162. set guioptions-=e
  163. autocmd vimrc BufEnter * let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  164. autocmd vimrc User plugin-lingr-unread let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  165. if exists('$TMUX') || exists('$WINDOW')
  166. set t_ts=k
  167. set t_fs=\
  168. endif
  169. function! s:titlestring()
  170. if &filetype =~ '^lingr'
  171. let &titlestring = 'lingr: ' . lingr#unread_count()
  172. else
  173. let &titlestring = bufname('')
  174. endif
  175. endfunction
  176. " tabline
  177. set showtabline=2 " always show tabline
  178. let &tabline = '%!' . s:SID_PREFIX() . 'tabline()'
  179. function! s:tabline()
  180. " show each tab
  181. let s = ''
  182. for i in range(1, tabpagenr('$'))
  183. let list = tabpagebuflist(i)
  184. let nr = tabpagewinnr(i)
  185. let current_tabnr = tabpagenr()
  186. "let title = bufname('')
  187. if i == current_tabnr
  188. let title = fnamemodify(getcwd(), ':t') . '/'
  189. "let title = bufname('')
  190. else
  191. let title = fnamemodify(gettabvar(i, 'cwd'), ':t') . '/'
  192. endif
  193. let title = empty(title) ? '[No Name]' : title
  194. let s .= i == current_tabnr ? '%#TabLineSel#' : '%#TabLine#'
  195. let s .= '%' . i . 'T[' . i . '] ' . title
  196. let s .= ' '
  197. endfor
  198. " show lingr unread count
  199. let lingr_unread = ""
  200. if exists('*lingr#unread_count')
  201. let lingr_unread_count = lingr#unread_count()
  202. if lingr_unread_count > 0
  203. let lingr_unread = "%#ErrorMsg#(" . lingr_unread_count . ")"
  204. elseif lingr_unread_count == 0
  205. let lingr_unread = "()"
  206. endif
  207. endif
  208. " build tabline
  209. let s .= '%#TabLineFill#%T%=%<[' . getcwd() . ']' . lingr_unread
  210. return s
  211. endfunction
  212. let g:github_user = 'raa0121'
  213. let g:github_token = 'e3ded9cf6669cc31dbca'
  214. set shellslash
  215. set grepprg=grep\ -nH\ $*
  216. let g:tex_flavor='tex'
  217. let g:Tex_CompileRule_div = 'platex --interaction=nonstopmode $*'
  218. let g:Tex_BibtexFlavor = 'jbibtex'
  219. let g:Tex_ViewRule_dvi = '/cygdrive/c/texlive/2012/bin/win32/dviout.exe'
  220. let g:Tex_FormatDependency_pdf = 'dvi,pdf'
  221. let g:Tex_CompileRule_pdf = 'dvipdfmx $*.dvi'
  222. let g:Tex_ViewRule_pdf = '/cygdrive/d/Program/SumatraPDF/SumatraPDF.exe'