.vimrc 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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. call neobundle#rc(expand('~/.bundle'))
  62. endif
  63. NeoBundle 'Shougo/echodoc.git'
  64. NeoBundle 'Shougo/neocomplcache.git'
  65. NeoBundle 'Shougo/neobundle.vim.git'
  66. NeoBundle 'Shougo/unite.vim.git'
  67. NeoBundle 'Shougo/vimfiler.git'
  68. NeoBundle 'Shougo/vimshell.git'
  69. NeoBundle 'Shougo/vimproc'
  70. NeoBundle 'thinca/vim-quickrun'
  71. NeoBundle 'tsukkee/lingr-vim'
  72. NeoBundle 'Shougo/neosnippet'
  73. NeoBundle 'browser.vim'
  74. NeoBundle 'synmark.vim'
  75. NeoBundle 'tyru/open-browser.vim'
  76. NeoBundle 'mattn/gist-vim'
  77. NeoBundle 'mattn/webapi-vim'
  78. NeoBundle 'mru.vim'
  79. NeoBundle 'thinca/vim-ft-clojure'
  80. NeoBundle 'ujihisa/neco-ghc'
  81. NeoBundle 'sudo.vim'
  82. NeoBundle 'ujihisa/vimshell-ssh'
  83. NeoBundle 'Shougo/unite-ssh'
  84. NeoBundle 'ujihisa/neco-look'
  85. NeoBundle 'vim-jp/vital.vim'
  86. NeoBundle 'dag/vim2hs'
  87. NeoBundle 'eagletmt/ghcmod-vim'
  88. NeoBundle 'git://vim-latex.git.sourceforge.net/gitroot/vim-latex/vim-latex'
  89. NeoBundle 'thinca/vim-singleton'
  90. NeoBundle 'mattn/benchvimrc-vim'
  91. NeoBundle 'ryutorion/vim-itunes'
  92. NeoBundle 'git@github.com:raa0121/vim-ulilith'
  93. NeoBundle 'mattn/libcallex-vim'
  94. NeoBundle 'thinca/vim-splash'
  95. filetype plugin indent on
  96. if has('clientserver')
  97. call singleton#enable()
  98. end
  99. set ww+=h,l,>,<,[,]
  100. set mouse=a
  101. set ttymouse=xterm2
  102. set clipboard+=unnamed
  103. " ,is: シェルを起動
  104. nnoremap <silent> ,is :VimShell<CR>
  105. " ,ipy: pythonを非同期で起動
  106. nnoremap <silent> ,ipy :VimShellInteractive python<CR>
  107. " ,irb: irbを非同期で起動
  108. nnoremap <silent> ,irb :VimShellInteractive irb<CR>
  109. " ,ss: 非同期で開いたインタプリタに現在の行を評価させる
  110. vmap <silent> ,ss :VimShellSendString<CR>
  111. " 選択中に,ss: 非同期で開いたインタプリタに選択行を評価させる
  112. nnoremap <silent> ,ss <S-v>:VimShellSendString<CR>
  113. " ,vs: vimshell
  114. nnoremap <silent> ,vs :tabnew +VimShell<CR>
  115. " ,vr: .vimrc
  116. nnoremap <silent> ,vr :tabnew ~/.vimrc<CR>
  117. nnoremap <silent> ,so :so ~/.vimrc<CR>
  118. nnoremap <silent> ,nu :tabnew +Unite\ neobundle/update<CR>
  119. " Disable AutoComplPop. Comment out this line if AutoComplPop is not
  120. " installed.
  121. let g:acp_enableAtStartup = 0
  122. " " Launches neocomplcache automatically on vim startup.
  123. let g:neocomplcache_enable_at_startup = 1
  124. " " Use smartcase.
  125. let g:neocomplcache_enable_smart_case = 1
  126. " " Use camel case completion.
  127. let g:neocomplcache_enable_camel_case_completion = 1
  128. " " Use underscore completion.
  129. let g:neocomplcache_enable_underbar_completion = 1
  130. " " Sets minimum char length of syntax keyword.
  131. let g:neocomplcache_min_syntax_length = 3
  132. let g:vimfiler_as_default_explorer = 1
  133. "tabで補完候補の選択を行う
  134. inoremap <expr><TAB> pumvisible() ? "\<Down>" : "\<TAB>"
  135. inoremap <expr><S-TAB> pumvisible() ? "\<Up>" : "\<S-TAB>"
  136. let g:netrw_nogx = 1
  137. nmap gx <Plug>(openbrowser-smart-search)
  138. vmap gx <Plug>(openbrowser-smart-search)
  139. let g:quickrun_config = {}
  140. let g:quickrun_config['markdown'] = {
  141. \ 'outputter': 'browser'
  142. \ }
  143. let g:lingr_vim_footer = ' [vim]'
  144. augroup plugin-lingr-vim
  145. autocmd!
  146. autocmd FileType lingr-messages nmap <silent> <buffer> t <Plug>(lingr-messages-show-say-buffer)
  147. autocmd FileType lingr-say let &syntax='clojure'
  148. augroup END
  149. augroup vimrc
  150. autocmd!
  151. augroup END
  152. function! s:SID_PREFIX()
  153. return matchstr(expand('<sfile>'), '<SNR>\d\+_')
  154. endfunction
  155. set titlelen=100
  156. set guioptions-=e
  157. autocmd vimrc BufEnter * let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  158. autocmd vimrc User plugin-lingr-unread let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  159. if exists('$TMUX') || exists('$WINDOW')
  160. set t_ts=k
  161. set t_fs=\
  162. endif
  163. function! s:titlestring()
  164. if &filetype =~ '^lingr'
  165. let &titlestring = 'lingr: ' . lingr#unread_count()
  166. else
  167. let &titlestring = bufname('')
  168. endif
  169. endfunction
  170. " tabline
  171. set showtabline=2 " always show tabline
  172. let &tabline = '%!' . s:SID_PREFIX() . 'tabline()'
  173. function! s:tabline()
  174. " show each tab
  175. let s = ''
  176. for i in range(1, tabpagenr('$'))
  177. let list = tabpagebuflist(i)
  178. let nr = tabpagewinnr(i)
  179. let current_tabnr = tabpagenr()
  180. "let title = bufname('')
  181. if i == current_tabnr
  182. let title = fnamemodify(getcwd(), ':t') . '/'
  183. "let title = bufname('')
  184. else
  185. let title = fnamemodify(gettabvar(i, 'cwd'), ':t') . '/'
  186. endif
  187. let title = empty(title) ? '[No Name]' : title
  188. let s .= i == current_tabnr ? '%#TabLineSel#' : '%#TabLine#'
  189. let s .= '%' . i . 'T[' . i . '] ' . title
  190. let s .= ' '
  191. endfor
  192. " show lingr unread count
  193. let lingr_unread = ""
  194. if exists('*lingr#unread_count')
  195. let lingr_unread_count = lingr#unread_count()
  196. if lingr_unread_count > 0
  197. let lingr_unread = "%#ErrorMsg#(" . lingr_unread_count . ")"
  198. elseif lingr_unread_count == 0
  199. let lingr_unread = "()"
  200. endif
  201. endif
  202. " build tabline
  203. let s .= '%#TabLineFill#%T%=%<[' . getcwd() . ']' . lingr_unread
  204. return s
  205. endfunction
  206. let g:github_user = 'raa0121'
  207. let g:github_token = 'e3ded9cf6669cc31dbca'
  208. set shellslash
  209. set grepprg=grep\ -nH\ $*
  210. let g:tex_flavor='tex'
  211. let g:Tex_CompileRule_div = 'platex --interaction=nonstopmode $*'
  212. let g:Tex_BibtexFlavor = 'jbibtex'
  213. let g:Tex_ViewRule_dvi = '/cygdrive/c/texlive/2012/bin/win32/dviout.exe'
  214. let g:Tex_FormatDependency_pdf = 'dvi,pdf'
  215. let g:Tex_CompileRule_pdf = 'dvipdfmx $*.dvi'
  216. let g:Tex_ViewRule_pdf = '/cygdrive/d/Program/SumatraPDF/SumatraPDF.exe'