#.vimrc# 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267
  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. NeoBundle 'nosami/Omnisharp'
  100. filetype plugin indent on
  101. if has('clientserver')
  102. call singleton#enable()
  103. end
  104. set ww+=h,l,>,<,[,]
  105. set mouse=a
  106. set ttymouse=xterm2
  107. set clipboard=unnamedplus
  108. " ,is: シェルを起動
  109. nnoremap <silent> ,is :VimShell<CR>
  110. " ,ipy: pythonを非同期で起動
  111. nnoremap <silent> ,ipy :VimShellInteractive python<CR>
  112. " ,irb: irbを非同期で起動
  113. nnoremap <silent> ,irb :VimShellInteractive irb<CR>
  114. " ,ss: 非同期で開いたインタプリタに現在の行を評価させる
  115. vmap <silent> ,ss :VimShellSendString<CR>
  116. " 選択中に,ss: 非同期で開いたインタプリタに選択行を評価させる
  117. nnoremap <silent> ,ss <S-v>:VimShellSendString<CR>
  118. " ,vs: vimshell
  119. nnoremap <silent> ,vs :tabnew +VimShell<CR>
  120. " ,vr: .vimrc
  121. nnoremap <silent> ,vr :tabnew ~/.vimrc<CR>
  122. nnoremap <silent> ,so :so ~/.vimrc<CR>
  123. nnoremap <silent> ,nu :tabnew +Unite\ neobundle/update<CR>
  124. nnoremap <silent> ,ll :tabnew +LingrLaunch
  125. " Disable AutoComplPop. Comment out this line if AutoComplPop is not
  126. " installed.
  127. let g:acp_enableAtStartup = 0
  128. " Launches neocomplcache automatically on vim startup.
  129. let g:neocomplcache_enable_at_startup = 1
  130. " Use smartcase.
  131. let g:neocomplcache_enable_smart_case = 1
  132. " Use camel case completion.
  133. let g:neocomplcache_enable_camel_case_completion = 1
  134. " Use underscore completion.
  135. let g:neocomplcache_enable_underbar_completion = 1
  136. " Sets minimum char length of syntax keyword.
  137. let g:neocomplcache_min_syntax_length = 3
  138. let g:vimfiler_as_default_explorer = 1
  139. let g:neocomplcache#sources#rsense#home_directory = '/opt/rsense-0.3/'
  140. let g:neocomplcache_text_mode_filetypes = {
  141. \ 'tex': 1,
  142. \ 'plaintex': 1,
  143. \}
  144. "tabで補完候補の選択を行う
  145. inoremap <expr><TAB> pumvisible() ? "\<Down>" : "\<TAB>"
  146. inoremap <expr><S-TAB> pumvisible() ? "\<Up>" : "\<S-TAB>"
  147. let g:OmniSharp_host = "http://localhost:2000"
  148. let g:OmniSharp_typeLookupInPreview = 1
  149. setlocal omnifunc=OmniSharp#Complete
  150. set noshowmatch
  151. let g:netrw_nogx = 1
  152. nmap gx <Plug>(openbrowser-smart-search)
  153. vmap gx <Plug>(openbrowser-smart-search)
  154. let g:quickrun_config = {}
  155. let g:quickrun_config['markdown'] = {
  156. \ 'outputter': 'browser'
  157. \ }
  158. let g:lingr_vim_footer = ' [vim]'
  159. augroup plugin-lingr-vim
  160. autocmd!
  161. autocmd FileType lingr-messages nmap <silent> <buffer> t <Plug>(lingr-messages-show-say-buffer)
  162. autocmd FileType lingr-say let &syntax='clojure'
  163. augroup END
  164. augroup vimrc
  165. autocmd!
  166. augroup END
  167. function! s:SID_PREFIX()
  168. return matchstr(expand('<sfile>'), '<SNR>\d\+_')
  169. endfunction
  170. set titlelen=100
  171. set guioptions-=e
  172. autocmd vimrc BufEnter * let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  173. autocmd vimrc User plugin-lingr-unread let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  174. if exists('$TMUX') || exists('$WINDOW')
  175. set t_ts=k
  176. set t_fs=\
  177. endif
  178. function! s:titlestring()
  179. if &filetype =~ '^lingr'
  180. let &titlestring = 'lingr: ' . lingr#unread_count()
  181. else
  182. let &titlestring = bufname('')
  183. endif
  184. endfunction
  185. " tabline
  186. set showtabline=2 " always show tabline
  187. let &tabline = '%!' . s:SID_PREFIX() . 'tabline()'
  188. function! s:tabline()
  189. " show each tab
  190. let s = ''
  191. for i in range(1, tabpagenr('$'))
  192. let list = tabpagebuflist(i)
  193. let nr = tabpagewinnr(i)
  194. let current_tabnr = tabpagenr()
  195. "let title = bufname('')
  196. if i == current_tabnr
  197. let title = fnamemodify(getcwd(), ':t') . '/'
  198. "let title = bufname('')
  199. else
  200. let title = fnamemodify(gettabvar(i, 'cwd'), ':t') . '/'
  201. endif
  202. let title = empty(title) ? '[No Name]' : title
  203. let s .= i == current_tabnr ? '%#TabLineSel#' : '%#TabLine#'
  204. let s .= '%' . i . 'T[' . i . '] ' . title
  205. let s .= ' '
  206. endfor
  207. " show lingr unread count
  208. let lingr_unread = ""
  209. if exists('*lingr#unread_count')
  210. let lingr_unread_count = lingr#unread_count()
  211. if lingr_unread_count > 0
  212. let lingr_unread = "%#ErrorMsg#(" . lingr_unread_count . ")"
  213. elseif lingr_unread_count == 0
  214. let lingr_unread = "()"
  215. endif
  216. endif
  217. " build tabline
  218. let s .= '%#TabLineFill#%T%=%<[' . getcwd() . ']' . lingr_unread
  219. return s
  220. endfunction
  221. let g:github_user = 'raa0121'
  222. let g:github_token = 'e3ded9cf6669cc31dbca'
  223. let g:github#user = 'raa0121'
  224. set shellslash
  225. set grepprg=grep\ -nH\ $*
  226. let g:tex_flavor='tex'
  227. let g:Tex_CompileRule_div = 'platex --interaction=nonstopmode $*'
  228. let g:Tex_BibtexFlavor = 'jbibtex'
  229. let g:Tex_ViewRule_dvi = '/cygdrive/c/texlive/2012/bin/win32/dviout.exe'
  230. let g:Tex_FormatDependency_pdf = 'dvi,pdf'
  231. let g:Tex_CompileRule_pdf = 'dvipdfmx $*.dvi'
  232. let g:Tex_ViewRule_pdf = '/cygdrive/d/Program/SumatraPDF/SumatraPDF.exe'