.vimrc 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724
  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. set list
  27. set listchars=tab:>-
  28. set nrformats+=alpha
  29. colorscheme elflord
  30. syntax on
  31. set enc=utf8
  32. set updatetime=200
  33. " ファイル名に大文字小文字の区別がないシステム用の設定:
  34. " (例: DOS/Windows/MacOS)
  35. "
  36. if filereadable($VIM . '/vimrc') && filereadable($VIM . '/ViMrC')
  37. " tagsファイルの重複防止
  38. set tags=./tags,tags
  39. endif
  40. " コンソールでのカラー表示のための設定(暫定的にUNIX専用)
  41. if has('unix') && !has('gui_running')
  42. let uname = system('uname')
  43. if uname =~? "linux"
  44. set term=builtin_linux
  45. elseif uname =~? "freebsd"
  46. set term=builtin_cons25
  47. elseif uname =~? "Darwin"
  48. set term=beos-ansi
  49. else
  50. set term=builtin_xterm
  51. endif
  52. unlet uname
  53. endif
  54. " コンソール版で環境変数$DISPLAYが設定されていると起動が遅くなる件へ対応
  55. if !has('gui_running') && has('xterm_clipboard')
  56. set clipboard=exclude:cons\\\|linux\\\|cygwin\\\|rxvt\\\|screen
  57. endif
  58. " タブページの切り替えをWindowsのように
  59. " CTRL+Tab SHIFT+Tabで行うように.
  60. if v:version >= 700
  61. nnoremap <C-Tab> gt
  62. nnoremap <C-S-Tab> gT
  63. endif
  64. if has('+regexpengine')
  65. set re=0
  66. endif
  67. filetype off
  68. if has('vim_starting')
  69. set runtimepath+=~/.vim/neobundle.vim.git
  70. endif
  71. call neobundle#rc(expand('~/.bundle'))
  72. let g:neobundle_default_git_protocol='https'
  73. NeoBundleFetch 'Shougo/neobundle.vim'
  74. NeoBundle 'Shougo/echodoc'
  75. call neobundle#config('echodoc', {
  76. \ 'lazy' : 1,
  77. \ 'autoload' : {
  78. \ 'insert' : 1,
  79. \ }})
  80. if has('lua')
  81. NeoBundle 'Shougo/neocomplete.vim'
  82. else
  83. NeoBundle 'Shougo/neocomplcache'
  84. endif
  85. NeoBundle 'Shougo/neomru.vim'
  86. NeoBundle 'Shougo/neosnippet'
  87. call neobundle#config('neosnippet', {
  88. \ 'lazy' : 1,
  89. \ 'autoload' : {
  90. \ 'insert' : 1,
  91. \ 'filetypes' : 'snippet',
  92. \ 'unite_sources' : ['snippet', 'neosnippet/user', 'neosnippet/runtime'],
  93. \ }})
  94. NeoBundle 'Shougo/neosnippet-snippets'
  95. call neobundle#config('neosnippet-snippets', {
  96. \ 'depends' : 'Shougo/neosnippet'
  97. \ })
  98. NeoBundle 'Shougo/unite-ssh'
  99. call neobundle#config('unite-ssh', {
  100. \ 'lazy' : 1,
  101. \ 'depends' : 'Shougo/unite.vim',
  102. \ 'autoload' : { 'unite_sources' : 'ssh' }
  103. \ })
  104. NeoBundle 'Shougo/unite.vim'
  105. call neobundle#config('unite.vim',{
  106. \ 'lazy' : 1,
  107. \ 'autoload' : {
  108. \ 'commands' : [{ 'name' : 'Unite',
  109. \ 'complete' : 'customlist,unite#complete_source'},
  110. \ 'UniteWithCursorWord', 'UniteWithInput']
  111. \ }})
  112. NeoBundle 'Shougo/unite-outline'
  113. NeoBundle 'Shougo/vimfiler'
  114. call neobundle#config('vimfiler', {
  115. \ 'lazy' : 1,
  116. \ 'depends' : 'Shougo/unite.vim',
  117. \ 'autoload' : {
  118. \ 'commands' : [
  119. \ { 'name' : 'VimFiler',
  120. \ 'complete' : 'customlist,vimfiler#complete' },
  121. \ { 'name' : 'VimFilerExplorer',
  122. \ 'complete' : 'customlist,vimfiler#complete' },
  123. \ { 'name' : 'VimFilerBufferDir',
  124. \ 'complete' : 'customlist,vimfiler#complete' },
  125. \ { 'name' : 'Edit',
  126. \ 'complete' : 'customlist,vimfiler#complete' },
  127. \ { 'name' : 'Write',
  128. \ 'complete' : 'customlist,vimfiler#complete' },
  129. \ 'Read', 'Source'],
  130. \ 'mappings' : ['<Plug>(vimfiler_switch)'],
  131. \ 'explorer' : 1,
  132. \ }
  133. \ })
  134. if has('win32') || has('win64')
  135. NeoBundleFetch 'jnwhiteh/vim-golang'
  136. call neobundle#config('vim-golang', {
  137. \ 'type' : 'nosync',
  138. \ 'lazy' : 1,
  139. \ 'autoload' : { 'filetypes' : 'go'}
  140. \ })
  141. else
  142. NeoBundle 'Shougo/vimproc.vim'
  143. call neobundle#config('vimproc.vim', {
  144. \ 'build' : {
  145. \ 'windows' : 'make -f make_mingw64.mak',
  146. \ 'cygwin' : 'make -f make_cygwin.mak',
  147. \ 'mac' : 'make -f make_mac.mak',
  148. \ 'unix' : 'make -f make_unix.mak',
  149. \ },
  150. \ })
  151. NeoBundle 'jnwhiteh/vim-golang'
  152. call neobundle#config('vim-golang', {
  153. \ 'lazy' : 1,
  154. \ 'autoload' : { 'filetypes' : 'go'}
  155. \ })
  156. endif
  157. NeoBundle 'Shougo/vimshell'
  158. call neobundle#config('vimshell', {
  159. \ 'lazy' : 1,
  160. \ 'autoload' : {
  161. \ 'commands' : [{ 'name' : 'VimShell',
  162. \ 'complete' : 'customlist,vimshell#complete'},
  163. \ 'VimShellExecute', 'VimShellInteractive',
  164. \ 'VimShellTerminal', 'VimShellPop'],
  165. \ 'mappings' : ['<Plug>(vimshell_switch)']
  166. \ }})
  167. NeoBundle 'basyura/J6uil.vim'
  168. call neobundle#config('J6uil.vim', {
  169. \ 'lazy' : 1,
  170. \ 'autoload' : { 'commands' : 'J6uil',
  171. \ 'unice_source' : ['J6uil/rooms', 'J6uil/members']},
  172. \ 'depends' : 'mattn/webapi-vim',
  173. \ })
  174. NeoBundle 'cohama/agit.vim'
  175. NeoBundle 'dag/vim2hs'
  176. call neobundle#config ('vim2hs', {
  177. \ 'lazy' : 1,
  178. \ 'autoload' : { 'filetypes' : 'haskell' }
  179. \})
  180. NeoBundle 'eagletmt/ghcmod-vim'
  181. call neobundle#config('ghcmod-vim', {
  182. \ 'lazy' : 1,
  183. \ 'autoload' : { 'filetypes' : 'haskell' }
  184. \ })
  185. NeoBundle 'editorconfig/editorconfig-vim'
  186. NeoBundle 'fuenor/qfixhowm'
  187. NeoBundle 'groenewege/vim-less'
  188. call neobundle#config('vim-less', {
  189. \ 'lazy' : 1,
  190. \ 'autoload' : { 'filetypes' : 'less' }
  191. \ })
  192. NeoBundle 'haya14busa/incsearch.vim'
  193. NeoBundle 'honza/vim-snippets'
  194. NeoBundle 'itchyny/calendar.vim'
  195. NeoBundle 'itchyny/lightline.vim'
  196. NeoBundle 'jceb/vim-orgmode'
  197. call neobundle#config('vim-orgmode', {
  198. \ 'lazy' : 1,
  199. \ 'autoload' : { 'filetypes' : 'org' }
  200. \ })
  201. NeoBundle 'kamichidu/unite-javaimport', ''
  202. call neobundle#config('unite-javaimport', {
  203. \ 'lazy' : 1,
  204. \ 'depends' : [
  205. \ 'kamichidu/vim-javalang', 'kamichidu/vim-javaclasspath',
  206. \ 'Shougo/unite.vim', 'yuratomo/w3m.vim'],
  207. \ 'autoload' : { 'filetypes' : ['java', 'scala', 'clojure']}
  208. \})
  209. NeoBundle 'kamichidu/vim-milqi', 'dev'
  210. NeoBundle 'kamichidu/vim-ref-java'
  211. call neobundle#config('vim-ref-java', {
  212. \ 'depends' : [ 'mattn/wwwrenderer-vim' ],
  213. \})
  214. NeoBundle 'kamichidu/vim-vdbc'
  215. call neobundle#config('vim-vdbc', {
  216. \ 'depends' : ['Shougo/vimproc.vim'] ,
  217. \ 'build': {
  218. \ 'unix' : 'make -f Makefile',
  219. \ 'windows' : 'make -f Makefile.w64'
  220. \ }
  221. \})
  222. NeoBundle 'kana/vim-smartinput'
  223. NeoBundle 'mattn/benchvimrc-vim'
  224. call neobundle#config('benchvimrc-vim', {
  225. \ 'lazy' : 1,
  226. \ 'autoload' : { 'commands' : 'BenchVimrc' }
  227. \ })
  228. NeoBundle 'mattn/flappyvird-vim'
  229. call neobundle#config('flappyvird-vim', {
  230. \ 'lazy' : 1,
  231. \ 'autoload' : { 'commands' : 'FlappyVird' }
  232. \ })
  233. NeoBundle 'mattn/gist-vim'
  234. call neobundle#config('gist-vim', {
  235. \ 'lazy' : 1,
  236. \ 'autoload' : { 'commands' : 'Gist' }
  237. \ })
  238. NeoBundle 'mattn/libcallex-vim'
  239. NeoBundle 'mattn/mahjong-vim'
  240. call neobundle#config('mahjong-vim', {
  241. \ 'lazy' : 1,
  242. \ 'autoload' : { 'commands' : 'Mahjong' }
  243. \ })
  244. NeoBundle 'mattn/sonictemplate-vim'
  245. call neobundle#config('sonictemplate-vim', {
  246. \ 'lazy' : 1,
  247. \ 'autoload' : { 'commands' : 'Template' }
  248. \ })
  249. NeoBundle 'mattn/unite-rhythmbox'
  250. call neobundle#config('unite-rhythmbox', {
  251. \ 'lazy' : 1,
  252. \ 'autoload' : { 'unite_sources' : 'rhythmbox' },
  253. \ 'depends' : 'Shougo/unite.vim'
  254. \ })
  255. NeoBundle 'mattn/webapi-vim'
  256. NeoBundle 'osyo-manga/quickrun-hook-u-nya-'
  257. call neobundle#config('quickrun-hook-u-nya-', {
  258. \ 'depends' : 'thinca/vim-quickrun'
  259. \ })
  260. NeoBundle "osyo-manga/shabadou.vim"
  261. NeoBundle 'osyo-manga/unite-filetype'
  262. call neobundle#config('unite-filetype', {
  263. \ 'lazy' : 1,
  264. \ 'autoload' : { 'unite_sources' : ['filetype', 'filetype/new']},
  265. \ 'depends' : ['Shougo/unite.vim']
  266. \ })
  267. NeoBundle 'osyo-manga/unite-highlight'
  268. call neobundle#config('unite-highlight', {
  269. \ 'lazy' : 1,
  270. \ 'autoload' : { 'unite_sources' : ['highlight']},
  271. \ 'depends' : ['Shougo/unite.vim']
  272. \ })
  273. NeoBundle 'osyo-manga/unite-qfixhowm'
  274. call neobundle#config('unite-qfixhowm', {
  275. \ 'lazy' : 1,
  276. \ 'autoload' : { 'unite_sources' : ['qfixhowm', 'qfixhowm/new']},
  277. \ 'depends' : ['Shougo/unite.vim', 'fuenor/qfixhowm']
  278. \ })
  279. NeoBundle 'osyo-manga/unite-quickfix'
  280. call neobundle#config('unite-quickfix', {
  281. \ 'lazy' : 1,
  282. \ 'autoload' : { 'unite_sources' : ['quickfix', 'location_list']},
  283. \ 'depends' : 'Shougo/unite.vim'
  284. \ })
  285. NeoBundle 'osyo-manga/vim-marching'
  286. call neobundle#config('vim-marching', {
  287. \ 'depends' : ['Shougo/vimproc.vim', 'osyo-manga/vim-reunions']
  288. \ })
  289. NeoBundle 'osyo-manga/vim-monster'
  290. call neobundle#config('vim-monster', {
  291. \ 'lazy' : 1,
  292. \ 'autoload' : { 'filetypes' : 'ruby' }
  293. \ })
  294. NeoBundle 'osyo-manga/vim-reunions'
  295. NeoBundle 'osyo-manga/vim-snowdrop'
  296. call neobundle#config('vim-snowdrop', {
  297. \ 'lazy' : 1,
  298. \ 'autoload' : { 'filetypes' : 'cpp' }
  299. \ })
  300. NeoBundle "osyo-manga/vim-watchdogs"
  301. NeoBundle 'raa0121/vim-ulilith'
  302. NeoBundle 'rbtnn/vimconsole.vim'
  303. call neobundle#config('vimconsole.vim', {
  304. \ 'lazy' : 1,
  305. \ 'depends' : 'thinca/vim-prettyprint',
  306. \ 'autoload' : { 'commands' : 'VimConsoleOpen' }
  307. \ })
  308. NeoBundle 'ryutorion/vim-itunes'
  309. NeoBundle 'slim-template/vim-slim'
  310. NeoBundle 'sudo.vim'
  311. NeoBundle 'supermomonga/thingspast.vim'
  312. "call neobundle#config('thingspast.vim', {
  313. " \ 'build' : { 'unix' : 'bundle install' }
  314. " \ })
  315. NeoBundle 'thinca/vim-ft-clojure'
  316. call neobundle#config('vim-ft-clojure', {
  317. \ 'lazy' : 1,
  318. \ 'autoload' : { 'filetypes' : 'clojure' }
  319. \ })
  320. NeoBundle 'thinca/vim-github'
  321. call neobundle#config('vim-github', {
  322. \ 'lazy' : 1,
  323. \ 'autoload' : { 'commands' : 'Github' }
  324. \ })
  325. NeoBundle 'thinca/vim-prettyprint'
  326. call neobundle#config('vim-prettyprint', {
  327. \ 'lazy' : 1,
  328. \ 'autoload' : { 'commands' : ['PP', 'PrettyPrint']}
  329. \ })
  330. NeoBundle 'thinca/vim-quickrun'
  331. call neobundle#config('vim-quickrun', {
  332. \ 'lazy' : 1,
  333. \ 'autoload' : {
  334. \ 'mappings' : [
  335. \ ['nxo', '<Plug>(quickrun)']],
  336. \ 'commands' : 'QuickRun',
  337. \ },
  338. \ })
  339. NeoBundle 'thinca/vim-ref'
  340. call neobundle#config('vim-ref', {
  341. \ 'lazy' : 1,
  342. \ 'autoload' : { 'commands' : ['Ref', 'RefHistory'],
  343. \ 'unite_sources' : ['ref/erlang', 'ref/man',
  344. \ 'ref/pydoc', 'ref/redis',
  345. \ 'ref/refe', 'ref/webdict']}
  346. \ })
  347. NeoBundle 'thinca/vim-singleton'
  348. NeoBundle 'thinca/vim-splash'
  349. NeoBundle 'thinca/vim-threes'
  350. call neobundle#config('vim-threes', {
  351. \ 'lazy' : 1,
  352. \ 'autoload' : { 'commands' : 'ThreesStart' }
  353. \ })
  354. NeoBundle 'tsukkee/lingr-vim'
  355. call neobundle#config('lingr-vim', {
  356. \ 'lazy' : 1,
  357. \ 'autoload' : { 'commands' : 'LingrLaunch' }
  358. \ })
  359. NeoBundle 'tyru/kirikiri.vim'
  360. call neobundle#config('lingr-vim', {
  361. \ 'lazy' : 1,
  362. \ 'autoload' : { 'filetypes' : 'kscript' }
  363. \ })
  364. NeoBundle 'tyru/open-browser.vim'
  365. call neobundle#config('open-browser.vim',{
  366. \ 'lazy' : 1,
  367. \ 'autoload' : {
  368. \ 'mappings' : '<Plug>(open-browser-wwwsearch)',
  369. \ }
  370. \ })
  371. NeoBundle 'ujihisa/neco-ghc'
  372. call neobundle#config('neco-ghc', {
  373. \ 'lazy' : 1,
  374. \ 'autoload' : { 'filetypes' : 'haskell' }
  375. \ })
  376. NeoBundle 'ujihisa/neco-look'
  377. NeoBundle 'ujihisa/neoclojure.vim'
  378. call neobundle#config('neco-ghc', {
  379. \ 'lazy' : 1,
  380. \ 'autoload' : { 'filetypes' : 'clojure' }
  381. \ })
  382. NeoBundle 'ujihisa/unite-colorscheme'
  383. call neobundle#config('unite-colorscheme', {
  384. \ 'lazy' : 1,
  385. \ 'autoload' : { 'unite_sources' : ['colorscheme'] }
  386. \ })
  387. NeoBundle 'ujihisa/vimshell-ssh'
  388. call neobundle#config('vimshell-ssh',{
  389. \ 'lazy' : 1,
  390. \ 'depends' : 'Shougo/vimshell',
  391. \ 'autoload' : { 'filetypes' : 'vimshell'}
  392. \ })
  393. NeoBundle 'vim-jp/vimdoc-ja'
  394. NeoBundle 'vim-jp/vital.vim', 'PM2'
  395. call neobundle#config('vital.vim', {
  396. \ 'lazy' : 1,
  397. \ 'autoload' : {
  398. \ 'commands' : ['Vitalize'],
  399. \ 'functions' : ['vital#of', 'vital']
  400. \ }
  401. \ })
  402. NeoBundle 'yoppi/fluentd.vim'
  403. call neobundle#config('fluentd.vim',{
  404. \ 'lazy' : 1,
  405. \ 'autoload' : { 'filetypes' : 'fluentd'}
  406. \ })
  407. NeoBundle 'yuratomo/w3m.vim'
  408. call neobundle#config('w3m.vim',{
  409. \ 'lazy' : 1,
  410. \ 'autoload' : { 'commands' : ['W3m', 'W3mTab']}
  411. \ })
  412. filetype plugin indent on
  413. if has('clientserver')
  414. call singleton#enable()
  415. end
  416. set ww+=h,l,>,<,[,]
  417. set mouse=a
  418. set ttymouse=xterm2
  419. set clipboard=unnamedplus
  420. " ,is: シェルを起動
  421. nnoremap <silent> ,is :VimShell<CR>
  422. " ,ipy: pythonを非同期で起動
  423. nnoremap <silent> ,ipy :VimShellInteractive python<CR>
  424. " ,irb: irbを非同期で起動
  425. nnoremap <silent> ,irb :VimShellInteractive irb<CR>
  426. " ,ss: 非同期で開いたインタプリタに現在の行を評価させる
  427. vmap <silent> ,ss :VimShellSendString<CR>
  428. " 選択中に,ss: 非同期で開いたインタプリタに選択行を評価させる
  429. nnoremap <silent> ,ss <S-v>:VimShellSendString<CR>
  430. " ,vs: vimshell
  431. nnoremap <silent> ,vs :tabnew +VimShell<CR>
  432. " ,vr: .vimrc
  433. nnoremap <silent> ,vr :tabnew ~/.vimrc<CR>:lcd<CR>
  434. nnoremap <silent> ,so :so ~/.vimrc<CR>
  435. nnoremap <silent> ,nu :tabnew +Unite\ neobundle/update<CR>
  436. nnoremap <silent> ,ll :tabnew +LingrLaunch<CR>
  437. nnoremap <Esc><Esc> :nohlsearch<CR><ESC>
  438. nnoremap <silent> ,ts :<C-u>tab stj <C-R>=expand('<cword>')<CR><CR>
  439. map / <Plug>(incsearch-forward)
  440. map ? <Plug>(incsearch-backward)
  441. map g/ <Plug>(incsearch-stay)
  442. if neobundle#is_installed('neocomplcache')
  443. let g:neocomplcache_enable_at_startup = 1
  444. let g:neocomplcache_enable_smart_case = 1
  445. let g:neocomplcache_enable_camel_case_completion = 1
  446. let g:neocomplcache_enable_underbar_completion = 1
  447. let g:neocomplcache_min_syntax_length = 3
  448. let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'
  449. let g:neocomplcache_keyword_patterns = get(g:, 'neocomplecache_keyword_patterns', {})
  450. let g:neocomplcache_keyword_patterns['default'] = '\h\w*'
  451. endif
  452. if neobundle#is_installed('neocomplete.vim')
  453. let g:neocomplete#enable_at_startup = 1
  454. let g:neocomplete#enable_smart_case = 1
  455. let g:neocomplete#enable_camel_case_completion = 1
  456. let g:neocomplete#enable_underbar_completion = 1
  457. let g:neocomplete#min_syntax_length = 3
  458. let g:neocomplete#lock_buffer_name_pattern = '\*ku\*'
  459. let g:neocomplete#keyword_patterns = get(g:, 'neocomplete#keyword_patterns', {})
  460. let g:neocomplete#keyword_patterns['default'] = '\h\w*'
  461. let g:neocomplete#force_omni_input_patterns = get(g:, 'neocomplete#force_omni_input_patterns', {})
  462. let g:neocomplete#sources#omni#input_patterns = get(g:, 'neocomplete#sources#omni#input_patterns', {})
  463. endif
  464. let g:vimfiler_as_default_explorer = 1
  465. let g:vimfiler_safe_mode_by_default = 0
  466. "let g:neocomplcache#sources#rsense#home_directory = '/opt/rsense-0.3/'
  467. let g:neocomplcache_text_mode_filetypes = {
  468. \ 'tex': 1,
  469. \ 'plaintex': 1,
  470. \}
  471. let g:neocomplete#text_mode_filetypes = {
  472. \ 'tex': 1,
  473. \ 'plaintex': 1,
  474. \}
  475. let g:neocomplete#force_omni_input_patterns.cpp =
  476. \ '[^.[:digit:] *\t]\%(\.\|->\)\w*\|\h\w*::\w*'
  477. let g:neocomplete#force_omni_input_patterns.ruby = '[^. *\t]\.\|\h\w*::'
  478. let g:monster#completion#rcodetools#backend = "async_rct_complete"
  479. let g:neosnippet#snippets_directory = '~/.vim/snippet,~/.bundle/vim-snippets/snippets'
  480. "tabで補完候補の選択を行う
  481. imap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
  482. imap <expr><S-TAB> pumvisible() ? "\<C-u>" : "\<S-TAB>"
  483. imap <expr><CR> neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : "\<CR>"
  484. smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
  485. \ "\<Plug>(neosnippet_expand_or_jump)"
  486. \: "\<TAB>"
  487. augroup vimrc
  488. autocmd!
  489. augroup END
  490. autocmd vimrc FileType css setlocal omnifunc=csscomplete#CompleteCSS
  491. autocmd vimrc FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
  492. autocmd vimrc FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
  493. autocmd vimrc FileType python setlocal omnifunc=pythoncomplete#Complete
  494. autocmd vimrc FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
  495. autocmd vimrc FileType clojure setlocal omnifunc=neoclojure#complete#omni
  496. autocmd vimrc BufNewFile,BufRead *.{md,mdwn,mkd,mkdn,mark*} setlocal filetype=markdown
  497. autocmd vimrc BufNewFile,BufRead *.rb set tags+=$HOME/ctags/ruby.tags
  498. autocmd vimrc BufNewFile,BufRead *.c set tags+=$HOME/ctags/c.tags
  499. let g:netrw_nogx = 1
  500. nmap gx <Plug>(openbrowser-smart-search)
  501. vmap gx <Plug>(openbrowser-smart-search)
  502. let g:quickrun_config = {}
  503. let g:quickrun_config = {
  504. \ '_' : {
  505. \ 'hook/close_unite_quickfix/enable_hook_loaded' : 1,
  506. \ 'hook/unite_quickfix/enable_failure' : 1,
  507. \ 'hook/close_quickfix/enable_exit' : 1,
  508. \ 'hook/close_buffer/enable_failure' : 1,
  509. \ 'hook/close_buffer/enable_empty_data' : 1,
  510. \ 'outputter' : 'multi:buffer:quickfix',
  511. \ 'hook/u_nya_/enable' : 1,
  512. \ 'hook/sweep/enable' : 0,
  513. \ 'outputter/buffer/split' : ':botright 15sp',
  514. \ 'outputter/buffer/running_mark' : 'バン(∩`・ω・)バンバンバンバン゙ン',
  515. \ 'runner' : 'vimproc',
  516. \ 'runner/vimproc/updatetime' : 40,
  517. \ 'runner/vimproc/sleep' : 0,
  518. \ }
  519. \ }
  520. let g:quickrun_config['markdown'] = {
  521. \ 'outputter': 'browser'
  522. \}
  523. let g:quickrun_config.ruby = {
  524. \ 'command': 'ruby',
  525. \ 'exec': '/usr/bin/env ruby %s',
  526. \ 'tempfile': '{tempname()}.rb'
  527. \}
  528. let g:quickrun_config['clojure/neoclojure'] = {
  529. \ 'type' : 'clojure/neoclojure',
  530. \ 'runner' : 'neoclojure',
  531. \ 'command' : 'dummy',
  532. \ 'tempfile' : '%{tempname()}.clj'
  533. \}
  534. let g:quickrun_config.cpp = {
  535. \ 'cmdopt': '-std=c++1y -Wall'
  536. \ }
  537. call watchdogs#setup(g:quickrun_config)
  538. let g:lingr_vim_user = 'raa0121'
  539. let g:J6uil_display_offline = 0
  540. let g:J6uil_display_online = 0
  541. let g:J6uil_echo_presence = 1
  542. let g:J6uil_display_icon = 0
  543. let g:J6uil_display_interval = 0
  544. let g:J6uil_updatetime = 1000
  545. let QFixHowm_Key = 'g'
  546. let howm_dir = '~/howm'
  547. let howm_filename = '%Y/%m/%Y-%m-%d-%H%M%S.txt'
  548. let howm_fileencoding = 'utf-8'
  549. let howm_fileformat = 'unix'
  550. let g:qfixmemo_calendar = 0
  551. let g:calendar_howm_syntax = 0
  552. let mygrepprg = 'grep'
  553. if has('win32unix')
  554. let MyGrep_cygwin17 = 1
  555. endif
  556. let g:calendar_google_calendar = 1
  557. let g:calendar_google_task = 1
  558. let g:marching_clang_command = '/usr/bin/clang'
  559. let g:marching_clang_command_option="-std=c++1y"
  560. let g:marching_enable_neocomplete = 1
  561. let g:marching_include_paths = ['/usr/include/c++/4.8.2/']
  562. let g:snowdrop#libclang_path='/usr/lib'
  563. call unite#filters#matcher_default#use(['matcher_fuzzy'])
  564. let g:unite_enable_start_insert = 1
  565. let g:unite_source_directory_mru_long_limit = 3000
  566. let g:unite_source_file_mru_filename_format = ''
  567. let g:unite_source_file_mru_long_limit = 3000
  568. let g:unite_source_history_yank_enable = 1
  569. let g:unite_split_rule = 'botright'
  570. let g:unite_winheight = 15
  571. augroup plugin-lingr-vim
  572. autocmd!
  573. autocmd FileType lingr-messages nmap <silent> <buffer> t <Plug>(lingr-messages-show-say-buffer)
  574. autocmd FileType lingr-say let &syntax='clojure'
  575. augroup END
  576. function! s:SID_PREFIX()
  577. return matchstr(expand('<sfile>'), '<SNR>\d\+_')
  578. endfunction
  579. set titlelen=100
  580. set guioptions-=e
  581. autocmd vimrc BufEnter * let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  582. autocmd vimrc User plugin-lingr-unread let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  583. if !has('gui_running')
  584. set t_Co=256
  585. endif
  586. if exists('$TMUX') || exists('$WINDOW')
  587. set t_ts=k
  588. set t_fs=\
  589. endif
  590. function! s:titlestring()
  591. if &filetype =~ '^lingr'
  592. let &titlestring = 'lingr: ' . lingr#unread_count()
  593. else
  594. let &titlestring = bufname('')
  595. endif
  596. endfunction
  597. " tabline
  598. set showtabline=2 " always show tabline
  599. let g:lightline = {
  600. \ 'colorscheme': 'wombat',
  601. \ 'component': {
  602. \ 'readonly': '%{&readonly?"":""}',
  603. \ },
  604. \ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" },
  605. \ 'subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" }
  606. \ }
  607. let &tabline = '%!' . s:SID_PREFIX() . 'tabline()'
  608. function! s:tabline()
  609. " show each tab
  610. let s = ''
  611. for i in range(1, tabpagenr('$'))
  612. let list = tabpagebuflist(i)
  613. let nr = tabpagewinnr(i)
  614. let current_tabnr = tabpagenr()
  615. "let title = bufname('')
  616. if i == current_tabnr
  617. let title = fnamemodify(getcwd(), ':t') . '/'
  618. "let title = bufname('')
  619. else
  620. let title = fnamemodify(gettabvar(i, 'cwd'), ':t') . '/'
  621. endif
  622. let title = empty(title) ? '[No Name]' : title
  623. let s .= i == current_tabnr ? '%#TabLineSel#' : '%#TabLine#'
  624. let s .= '%' . i . 'T[' . i . '] ' . title
  625. let s .= ' '
  626. endfor
  627. " show lingr unread count
  628. let lingr_unread = ""
  629. if exists('*lingr#unread_count')
  630. let lingr_unread_count = lingr#unread_count()
  631. if lingr_unread_count > 0
  632. let lingr_unread = "%#ErrorMsg#(" . lingr_unread_count . ")"
  633. elseif lingr_unread_count == 0
  634. let lingr_unread = "()"
  635. endif
  636. endif
  637. " build tabline
  638. let s .= '%#TabLineFill#%T%=%<[' . getcwd() . ']' . lingr_unread
  639. return s
  640. endfunction
  641. augroup vimrc-scratch-buffer
  642. autocmd!
  643. " Make a scratch buffer when unnamed buffer.
  644. autocmd BufEnter * call s:scratch_buffer()
  645. autocmd FileType qfreplace autocmd! vimrc-scratch * <buffer>
  646. function! s:scratch_buffer()
  647. if exists('b:scratch_buffer') || bufname('%') !=# '' || &l:buftype !=# ''
  648. return
  649. endif
  650. let b:scratch_buffer = 1
  651. setlocal buftype=nofile nobuflisted noswapfile bufhidden=hide
  652. augroup vimrc-scratch
  653. autocmd! * <buffer>
  654. autocmd BufWriteCmd <buffer> call s:scratch_on_BufWriteCmd()
  655. augroup END
  656. endfunction
  657. function! s:scratch_on_BufWriteCmd()
  658. silent! setl buftype< buflisted< swapfile< bufhidden< nomodified
  659. autocmd! vimrc-scratch * <buffer>
  660. if bufname('%') ==# '' && exists('b:scratch_buffer')
  661. execute 'saveas' . (v:cmdbang ? '!' : '') ' <afile>'
  662. filetype detect
  663. endif
  664. unlet! b:scratch_buffer
  665. endfunction
  666. augroup END
  667. command! -nargs=? ExtractMatches let s:pat = empty(<q-args>) ? @/ : <q-args> | let s:result = filter(getline(1, '$'), 'v:val =~# s:pat') | new | put =s:result
  668. let g:github_user = 'raa0121'
  669. let g:github#user = 'raa0121'