.vimrc 23 KB

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