.vimrc 23 KB

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