.vimrc 23 KB

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