.vimrc 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  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. inoremap <C-Tab> gt
  56. nnoremap <C-S-Tab> gT
  57. inoremap <C-S-Tab> gT
  58. endif
  59. if has('+regexpengine')
  60. set re=0
  61. endif
  62. set nocompatible
  63. filetype off
  64. if has('vim_starting')
  65. set runtimepath+=~/.vim/neobundle.vim.git
  66. endif
  67. call neobundle#rc(expand('~/.bundle'))
  68. NeoBundle 'Shougo/echodoc.git'
  69. NeoBundle 'Shougo/neocomplcache.git'
  70. NeoBundle 'Shougo/neocomplcache-rsense'
  71. NeoBundle 'Shougo/neobundle.vim.git'
  72. NeoBundle 'Shougo/unite.vim.git'
  73. NeoBundle 'Shougo/vimfiler.git'
  74. NeoBundle 'Shougo/vimshell.git'
  75. NeoBundle 'Shougo/vimproc'
  76. NeoBundle 'thinca/vim-quickrun'
  77. NeoBundle 'tsukkee/lingr-vim'
  78. NeoBundle 'Shougo/neosnippet'
  79. NeoBundle 'browser.vim'
  80. NeoBundle 'synmark.vim'
  81. NeoBundle 'tyru/open-browser.vim'
  82. NeoBundle 'mattn/gist-vim'
  83. NeoBundle 'mattn/webapi-vim'
  84. NeoBundle 'mru.vim'
  85. NeoBundle 'thinca/vim-ft-clojure'
  86. NeoBundle 'ujihisa/neco-ghc'
  87. NeoBundle 'sudo.vim'
  88. NeoBundle 'ujihisa/vimshell-ssh'
  89. NeoBundle 'Shougo/unite-ssh'
  90. NeoBundle 'ujihisa/neco-look'
  91. NeoBundle 'vim-jp/vital.vim'
  92. NeoBundle 'dag/vim2hs'
  93. NeoBundle 'eagletmt/ghcmod-vim'
  94. NeoBundle 'git://vim-latex.git.sourceforge.net/gitroot/vim-latex/vim-latex'
  95. NeoBundle 'thinca/vim-singleton'
  96. NeoBundle 'mattn/benchvimrc-vim'
  97. NeoBundle 'ryutorion/vim-itunes'
  98. NeoBundle 'git@github.com:raa0121/vim-ulilith'
  99. NeoBundle 'mattn/libcallex-vim'
  100. NeoBundle 'thinca/vim-splash'
  101. NeoBundle 'mattn/sonictemplate-vim'
  102. NeoBundle 'raa0121/vim-eclim'
  103. NeoBundle 'thinca/vim-github'
  104. NeoBundle 'nosami/Omnisharp'
  105. NeoBundle 'jceb/vim-orgmode'
  106. "NeoBundle 'Lokaltog/powerline', { 'rtp' : 'powerline/bindings/vim'}
  107. "NeoBundle 'taichouchou2/alpaca_powertabline'
  108. "NeoBundle 'zhaocai/linepower.vim'
  109. NeoBundle 'osyo-manga/quickrun-hook-u-nya-'
  110. NeoBundle 'osyo-manga/unite-quickfix'
  111. NeoBundle 'basyura/J6uil.vim'
  112. filetype plugin indent on
  113. if has('clientserver')
  114. call singleton#enable()
  115. end
  116. set ww+=h,l,>,<,[,]
  117. set mouse=a
  118. set ttymouse=xterm2
  119. set clipboard=unnamedplus
  120. " ,is: シェルを起動
  121. nnoremap <silent> ,is :VimShell<CR>
  122. " ,ipy: pythonを非同期で起動
  123. nnoremap <silent> ,ipy :VimShellInteractive python<CR>
  124. " ,irb: irbを非同期で起動
  125. nnoremap <silent> ,irb :VimShellInteractive irb<CR>
  126. " ,ss: 非同期で開いたインタプリタに現在の行を評価させる
  127. vmap <silent> ,ss :VimShellSendString<CR>
  128. " 選択中に,ss: 非同期で開いたインタプリタに選択行を評価させる
  129. nnoremap <silent> ,ss <S-v>:VimShellSendString<CR>
  130. " ,vs: vimshell
  131. nnoremap <silent> ,vs :tabnew +VimShell<CR>
  132. " ,vr: .vimrc
  133. nnoremap <silent> ,vr :tabnew ~/.vimrc<CR>
  134. nnoremap <silent> ,so :so ~/.vimrc<CR>
  135. nnoremap <silent> ,nu :tabnew +Unite\ neobundle/update<CR>
  136. nnoremap <silent> ,ll :tabnew +LingrLaunch<CR>
  137. " Disable AutoComplPop. Comment out this line if AutoComplPop is not
  138. " installed.
  139. let g:acp_enableAtStartup = 0
  140. " Launches neocomplcache automatically on vim startup.
  141. let g:neocomplcache_enable_at_startup = 1
  142. " Use smartcase.
  143. let g:neocomplcache_enable_smart_case = 1
  144. " Use camel case completion.
  145. let g:neocomplcache_enable_camel_case_completion = 1
  146. " Use underscore completion.
  147. let g:neocomplcache_enable_underbar_completion = 1
  148. " Sets minimum char length of syntax keyword.
  149. let g:neocomplcache_min_syntax_length = 3
  150. let g:vimfiler_as_default_explorer = 1
  151. let g:neocomplcache#sources#rsense#home_directory = '/opt/rsense-0.3/'
  152. let g:neocomplcache_text_mode_filetypes = {
  153. \ 'tex': 1,
  154. \ 'plaintex': 1,
  155. \}
  156. "tabで補完候補の選択を行う
  157. inoremap <expr><TAB> pumvisible() ? "\<Down>" : "\<TAB>"
  158. inoremap <expr><S-TAB> pumvisible() ? "\<Up>" : "\<S-TAB>"
  159. let g:OmniSharp_host = 'http://localhost:2020'
  160. let g:OmniSharp_typeLookupInPreview = 1
  161. setlocal omnifunc=OmniSharp#Complete
  162. set noshowmatch
  163. let g:netrw_nogx = 1
  164. nmap gx <Plug>(openbrowser-smart-search)
  165. vmap gx <Plug>(openbrowser-smart-search)
  166. let g:quickrun_config = {}
  167. let g:quickrun_config['markdown'] = {
  168. \ 'outputter': 'browser'
  169. \ }
  170. let g:quickrun_config.ruby = {
  171. \ 'command': 'ruby',
  172. \ 'exec': '/usr/bin/env ruby %s',
  173. \ 'tempfile': '{tempname()}.rb'
  174. \ }
  175. let g:quickrun_config = {
  176. \ '_' : {
  177. \ 'hook/close_unite_quickfix/enable_hook_loaded' : 1,
  178. \ 'hook/unite_quickfix/enable_failure' : 1,
  179. \ 'hook/close_quickfix/enable_exit' : 1,
  180. \ 'hook/close_buffer/enable_failure' : 1,
  181. \ 'hook/close_buffer/enable_empty_data' : 1,
  182. \ 'outputter' : 'multi:buffer:quickfix',
  183. \ 'hook/u_nya_/enable' : 1,
  184. \ 'hook/sweep/enable' : 0,
  185. \ 'outputter/buffer/split' : ':botright 15sp',
  186. \ 'outputter/buffer/running_mark' : 'バン(∩`・ω・)バンバンバンバン゙ン',
  187. \ 'runner' : 'vimproc',
  188. \ 'runner/vimproc/updatetime' : 40,
  189. \ 'runner/vimproc/sleep' : 0,
  190. \ }
  191. \ }
  192. let g:lingr_vim_user = 'raa0121'
  193. let g:J6uil_display_offline = 0
  194. let g:J6uil_display_online = 0
  195. let g:J6uil_echo_presence = 1
  196. let g:J6uil_display_icon = 0
  197. let g:J6uil_display_interval = 0
  198. let g:J6uil_updatetime = 1000
  199. augroup plugin-lingr-vim
  200. autocmd!
  201. autocmd FileType lingr-messages nmap <silent> <buffer> t <Plug>(lingr-messages-show-say-buffer)
  202. autocmd FileType lingr-say let &syntax='clojure'
  203. augroup END
  204. augroup vimrc
  205. autocmd!
  206. augroup END
  207. function! s:SID_PREFIX()
  208. return matchstr(expand('<sfile>'), '<SNR>\d\+_')
  209. endfunction
  210. set titlelen=100
  211. set guioptions-=e
  212. autocmd vimrc BufEnter * let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  213. autocmd vimrc User plugin-lingr-unread let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  214. if exists('$TMUX') || exists('$WINDOW')
  215. set t_ts=k
  216. set t_fs=\
  217. endif
  218. function! s:titlestring()
  219. if &filetype =~ '^lingr'
  220. let &titlestring = 'lingr: ' . lingr#unread_count()
  221. else
  222. let &titlestring = bufname('')
  223. endif
  224. endfunction
  225. " tabline
  226. set showtabline=2 " always show tabline
  227. let &tabline = '%!' . s:SID_PREFIX() . 'tabline()'
  228. function! s:tabline()
  229. " show each tab
  230. let s = ''
  231. for i in range(1, tabpagenr('$'))
  232. let list = tabpagebuflist(i)
  233. let nr = tabpagewinnr(i)
  234. let current_tabnr = tabpagenr()
  235. "let title = bufname('')
  236. if i == current_tabnr
  237. let title = fnamemodify(getcwd(), ':t') . '/'
  238. "let title = bufname('')
  239. else
  240. let title = fnamemodify(gettabvar(i, 'cwd'), ':t') . '/'
  241. endif
  242. let title = empty(title) ? '[No Name]' : title
  243. let s .= i == current_tabnr ? '%#TabLineSel#' : '%#TabLine#'
  244. let s .= '%' . i . 'T[' . i . '] ' . title
  245. let s .= ' '
  246. endfor
  247. " show lingr unread count
  248. let lingr_unread = ""
  249. if exists('*lingr#unread_count')
  250. let lingr_unread_count = lingr#unread_count()
  251. if lingr_unread_count > 0
  252. let lingr_unread = "%#ErrorMsg#(" . lingr_unread_count . ")"
  253. elseif lingr_unread_count == 0
  254. let lingr_unread = "()"
  255. endif
  256. endif
  257. " build tabline
  258. let s .= '%#TabLineFill#%T%=%<[' . getcwd() . ']' . lingr_unread
  259. return s
  260. endfunction
  261. let g:github_user = 'raa0121'
  262. let g:github_token = 'e3ded9cf6669cc31dbca'
  263. let g:github#user = 'raa0121'
  264. if has('win32') || has('win64') || has('win32unix')
  265. set shellslash
  266. set grepprg=grep\ -nH\ $*
  267. let g:tex_flavor='tex'
  268. let g:Tex_CompileRule_div = 'platex --interaction=nonstopmode $*'
  269. let g:Tex_BibtexFlavor = 'jbibtex'
  270. let g:Tex_ViewRule_dvi = '/cygdrive/c/texlive/2012/bin/win32/dviout.exe'
  271. let g:Tex_FormatDependency_pdf = 'dvi,pdf'
  272. let g:Tex_CompileRule_pdf = 'dvipdfmx $*.dvi'
  273. let g:Tex_ViewRule_pdf = '/cygdrive/d/Program/SumatraPDF/SumatraPDF.exe'
  274. endif