.vimrc 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  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,sjis,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. set hlsearch
  26. colorscheme evening
  27. syntax on
  28. " ファイル名に大文字小文字の区別がないシステム用の設定:
  29. " (例: DOS/Windows/MacOS)
  30. "
  31. if filereadable($VIM . '/vimrc') && filereadable($VIM . '/ViMrC')
  32. " tagsファイルの重複防止
  33. set tags=./tags,tags
  34. endif
  35. " コンソールでのカラー表示のための設定(暫定的にUNIX専用)
  36. if has('unix') && !has('gui_running')
  37. let uname = system('uname')
  38. if uname =~? "linux"
  39. set term=builtin_linux
  40. elseif uname =~? "freebsd"
  41. set term=builtin_cons25
  42. elseif uname =~? "Darwin"
  43. set term=beos-ansi
  44. else
  45. set term=builtin_xterm
  46. endif
  47. unlet uname
  48. endif
  49. " コンソール版で環境変数$DISPLAYが設定されていると起動が遅くなる件へ対応
  50. if !has('gui_running') && has('xterm_clipboard')
  51. set clipboard=exclude:cons\\\|linux\\\|cygwin\\\|rxvt\\\|screen
  52. endif
  53. " タブページの切り替えをWindowsのように
  54. " CTRL+Tab SHIFT+Tabで行うように.
  55. if v:version >= 700
  56. nnoremap <C-Tab> gt
  57. nnoremap <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', '', 'default'
  69. call neobundle#config('echodoc', {
  70. \ 'lazy' : 1,
  71. \ 'autoload' : {
  72. \ 'insert' : 1,
  73. \ }})
  74. NeoBundle 'Shougo/neocomplcache', '', 'default'
  75. call neobundle#config('neocomplcache', {
  76. \ 'lazy' : 1,
  77. \ 'autoload' : {
  78. \ 'commands' : 'NeoComplCacheEnable',
  79. \ }})
  80. NeoBundle 'Shougo/neocomplcache-rsense', '', 'default'
  81. call neobundle#config('neocomplcache-rsense', {
  82. \ 'lazy' : 1,
  83. \ 'depends' : 'Shougo/neocomplcache',
  84. \ 'autoload' : { 'filetypes' : 'ruby' }
  85. \ })
  86. NeoBundle 'Shougo/neobundle.vim'
  87. NeoBundle 'Shougo/unite.vim', '', 'default'
  88. call neobundle#config('unite.vim',{
  89. \ 'lazy' : 1,
  90. \ 'autoload' : {
  91. \ 'commands' : [{ 'name' : 'Unite',
  92. \ 'complete' : 'customlist,unite#complete_source'},
  93. \ 'UniteWithCursorWord', 'UniteWithInput']
  94. \ }})
  95. NeoBundle 'Shougo/vimfiler', '', 'default'
  96. call neobundle#config('vimfiler', {
  97. \ 'lazy' : 1,
  98. \ 'depends' : 'Shougo/unite.vim',
  99. \ 'autoload' : {
  100. \ 'commands' : [
  101. \ { 'name' : 'VimFiler',
  102. \ 'complete' : 'customlist,vimfiler#complete' },
  103. \ { 'name' : 'VimFilerExplorer',
  104. \ 'complete' : 'customlist,vimfiler#complete' },
  105. \ { 'name' : 'Edit',
  106. \ 'complete' : 'customlist,vimfiler#complete' },
  107. \ { 'name' : 'Write',
  108. \ 'complete' : 'customlist,vimfiler#complete' },
  109. \ 'Read', 'Source'],
  110. \ 'mappings' : ['<Plug>(vimfiler_switch)'],
  111. \ 'explorer' : 1,
  112. \ }
  113. \ })
  114. NeoBundle 'Shougo/vimshell', '', 'default'
  115. call neobundle#config('vimshell', {
  116. \ 'lazy' : 1,
  117. \ 'autoload' : {
  118. \ 'commands' : [{ 'name' : 'VimShell',
  119. \ 'complete' : 'customlist,vimshell#complete'},
  120. \ 'VimShellExecute', 'VimShellInteractive',
  121. \ 'VimShellTerminal', 'VimShellPop'],
  122. \ 'mappings' : ['<Plug>(vimshell_switch)']
  123. \ }})
  124. NeoBundle 'Shougo/vimproc', '', 'default'
  125. call neobundle#config('vimproc', {
  126. \ 'build' : {
  127. \ 'windows' : 'make -f make_mingw32.mak',
  128. \ 'cygwin' : 'make -f make_cygwin.mak',
  129. \ 'mac' : 'make -f make_mac.mak',
  130. \ 'unix' : 'make -f make_unix.mak',
  131. \ },
  132. \ })
  133. NeoBundleLazy 'thinca/vim-quickrun', { 'autoload' : {
  134. \ 'mappings' : [
  135. \ ['nxo', '<Plug>(quickrun)']],
  136. \ }}
  137. NeoBundle 'tsukkee/lingr-vim'
  138. call neobundle#config('lingr-vim', {
  139. \ 'lazy' : 1,
  140. \ 'autoload' : {
  141. \ 'commands' : 'LingrLaunch',
  142. \ },
  143. \ })
  144. NeoBundle 'Shougo/neosnippet', '', 'default'
  145. call neobundle#config('neosnippet', {
  146. \ 'lazy' : 1,
  147. \ 'autoload' : {
  148. \ 'insert' : 1,
  149. \ 'filetypes' : 'snippet',
  150. \ 'unite_sources' : ['snippet', 'neosnippet/user', 'neosnippet/runtime'],
  151. \ }})
  152. NeoBundle 'browser.vim'
  153. NeoBundle 'synmark.vim'
  154. NeoBundleLazy 'tyru/open-browser.vim', { 'autoload' : {
  155. \ 'mappings' : '<Plug>(open-browser-wwwsearch)',
  156. \ }}
  157. NeoBundle 'mattn/gist-vim'
  158. NeoBundle 'mattn/webapi-vim'
  159. NeoBundle 'mru.vim'
  160. NeoBundle 'thinca/vim-ft-clojure'
  161. NeoBundleLazy 'ujihisa/neco-ghc', { 'autoload' : {
  162. \ 'filetypes' : 'haskell',
  163. \ }}
  164. NeoBundle 'sudo.vim'
  165. NeoBundleLazy 'ujihisa/vimshell-ssh', { 'autoload' : {
  166. \ 'filetypes' : 'vimshell',
  167. \ }}
  168. NeoBundle 'Shougo/unite-ssh'
  169. NeoBundle 'ujihisa/neco-look'
  170. NeoBundle 'vim-jp/vital.vim', '', 'default'
  171. call neobundle#config('vital.vim', {
  172. \ 'lazy' : 1,
  173. \ 'autoload' : {
  174. \ 'commands' : ['Vitalize'],
  175. \ }})
  176. NeoBundleLazy 'dag/vim2hs', { 'autoload' : {
  177. \ 'filetypes' : 'haskell',
  178. \ }}
  179. NeoBundleLazy 'eagletmt/ghcmod-vim', { 'autoload' : {
  180. \ 'filetypes' : 'haskell',
  181. \ }}
  182. NeoBundle 'thinca/vim-ref'
  183. NeoBundle 'thinca/vim-singleton'
  184. NeoBundle 'mattn/benchvimrc-vim'
  185. NeoBundle 'ryutorion/vim-itunes'
  186. NeoBundle 'raa0121/vim-ulilith'
  187. NeoBundle 'mattn/libcallex-vim'
  188. NeoBundle 'thinca/vim-splash'
  189. NeoBundle 'mattn/sonictemplate-vim'
  190. NeoBundle 'raa0121/vim-eclim'
  191. NeoBundle 'thinca/vim-github'
  192. NeoBundle 'nosami/Omnisharp'
  193. NeoBundle 'jceb/vim-orgmode'
  194. "NeoBundle 'Lokaltog/powerline', { 'rtp' : 'powerline/bindings/vim'}
  195. "NeoBundle 'taichouchou2/alpaca_powertabline'
  196. "NeoBundle 'zhaocai/linepower.vim'
  197. NeoBundle 'osyo-manga/quickrun-hook-u-nya-'
  198. NeoBundle 'osyo-manga/unite-quickfix'
  199. NeoBundle 'basyura/J6uil.vim', '', 'default'
  200. call neobundle#config('J6uil.vim', {
  201. \ 'lazy' : 1,
  202. \ 'autoload' : {
  203. \ 'commands' : 'J6uil',
  204. \ },
  205. \ 'depends' : 'mattn/webapi-vim',
  206. \ })
  207. NeoBundle 'mattn/unite-rhythmbox'
  208. NeoBundleLazy 'rbtnn/vimconsole.vim', {
  209. \ 'depends' : 'thinca/vim-prettyprint',
  210. \ 'autoload' : {
  211. \ 'commands' : 'VimConsoleOpen'
  212. \ }}
  213. filetype plugin indent on
  214. if has('clientserver')
  215. call singleton#enable()
  216. end
  217. set ww+=h,l,>,<,[,]
  218. set mouse=a
  219. set ttymouse=xterm2
  220. set clipboard=unnamedplus
  221. " ,is: シェルを起動
  222. nnoremap <silent> ,is :VimShell<CR>
  223. " ,ipy: pythonを非同期で起動
  224. nnoremap <silent> ,ipy :VimShellInteractive python<CR>
  225. " ,irb: irbを非同期で起動
  226. nnoremap <silent> ,irb :VimShellInteractive irb<CR>
  227. " ,ss: 非同期で開いたインタプリタに現在の行を評価させる
  228. vmap <silent> ,ss :VimShellSendString<CR>
  229. " 選択中に,ss: 非同期で開いたインタプリタに選択行を評価させる
  230. nnoremap <silent> ,ss <S-v>:VimShellSendString<CR>
  231. " ,vs: vimshell
  232. nnoremap <silent> ,vs :tabnew +VimShell<CR>
  233. " ,vr: .vimrc
  234. nnoremap <silent> ,vr :tabnew ~/.vimrc<CR>
  235. nnoremap <silent> ,so :so ~/.vimrc<CR>
  236. nnoremap <silent> ,nu :tabnew +Unite\ neobundle/update<CR>
  237. nnoremap <silent> ,ll :tabnew +LingrLaunch<CR>
  238. nnoremap <Esc><Esc> :nohlsearch<CR><ESC>
  239. " Disable AutoComplPop. Comment out this line if AutoComplPop is not
  240. " installed.
  241. let g:acp_enableAtStartup = 0
  242. " Launches neocomplcache automatically on vim startup.
  243. let g:neocomplcache_enable_at_startup = 1
  244. " Use smartcase.
  245. let g:neocomplcache_enable_smart_case = 1
  246. " Use camel case completion.
  247. let g:neocomplcache_enable_camel_case_completion = 1
  248. " Use underscore completion.
  249. let g:neocomplcache_enable_underbar_completion = 1
  250. " Sets minimum char length of syntax keyword.
  251. let g:neocomplcache_min_syntax_length = 3
  252. let g:vimfiler_as_default_explorer = 1
  253. let g:neocomplcache#sources#rsense#home_directory = '/opt/rsense-0.3/'
  254. let g:neocomplcache_text_mode_filetypes = {
  255. \ 'tex': 1,
  256. \ 'plaintex': 1,
  257. \}
  258. "tabで補完候補の選択を行う
  259. inoremap <expr><TAB> pumvisible() ? "\<Down>" : "\<TAB>"
  260. inoremap <expr><S-TAB> pumvisible() ? "\<Up>" : "\<S-TAB>"
  261. let g:OmniSharp_host = 'http://localhost:2020'
  262. let g:OmniSharp_typeLookupInPreview = 1
  263. setlocal omnifunc=OmniSharp#Complete
  264. set noshowmatch
  265. let g:netrw_nogx = 1
  266. nmap gx <Plug>(openbrowser-smart-search)
  267. vmap gx <Plug>(openbrowser-smart-search)
  268. let g:quickrun_config = {}
  269. let g:quickrun_config['markdown'] = {
  270. \ 'outputter': 'browser'
  271. \ }
  272. let g:quickrun_config.ruby = {
  273. \ 'command': 'ruby',
  274. \ 'exec': '/usr/bin/env ruby %s',
  275. \ 'tempfile': '{tempname()}.rb'
  276. \ }
  277. let g:quickrun_config = {
  278. \ '_' : {
  279. \ 'hook/close_unite_quickfix/enable_hook_loaded' : 1,
  280. \ 'hook/unite_quickfix/enable_failure' : 1,
  281. \ 'hook/close_quickfix/enable_exit' : 1,
  282. \ 'hook/close_buffer/enable_failure' : 1,
  283. \ 'hook/close_buffer/enable_empty_data' : 1,
  284. \ 'outputter' : 'multi:buffer:quickfix',
  285. \ 'hook/u_nya_/enable' : 1,
  286. \ 'hook/sweep/enable' : 0,
  287. \ 'outputter/buffer/split' : ':botright 15sp',
  288. \ 'outputter/buffer/running_mark' : 'バン(∩`・ω・)バンバンバンバン゙ン',
  289. \ 'runner' : 'vimproc',
  290. \ 'runner/vimproc/updatetime' : 40,
  291. \ 'runner/vimproc/sleep' : 0,
  292. \ }
  293. \ }
  294. let g:lingr_vim_user = 'raa0121'
  295. let g:J6uil_display_offline = 0
  296. let g:J6uil_display_online = 0
  297. let g:J6uil_echo_presence = 1
  298. let g:J6uil_display_icon = 0
  299. let g:J6uil_display_interval = 0
  300. let g:J6uil_updatetime = 1000
  301. augroup plugin-lingr-vim
  302. autocmd!
  303. autocmd FileType lingr-messages nmap <silent> <buffer> t <Plug>(lingr-messages-show-say-buffer)
  304. autocmd FileType lingr-say let &syntax='clojure'
  305. augroup END
  306. augroup vimrc
  307. autocmd!
  308. augroup END
  309. function! s:SID_PREFIX()
  310. return matchstr(expand('<sfile>'), '<SNR>\d\+_')
  311. endfunction
  312. set titlelen=100
  313. set guioptions-=e
  314. autocmd vimrc BufEnter * let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  315. autocmd vimrc User plugin-lingr-unread let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  316. if exists('$TMUX') || exists('$WINDOW')
  317. set t_ts=k
  318. set t_fs=\
  319. endif
  320. function! s:titlestring()
  321. if &filetype =~ '^lingr'
  322. let &titlestring = 'lingr: ' . lingr#unread_count()
  323. else
  324. let &titlestring = bufname('')
  325. endif
  326. endfunction
  327. " tabline
  328. set showtabline=2 " always show tabline
  329. let &tabline = '%!' . s:SID_PREFIX() . 'tabline()'
  330. function! s:tabline()
  331. " show each tab
  332. let s = ''
  333. for i in range(1, tabpagenr('$'))
  334. let list = tabpagebuflist(i)
  335. let nr = tabpagewinnr(i)
  336. let current_tabnr = tabpagenr()
  337. "let title = bufname('')
  338. if i == current_tabnr
  339. let title = fnamemodify(getcwd(), ':t') . '/'
  340. "let title = bufname('')
  341. else
  342. let title = fnamemodify(gettabvar(i, 'cwd'), ':t') . '/'
  343. endif
  344. let title = empty(title) ? '[No Name]' : title
  345. let s .= i == current_tabnr ? '%#TabLineSel#' : '%#TabLine#'
  346. let s .= '%' . i . 'T[' . i . '] ' . title
  347. let s .= ' '
  348. endfor
  349. " show lingr unread count
  350. let lingr_unread = ""
  351. if exists('*lingr#unread_count')
  352. let lingr_unread_count = lingr#unread_count()
  353. if lingr_unread_count > 0
  354. let lingr_unread = "%#ErrorMsg#(" . lingr_unread_count . ")"
  355. elseif lingr_unread_count == 0
  356. let lingr_unread = "()"
  357. endif
  358. endif
  359. " build tabline
  360. let s .= '%#TabLineFill#%T%=%<[' . getcwd() . ']' . lingr_unread
  361. return s
  362. endfunction
  363. let g:github_user = 'raa0121'
  364. let g:github_token = 'e3ded9cf6669cc31dbca'
  365. let g:github#user = 'raa0121'