.vimrc 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738
  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 'itchyny/calendar.vim'
  193. NeoBundle 'itchyny/lightline.vim'
  194. NeoBundle 'jceb/vim-orgmode'
  195. call neobundle#config('vim-orgmode', {
  196. \ 'lazy' : 1,
  197. \ 'autoload' : { 'filetypes' : 'org' }
  198. \ })
  199. NeoBundle 'jdonaldson/vaxe'
  200. call neobundle#config('vaxe', {
  201. \ 'lazy': 1,
  202. \ 'autoload' : {'filetypes': 'haxe'}
  203. \})
  204. NeoBundle 'kamichidu/unite-javaimport', 'dev'
  205. call neobundle#config('unite-javaimport', {
  206. \ 'lazy' : 1,
  207. \ 'depends' : [
  208. \ 'kamichidu/vim-javalang', 'kamichidu/vim-javaclasspath',
  209. \ 'Shougo/unite.vim', 'yuratomo/w3m.vim'],
  210. \ 'autoload' : { 'filetypes' : ['java', 'scala', 'clojure']}
  211. \})
  212. NeoBundle 'kana/vim-smartinput'
  213. NeoBundle 'kamichidu/vim-ref-java'
  214. call neobundle#config('vim-ref-java', {
  215. \ 'depends' : [ 'mattn/wwwrenderer-vim' ],
  216. \})
  217. NeoBundle 'kamichidu/vim-vdbc'
  218. call neobundle#config('vim-vdbc', {
  219. \ 'depends' : ['Shougo/vimproc.vim'] ,
  220. \ 'build': {
  221. \ 'unix' : 'make -f Makefile',
  222. \ 'windows' : 'make -f Makefile.w64'
  223. \ }
  224. \})
  225. NeoBundle 'mattn/benchvimrc-vim'
  226. call neobundle#config('benchvimrc-vim', {
  227. \ 'lazy' : 1,
  228. \ 'autoload' : { 'commands' : 'BenchVimrc' }
  229. \ })
  230. NeoBundle 'mattn/flappyvird-vim'
  231. call neobundle#config('flappyvird-vim', {
  232. \ 'lazy' : 1,
  233. \ 'autoload' : { 'commands' : 'FlappyVird' }
  234. \ })
  235. NeoBundle 'mattn/gist-vim'
  236. call neobundle#config('gist-vim', {
  237. \ 'lazy' : 1,
  238. \ 'autoload' : { 'commands' : 'Gist' }
  239. \ })
  240. NeoBundle 'mattn/libcallex-vim'
  241. NeoBundle 'mattn/mahjong-vim'
  242. call neobundle#config('mahjong-vim', {
  243. \ 'lazy' : 1,
  244. \ 'autoload' : { 'commands' : 'Mahjong' }
  245. \ })
  246. NeoBundle 'mattn/sonictemplate-vim'
  247. call neobundle#config('sonictemplate-vim', {
  248. \ 'lazy' : 1,
  249. \ 'autoload' : { 'commands' : 'Template' }
  250. \ })
  251. NeoBundle 'mattn/unite-rhythmbox'
  252. call neobundle#config('unite-rhythmbox', {
  253. \ 'lazy' : 1,
  254. \ 'autoload' : { 'unite_sources' : 'rhythmbox' },
  255. \ 'depends' : 'Shougo/unite.vim'
  256. \ })
  257. NeoBundle 'mattn/webapi-vim'
  258. NeoBundle 'osyo-manga/quickrun-hook-u-nya-'
  259. call neobundle#config('quickrun-hook-u-nya-', {
  260. \ 'depends' : 'thinca/vim-quickrun'
  261. \ })
  262. NeoBundle 'osyo-manga/unite-filetype'
  263. call neobundle#config('unite-filetype', {
  264. \ 'lazy' : 1,
  265. \ 'autoload' : { 'unite_sources' : ['filetype', 'filetype/new']},
  266. \ 'depends' : ['Shougo/unite.vim']
  267. \ })
  268. NeoBundle 'osyo-manga/unite-highlight'
  269. call neobundle#config('unite-highlight', {
  270. \ 'lazy' : 1,
  271. \ 'autoload' : { 'unite_sources' : ['highlight']},
  272. \ 'depends' : ['Shougo/unite.vim']
  273. \ })
  274. NeoBundle 'osyo-manga/unite-qfixhowm'
  275. call neobundle#config('unite-qfixhowm', {
  276. \ 'lazy' : 1,
  277. \ 'autoload' : { 'unite_sources' : ['qfixhowm', 'qfixhowm/new']},
  278. \ 'depends' : ['Shougo/unite.vim', 'fuenor/qfixhowm']
  279. \ })
  280. NeoBundle 'osyo-manga/unite-quickfix'
  281. call neobundle#config('unite-quickfix', {
  282. \ 'lazy' : 1,
  283. \ 'autoload' : { 'unite_sources' : ['quickfix', 'location_list']},
  284. \ 'depends' : 'Shougo/unite.vim'
  285. \ })
  286. NeoBundle 'osyo-manga/vim-marching'
  287. call neobundle#config('vim-marching', {
  288. \ 'depends' : ['Shougo/vimproc.vim', 'osyo-manga/vim-reunions']
  289. \ })
  290. NeoBundle 'osyo-manga/vim-monster'
  291. call neobundle#config('vim-monster', {
  292. \ 'lazy' : 1,
  293. \ 'autoload' : { 'filetypes' : 'ruby' }
  294. \ })
  295. NeoBundle 'osyo-manga/vim-reunions'
  296. NeoBundle 'osyo-manga/vim-snowdrop'
  297. call neobundle#config('vim-snowdrop', {
  298. \ 'lazy' : 1,
  299. \ 'autoload' : { 'filetypes' : 'cpp' }
  300. \ })
  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. if neobundle#is_installed('neocomplcache')
  440. let g:neocomplcache_enable_at_startup = 1
  441. let g:neocomplcache_enable_smart_case = 1
  442. let g:neocomplcache_enable_camel_case_completion = 1
  443. let g:neocomplcache_enable_underbar_completion = 1
  444. let g:neocomplcache_min_syntax_length = 3
  445. let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'
  446. let g:neocomplcache_keyword_patterns = get(g:, 'neocomplecache_keyword_patterns', {})
  447. let g:neocomplcache_keyword_patterns['default'] = '\h\w*'
  448. endif
  449. if neobundle#is_installed('neocomplete.vim')
  450. let g:neocomplete#enable_at_startup = 1
  451. let g:neocomplete#enable_smart_case = 1
  452. let g:neocomplete#enable_camel_case_completion = 1
  453. let g:neocomplete#enable_underbar_completion = 1
  454. let g:neocomplete#min_syntax_length = 3
  455. let g:neocomplete#lock_buffer_name_pattern = '\*ku\*'
  456. let g:neocomplete#keyword_patterns = get(g:, 'neocomplete#keyword_patterns', {})
  457. let g:neocomplete#keyword_patterns['default'] = '\h\w*'
  458. let g:neocomplete#force_omni_input_patterns = get(g:, 'neocomplete#force_omni_input_patterns', {})
  459. let g:neocomplete#sources#omni#input_patterns = get(g:, 'neocomplete#sources#omni#input_patterns', {})
  460. endif
  461. let g:vimfiler_as_default_explorer = 1
  462. let g:vimfiler_safe_mode_by_default = 0
  463. "let g:neocomplcache#sources#rsense#home_directory = '/opt/rsense-0.3/'
  464. let g:neocomplcache_text_mode_filetypes = {
  465. \ 'tex': 1,
  466. \ 'plaintex': 1,
  467. \}
  468. let g:neocomplete#text_mode_filetypes = {
  469. \ 'tex': 1,
  470. \ 'plaintex': 1,
  471. \}
  472. let g:neocomplete#force_omni_input_patterns.cpp =
  473. \ '[^.[:digit:] *\t]\%(\.\|->\)\w*\|\h\w*::\w*'
  474. let g:neocomplete#sources#omni#input_patterns.haxe =
  475. \ '\v([\]''"\)]|\w|(^\s*))(\.|\()'
  476. let g:neocomplete#force_omni_input_patterns.ruby = '[^. *\t]\.\|\h\w*::'
  477. let g:monster#completion#rcodetools#backend = "async_rct_complete"
  478. let g:neosnippet#snippets_directory = '~/.vim/snippet'
  479. "tabで補完候補の選択を行う
  480. imap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
  481. imap <expr><S-TAB> pumvisible() ? "\<C-u>" : "\<S-TAB>"
  482. imap <expr><CR> neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : "\<CR>"
  483. smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
  484. \ "\<Plug>(neosnippet_expand_or_jump)"
  485. \: "\<TAB>"
  486. augroup vimrc
  487. autocmd!
  488. augroup END
  489. autocmd vimrc FileType css setlocal omnifunc=csscomplete#CompleteCSS
  490. autocmd vimrc FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
  491. autocmd vimrc FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
  492. autocmd vimrc FileType python setlocal omnifunc=pythoncomplete#Complete
  493. autocmd vimrc FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
  494. autocmd vimrc FileType clojure setlocal omnifunc=neoclojure#complete#omni
  495. autocmd vimrc BufNewFile,BufRead *.{md,mdwn,mkd,mkdn,mark*} setlocal filetype=markdown
  496. autocmd vimrc FileType haxe setl autowrite
  497. autocmd vimrc FileType hxml setl autowrite
  498. autocmd vimrc FileType nmml.xml setl autowrite
  499. autocmd vimrc BufNewFile,BufRead *.rb set tags+=$HOME/ctags/ruby.tags
  500. autocmd vimrc BufNewFile,BufRead *.c set tags+=$HOME/ctags/c.tags
  501. let g:vaxe_haxe_version = 3
  502. function! s:init_vaxe_keymap()
  503. " .hxmlファイルを開いてくれるやつ
  504. nnoremap <buffer> ,vo :<C-u>call vaxe#OpenHxml()<CR>
  505. " タグファイル作ってくれるやつ(別途、.ctagsの定義をしませう)
  506. nnoremap <buffer> ,vc :<C-u>call vaxe#Ctags()<CR>
  507. " 自動インポートな
  508. nnoremap <buffer> ,vi :<C-u>call vaxe#ImportClass()<CR>
  509. endfunction
  510. autocmd vimrc FileType haxe call s:init_vaxe_keymap()
  511. autocmd vimrc FileType hxml call s:init_vaxe_keymap()
  512. autocmd vimrc FileType nmml.xml call s:init_vaxe_keymap()
  513. let g:netrw_nogx = 1
  514. nmap gx <Plug>(openbrowser-smart-search)
  515. vmap gx <Plug>(openbrowser-smart-search)
  516. let g:quickrun_config = {}
  517. let g:quickrun_config = {
  518. \ '_' : {
  519. \ 'hook/close_unite_quickfix/enable_hook_loaded' : 1,
  520. \ 'hook/unite_quickfix/enable_failure' : 1,
  521. \ 'hook/close_quickfix/enable_exit' : 1,
  522. \ 'hook/close_buffer/enable_failure' : 1,
  523. \ 'hook/close_buffer/enable_empty_data' : 1,
  524. \ 'outputter' : 'multi:buffer:quickfix',
  525. \ 'hook/u_nya_/enable' : 1,
  526. \ 'hook/sweep/enable' : 0,
  527. \ 'outputter/buffer/split' : ':botright 15sp',
  528. \ 'outputter/buffer/running_mark' : 'バン(∩`・ω・)バンバンバンバン゙ン',
  529. \ 'runner' : 'vimproc',
  530. \ 'runner/vimproc/updatetime' : 40,
  531. \ 'runner/vimproc/sleep' : 0,
  532. \ }
  533. \ }
  534. let g:quickrun_config['markdown'] = {
  535. \ 'outputter': 'browser'
  536. \}
  537. let g:quickrun_config.ruby = {
  538. \ 'command': 'ruby',
  539. \ 'exec': '/usr/bin/env ruby %s',
  540. \ 'tempfile': '{tempname()}.rb'
  541. \}
  542. let g:quickrun_config['clojure/neoclojure'] = {
  543. \ 'type' : 'clojure/neoclojure',
  544. \ 'runner' : 'neoclojure',
  545. \ 'command' : 'dummy',
  546. \ 'tempfile' : '%{tempname()}.clj'
  547. \}
  548. let g:quickrun_config.cpp = {
  549. \ 'cmdopt': '-std=c++1y -Wall'
  550. \ }
  551. let g:lingr_vim_user = 'raa0121'
  552. let g:J6uil_display_offline = 0
  553. let g:J6uil_display_online = 0
  554. let g:J6uil_echo_presence = 1
  555. let g:J6uil_display_icon = 0
  556. let g:J6uil_display_interval = 0
  557. let g:J6uil_updatetime = 1000
  558. let QFixHowm_Key = 'g'
  559. let howm_dir = '~/howm'
  560. let howm_filename = '%Y/%m/%Y-%m-%d-%H%M%S.txt'
  561. let howm_fileencoding = 'utf-8'
  562. let howm_fileformat = 'unix'
  563. let g:qfixmemo_calendar = 0
  564. let g:calendar_howm_syntax = 0
  565. let mygrepprg = 'grep'
  566. if has('win32unix')
  567. let MyGrep_cygwin17 = 1
  568. endif
  569. let g:calendar_google_calendar = 1
  570. let g:calendar_google_task = 1
  571. let g:marching_clang_command = '/usr/bin/clang'
  572. let g:marching_clang_command_option="-std=c++1y"
  573. let g:marching_enable_neocomplete = 1
  574. let g:marching_include_paths = ['/usr/include/c++/4.8.2/']
  575. let g:snowdrop#libclang_path='/usr/lib'
  576. call unite#filters#matcher_default#use(['matcher_fuzzy'])
  577. let g:unite_enable_start_insert = 1
  578. let g:unite_source_directory_mru_long_limit = 3000
  579. let g:unite_source_file_mru_filename_format = ''
  580. let g:unite_source_file_mru_long_limit = 3000
  581. let g:unite_source_history_yank_enable = 1
  582. let g:unite_split_rule = 'botright'
  583. let g:unite_winheight = 15
  584. augroup plugin-lingr-vim
  585. autocmd!
  586. autocmd FileType lingr-messages nmap <silent> <buffer> t <Plug>(lingr-messages-show-say-buffer)
  587. autocmd FileType lingr-say let &syntax='clojure'
  588. augroup END
  589. function! s:SID_PREFIX()
  590. return matchstr(expand('<sfile>'), '<SNR>\d\+_')
  591. endfunction
  592. set titlelen=100
  593. set guioptions-=e
  594. autocmd vimrc BufEnter * let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  595. autocmd vimrc User plugin-lingr-unread let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  596. if !has('gui_running')
  597. set t_Co=256
  598. endif
  599. if exists('$TMUX') || exists('$WINDOW')
  600. set t_ts=k
  601. set t_fs=\
  602. endif
  603. function! s:titlestring()
  604. if &filetype =~ '^lingr'
  605. let &titlestring = 'lingr: ' . lingr#unread_count()
  606. else
  607. let &titlestring = bufname('')
  608. endif
  609. endfunction
  610. " tabline
  611. set showtabline=2 " always show tabline
  612. let g:lightline = {
  613. \ 'colorscheme': 'wombat',
  614. \ 'component': {
  615. \ 'readonly': '%{&readonly?"":""}',
  616. \ },
  617. \ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" },
  618. \ 'subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" }
  619. \ }
  620. let &tabline = '%!' . s:SID_PREFIX() . 'tabline()'
  621. function! s:tabline()
  622. " show each tab
  623. let s = ''
  624. for i in range(1, tabpagenr('$'))
  625. let list = tabpagebuflist(i)
  626. let nr = tabpagewinnr(i)
  627. let current_tabnr = tabpagenr()
  628. "let title = bufname('')
  629. if i == current_tabnr
  630. let title = fnamemodify(getcwd(), ':t') . '/'
  631. "let title = bufname('')
  632. else
  633. let title = fnamemodify(gettabvar(i, 'cwd'), ':t') . '/'
  634. endif
  635. let title = empty(title) ? '[No Name]' : title
  636. let s .= i == current_tabnr ? '%#TabLineSel#' : '%#TabLine#'
  637. let s .= '%' . i . 'T[' . i . '] ' . title
  638. let s .= ' '
  639. endfor
  640. " show lingr unread count
  641. let lingr_unread = ""
  642. if exists('*lingr#unread_count')
  643. let lingr_unread_count = lingr#unread_count()
  644. if lingr_unread_count > 0
  645. let lingr_unread = "%#ErrorMsg#(" . lingr_unread_count . ")"
  646. elseif lingr_unread_count == 0
  647. let lingr_unread = "()"
  648. endif
  649. endif
  650. " build tabline
  651. let s .= '%#TabLineFill#%T%=%<[' . getcwd() . ']' . lingr_unread
  652. return s
  653. endfunction
  654. augroup vimrc-scratch-buffer
  655. autocmd!
  656. " Make a scratch buffer when unnamed buffer.
  657. autocmd BufEnter * call s:scratch_buffer()
  658. autocmd FileType qfreplace autocmd! vimrc-scratch * <buffer>
  659. function! s:scratch_buffer()
  660. if exists('b:scratch_buffer') || bufname('%') !=# '' || &l:buftype !=# ''
  661. return
  662. endif
  663. let b:scratch_buffer = 1
  664. setlocal buftype=nofile nobuflisted noswapfile bufhidden=hide
  665. augroup vimrc-scratch
  666. autocmd! * <buffer>
  667. autocmd BufWriteCmd <buffer> call s:scratch_on_BufWriteCmd()
  668. augroup END
  669. endfunction
  670. function! s:scratch_on_BufWriteCmd()
  671. silent! setl buftype< buflisted< swapfile< bufhidden< nomodified
  672. autocmd! vimrc-scratch * <buffer>
  673. if bufname('%') ==# '' && exists('b:scratch_buffer')
  674. execute 'saveas' . (v:cmdbang ? '!' : '') ' <afile>'
  675. filetype detect
  676. endif
  677. unlet! b:scratch_buffer
  678. endfunction
  679. augroup END
  680. 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
  681. let g:github_user = 'raa0121'
  682. let g:github#user = 'raa0121'