.vimrc 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745
  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', 'yuratomo/w3m.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 'osyo-manga/quickrun-hook-u-nya-'
  256. call neobundle#config('quickrun-hook-u-nya-', {
  257. \ 'depends' : 'thinca/vim-quickrun'
  258. \ })
  259. NeoBundle 'osyo-manga/shabadou.vim'
  260. NeoBundle 'osyo-manga/unite-filetype'
  261. call neobundle#config('unite-filetype', {
  262. \ 'lazy' : 1,
  263. \ 'autoload' : { 'unite_sources' : ['filetype', 'filetype/new']},
  264. \ 'depends' : ['Shougo/unite.vim']
  265. \ })
  266. NeoBundle 'osyo-manga/unite-highlight'
  267. call neobundle#config('unite-highlight', {
  268. \ 'lazy' : 1,
  269. \ 'autoload' : { 'unite_sources' : ['highlight']},
  270. \ 'depends' : ['Shougo/unite.vim']
  271. \ })
  272. NeoBundle 'osyo-manga/unite-qfixhowm'
  273. call neobundle#config('unite-qfixhowm', {
  274. \ 'lazy' : 1,
  275. \ 'autoload' : { 'unite_sources' : ['qfixhowm', 'qfixhowm/new']},
  276. \ 'depends' : ['Shougo/unite.vim', 'fuenor/qfixhowm']
  277. \ })
  278. NeoBundle 'osyo-manga/unite-quickfix'
  279. call neobundle#config('unite-quickfix', {
  280. \ 'lazy' : 1,
  281. \ 'autoload' : { 'unite_sources' : ['quickfix', 'location_list']},
  282. \ 'depends' : 'Shougo/unite.vim'
  283. \ })
  284. NeoBundle 'osyo-manga/vim-marching'
  285. call neobundle#config('vim-marching', {
  286. \ 'depends' : ['Shougo/vimproc.vim', 'osyo-manga/vim-reunions']
  287. \ })
  288. NeoBundle 'osyo-manga/vim-monster'
  289. call neobundle#config('vim-monster', {
  290. \ 'lazy' : 1,
  291. \ 'autoload' : { 'filetypes' : 'ruby' }
  292. \ })
  293. NeoBundle 'osyo-manga/vim-reunions'
  294. NeoBundle 'osyo-manga/vim-snowdrop'
  295. call neobundle#config('vim-snowdrop', {
  296. \ 'lazy' : 1,
  297. \ 'autoload' : { 'filetypes' : 'cpp' }
  298. \ })
  299. NeoBundle 'osyo-manga/vim-watchdogs'
  300. NeoBundle 'raa0121/vim-ulilith'
  301. NeoBundle 'rbtnn/vimconsole.vim'
  302. call neobundle#config('vimconsole.vim', {
  303. \ 'lazy' : 1,
  304. \ 'depends' : 'thinca/vim-prettyprint',
  305. \ 'autoload' : { 'commands' : 'VimConsoleOpen' }
  306. \ })
  307. NeoBundle 'ryutorion/vim-itunes'
  308. NeoBundle 'slim-template/vim-slim'
  309. NeoBundle 'sudo.vim'
  310. NeoBundle 'supermomonga/thingspast.vim'
  311. "call neobundle#config('thingspast.vim', {
  312. " \ 'build' : { 'unix' : 'bundle install' }
  313. " \ })
  314. NeoBundle 'thinca/vim-ft-clojure'
  315. call neobundle#config('vim-ft-clojure', {
  316. \ 'lazy' : 1,
  317. \ 'autoload' : { 'filetypes' : 'clojure' }
  318. \ })
  319. NeoBundle 'thinca/vim-github'
  320. call neobundle#config('vim-github', {
  321. \ 'lazy' : 1,
  322. \ 'autoload' : { 'commands' : 'Github' }
  323. \ })
  324. NeoBundle 'thinca/vim-prettyprint'
  325. call neobundle#config('vim-prettyprint', {
  326. \ 'lazy' : 1,
  327. \ 'autoload' : { 'commands' : ['PP', 'PrettyPrint']}
  328. \ })
  329. NeoBundle 'thinca/vim-quickrun'
  330. call neobundle#config('vim-quickrun', {
  331. \ 'lazy' : 1,
  332. \ 'autoload' : {
  333. \ 'mappings' : [
  334. \ ['nxo', '<Plug>(quickrun)']],
  335. \ 'commands' : 'QuickRun',
  336. \ },
  337. \ })
  338. NeoBundle 'thinca/vim-ref'
  339. call neobundle#config('vim-ref', {
  340. \ 'lazy' : 1,
  341. \ 'autoload' : { 'commands' : ['Ref', 'RefHistory'],
  342. \ 'unite_sources' : ['ref/erlang', 'ref/man',
  343. \ 'ref/pydoc', 'ref/redis',
  344. \ 'ref/refe', 'ref/webdict']}
  345. \ })
  346. NeoBundle 'thinca/vim-singleton'
  347. NeoBundle 'thinca/vim-splash'
  348. NeoBundle 'thinca/vim-textobj-function-javascript'
  349. call neobundle#config('vim-textobj-function-javascript', {
  350. \ 'depends' : ['kana/vim-textobj-function'],
  351. \ 'lazy' : 1,
  352. \ 'autoload' : { 'filetypes' : 'javascript' }
  353. \ })
  354. NeoBundle 'thinca/vim-threes'
  355. call neobundle#config('vim-threes', {
  356. \ 'lazy' : 1,
  357. \ 'autoload' : { 'commands' : 'ThreesStart' }
  358. \ })
  359. NeoBundle 'tsukkee/lingr-vim'
  360. call neobundle#config('lingr-vim', {
  361. \ 'lazy' : 1,
  362. \ 'autoload' : { 'commands' : 'LingrLaunch' }
  363. \ })
  364. NeoBundle 'tyru/kirikiri.vim'
  365. call neobundle#config('lingr-vim', {
  366. \ 'lazy' : 1,
  367. \ 'autoload' : { 'filetypes' : 'kscript' }
  368. \ })
  369. NeoBundle 'tyru/open-browser.vim'
  370. call neobundle#config('open-browser.vim',{
  371. \ 'lazy' : 1,
  372. \ 'autoload' : {
  373. \ 'mappings' : '<Plug>(open-browser-wwwsearch)',
  374. \ }
  375. \ })
  376. NeoBundle 'ujihisa/neco-ghc'
  377. call neobundle#config('neco-ghc', {
  378. \ 'lazy' : 1,
  379. \ 'autoload' : { 'filetypes' : 'haskell' }
  380. \ })
  381. NeoBundle 'ujihisa/neco-look'
  382. NeoBundle 'ujihisa/neoclojure.vim'
  383. call neobundle#config('neco-ghc', {
  384. \ 'lazy' : 1,
  385. \ 'autoload' : { 'filetypes' : 'clojure' }
  386. \ })
  387. NeoBundle 'ujihisa/unite-colorscheme'
  388. call neobundle#config('unite-colorscheme', {
  389. \ 'lazy' : 1,
  390. \ 'autoload' : { 'unite_sources' : ['colorscheme'] }
  391. \ })
  392. NeoBundle 'ujihisa/vimshell-ssh'
  393. call neobundle#config('vimshell-ssh',{
  394. \ 'lazy' : 1,
  395. \ 'depends' : 'Shougo/vimshell',
  396. \ 'autoload' : { 'filetypes' : 'vimshell'}
  397. \ })
  398. NeoBundle 'vim-jp/vimdoc-ja'
  399. NeoBundle 'vim-jp/vital.vim', 'PM2'
  400. call neobundle#config('vital.vim', {
  401. \ 'lazy' : 1,
  402. \ 'autoload' : {
  403. \ 'commands' : ['Vitalize'],
  404. \ 'functions' : ['vital#of', 'vital']
  405. \ }
  406. \ })
  407. NeoBundle 'yoppi/fluentd.vim'
  408. call neobundle#config('fluentd.vim',{
  409. \ 'lazy' : 1,
  410. \ 'autoload' : { 'filetypes' : 'fluentd'}
  411. \ })
  412. NeoBundle 'yuratomo/w3m.vim'
  413. call neobundle#config('w3m.vim',{
  414. \ 'lazy' : 1,
  415. \ 'autoload' : { 'commands' : ['W3m', 'W3mTab']}
  416. \ })
  417. call neobundle#end()
  418. filetype plugin indent on
  419. if has('clientserver')
  420. call singleton#enable()
  421. end
  422. set ww+=h,l,>,<,[,]
  423. set mouse=a
  424. set ttymouse=xterm2
  425. set clipboard=unnamedplus
  426. " ,is: シェルを起動
  427. nnoremap <silent> ,is :VimShell<CR>
  428. " ,ipy: pythonを非同期で起動
  429. nnoremap <silent> ,ipy :VimShellInteractive python<CR>
  430. " ,irb: irbを非同期で起動
  431. nnoremap <silent> ,irb :VimShellInteractive irb<CR>
  432. " ,ss: 非同期で開いたインタプリタに現在の行を評価させる
  433. vmap <silent> ,ss :VimShellSendString<CR>
  434. " 選択中に,ss: 非同期で開いたインタプリタに選択行を評価させる
  435. nnoremap <silent> ,ss <S-v>:VimShellSendString<CR>
  436. " ,vs: vimshell
  437. nnoremap <silent> ,vs :tabnew +VimShell<CR>
  438. " ,vr: .vimrc
  439. nnoremap <silent> ,vr :tabnew ~/.vimrc<CR>:lcd<CR>
  440. nnoremap <silent> ,so :so ~/.vimrc<CR>
  441. nnoremap <silent> ,nu :tabnew +Unite\ neobundle/update<CR>
  442. nnoremap <silent> ,ll :tabnew +LingrLaunch<CR>
  443. nnoremap <Esc><Esc> :nohlsearch<CR><ESC>
  444. nnoremap <silent> ,ts :<C-u>tab stj <C-R>=expand('<cword>')<CR><CR>
  445. map / <Plug>(incsearch-forward)
  446. map ? <Plug>(incsearch-backward)
  447. map g/ <Plug>(incsearch-stay)
  448. if neobundle#is_installed('neocomplcache')
  449. let g:neocomplcache_enable_at_startup = 1
  450. let g:neocomplcache_enable_smart_case = 1
  451. let g:neocomplcache_enable_camel_case_completion = 1
  452. let g:neocomplcache_enable_underbar_completion = 1
  453. let g:neocomplcache_min_syntax_length = 3
  454. let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'
  455. let g:neocomplcache_keyword_patterns = get(g:, 'neocomplecache_keyword_patterns', {})
  456. let g:neocomplcache_keyword_patterns['default'] = '\h\w*'
  457. endif
  458. if neobundle#is_installed('neocomplete.vim')
  459. let g:neocomplete#enable_at_startup = 1
  460. let g:neocomplete#enable_smart_case = 1
  461. let g:neocomplete#enable_camel_case_completion = 1
  462. let g:neocomplete#enable_underbar_completion = 1
  463. let g:neocomplete#min_syntax_length = 3
  464. let g:neocomplete#lock_buffer_name_pattern = '\*ku\*'
  465. let g:neocomplete#keyword_patterns = get(g:, 'neocomplete#keyword_patterns', {})
  466. let g:neocomplete#keyword_patterns['default'] = '\h\w*'
  467. let g:neocomplete#force_omni_input_patterns = get(g:, 'neocomplete#force_omni_input_patterns', {})
  468. let g:neocomplete#sources#omni#input_patterns = get(g:, 'neocomplete#sources#omni#input_patterns', {})
  469. endif
  470. let g:vimfiler_as_default_explorer = 1
  471. let g:vimfiler_safe_mode_by_default = 0
  472. "let g:neocomplcache#sources#rsense#home_directory = '/opt/rsense-0.3/'
  473. let g:neocomplcache_text_mode_filetypes = {
  474. \ 'tex': 1,
  475. \ 'plaintex': 1,
  476. \}
  477. let g:neocomplete#text_mode_filetypes = {
  478. \ 'tex': 1,
  479. \ 'plaintex': 1,
  480. \}
  481. let g:neocomplete#force_omni_input_patterns.cpp =
  482. \ '[^.[:digit:] *\t]\%(\.\|->\)\w*\|\h\w*::\w*'
  483. let g:neocomplete#force_omni_input_patterns.ruby = '[^. *\t]\.\|\h\w*::'
  484. let g:monster#completion#rcodetools#backend = "async_rct_complete"
  485. let g:neosnippet#snippets_directory = '~/.vim/snippet,~/.bundle/vim-snippets/snippets'
  486. "tabで補完候補の選択を行う
  487. imap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
  488. imap <expr><S-TAB> pumvisible() ? "\<C-u>" : "\<S-TAB>"
  489. imap <expr><CR> neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : "\<CR>"
  490. smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
  491. \ "\<Plug>(neosnippet_expand_or_jump)"
  492. \: "\<TAB>"
  493. augroup vimrc
  494. autocmd!
  495. augroup END
  496. autocmd vimrc FileType css setlocal omnifunc=csscomplete#CompleteCSS
  497. autocmd vimrc FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
  498. autocmd vimrc FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
  499. autocmd vimrc FileType python setlocal omnifunc=pythoncomplete#Complete
  500. autocmd vimrc FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
  501. autocmd vimrc FileType clojure setlocal omnifunc=neoclojure#complete#omni
  502. autocmd vimrc BufNewFile,BufRead *.{md,mdwn,mkd,mkdn,mark*} setlocal filetype=markdown
  503. autocmd vimrc BufNewFile,BufRead *.rb set tags+=$HOME/ctags/ruby.tags
  504. autocmd vimrc BufNewFile,BufRead *.c set tags+=$HOME/ctags/c.tags
  505. let g:netrw_nogx = 1
  506. nmap gx <Plug>(openbrowser-smart-search)
  507. vmap gx <Plug>(openbrowser-smart-search)
  508. let g:quickrun_config = {}
  509. let g:quickrun_config = {
  510. \ '_' : {
  511. \ 'hook/close_unite_quickfix/enable_hook_loaded' : 1,
  512. \ 'hook/unite_quickfix/enable_failure' : 1,
  513. \ 'hook/close_quickfix/enable_exit' : 1,
  514. \ 'hook/close_buffer/enable_failure' : 1,
  515. \ 'hook/close_buffer/enable_empty_data' : 1,
  516. \ 'outputter' : 'multi:buffer:quickfix',
  517. \ 'hook/u_nya_/enable' : 1,
  518. \ 'hook/sweep/enable' : 0,
  519. \ 'outputter/buffer/split' : ':botright 15sp',
  520. \ 'outputter/buffer/running_mark' : 'バン(∩`・ω・)バンバンバンバン゙ン',
  521. \ 'runner' : 'vimproc',
  522. \ 'runner/vimproc/updatetime' : 40,
  523. \ 'runner/vimproc/sleep' : 0,
  524. \ }
  525. \ }
  526. let g:quickrun_config['markdown'] = {
  527. \ 'outputter': 'browser'
  528. \}
  529. let g:quickrun_config.ruby = {
  530. \ 'command': 'ruby',
  531. \ 'exec': '/usr/bin/env ruby %s',
  532. \ 'tempfile': '{tempname()}.rb'
  533. \}
  534. let g:quickrun_config['clojure/neoclojure'] = {
  535. \ 'type' : 'clojure/neoclojure',
  536. \ 'runner' : 'neoclojure',
  537. \ 'command' : 'dummy',
  538. \ 'tempfile' : '%{tempname()}.clj'
  539. \}
  540. let g:quickrun_config.cpp = {
  541. \ 'cmdopt': '-std=c++1y -Wall'
  542. \ }
  543. call watchdogs#setup(g:quickrun_config)
  544. let g:lingr_vim_user = 'raa0121'
  545. let g:J6uil_display_offline = 0
  546. let g:J6uil_display_online = 0
  547. let g:J6uil_echo_presence = 1
  548. let g:J6uil_display_icon = 0
  549. let g:J6uil_display_interval = 0
  550. let g:J6uil_updatetime = 1000
  551. let QFixHowm_Key = 'g'
  552. let howm_dir = '~/howm'
  553. let howm_filename = '%Y/%m/%Y-%m-%d-%H%M%S.txt'
  554. let howm_fileencoding = 'utf-8'
  555. let howm_fileformat = 'unix'
  556. let g:qfixmemo_calendar = 0
  557. let g:calendar_howm_syntax = 0
  558. let mygrepprg = 'grep'
  559. if has('win32unix')
  560. let MyGrep_cygwin17 = 1
  561. endif
  562. let g:calendar_google_calendar = 1
  563. let g:calendar_google_task = 1
  564. let g:marching_clang_command = '/usr/bin/clang'
  565. let g:marching_clang_command_option="-std=c++1y"
  566. let g:marching_enable_neocomplete = 1
  567. let g:marching_include_paths = ['/usr/include/c++/4.8.2/']
  568. let g:snowdrop#libclang_path='/usr/lib'
  569. call unite#filters#matcher_default#use(['matcher_fuzzy'])
  570. let g:unite_enable_start_insert = 1
  571. let g:unite_source_directory_mru_long_limit = 3000
  572. let g:unite_source_file_mru_filename_format = ''
  573. let g:unite_source_file_mru_long_limit = 3000
  574. let g:unite_source_history_yank_enable = 1
  575. let g:unite_split_rule = 'botright'
  576. let g:unite_winheight = 15
  577. call textobj#user#plugin('datetime', {
  578. \ 'date': {
  579. \ 'pattern': '\<\d\d\d\d-\d\d-\d\d\>',
  580. \ 'select': ['ad', 'id'],
  581. \ },
  582. \ 'time': {
  583. \ 'pattern': '\<\d\d:\d\d:\d\d\>',
  584. \ 'select': ['at', 'it'],
  585. \ },
  586. \ })
  587. augroup plugin-lingr-vim
  588. autocmd!
  589. autocmd FileType lingr-messages nmap <silent> <buffer> t <Plug>(lingr-messages-show-say-buffer)
  590. autocmd FileType lingr-say let &syntax='clojure'
  591. augroup END
  592. function! s:SID_PREFIX()
  593. return matchstr(expand('<sfile>'), '<SNR>\d\+_')
  594. endfunction
  595. set titlelen=100
  596. set guioptions-=e
  597. autocmd vimrc BufEnter * let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  598. autocmd vimrc User plugin-lingr-unread let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  599. if !has('gui_running')
  600. set t_Co=256
  601. endif
  602. if exists('$TMUX') || exists('$WINDOW')
  603. set t_ts=k
  604. set t_fs=\
  605. endif
  606. function! s:titlestring()
  607. if &filetype =~ '^lingr'
  608. let &titlestring = 'lingr: ' . lingr#unread_count()
  609. else
  610. let &titlestring = bufname('')
  611. endif
  612. endfunction
  613. " tabline
  614. set showtabline=2 " always show tabline
  615. let g:lightline = {
  616. \ 'colorscheme': 'wombat',
  617. \ 'component': {
  618. \ 'readonly': '%{&readonly?"":""}',
  619. \ },
  620. \ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" },
  621. \ 'subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" }
  622. \ }
  623. let &tabline = '%!' . s:SID_PREFIX() . 'tabline()'
  624. function! s:tabline()
  625. " show each tab
  626. let s = ''
  627. for i in range(1, tabpagenr('$'))
  628. let list = tabpagebuflist(i)
  629. let nr = tabpagewinnr(i)
  630. let current_tabnr = tabpagenr()
  631. "let title = bufname('')
  632. if i == current_tabnr
  633. let title = fnamemodify(getcwd(), ':t') . '/'
  634. "let title = bufname('')
  635. else
  636. let title = fnamemodify(gettabvar(i, 'cwd'), ':t') . '/'
  637. endif
  638. let title = empty(title) ? '[No Name]' : title
  639. let s .= i == current_tabnr ? '%#TabLineSel#' : '%#TabLine#'
  640. let s .= '%' . i . 'T[' . i . '] ' . title
  641. let s .= ' '
  642. endfor
  643. " show lingr unread count
  644. let lingr_unread = ""
  645. if exists('*lingr#unread_count')
  646. let lingr_unread_count = lingr#unread_count()
  647. if lingr_unread_count > 0
  648. let lingr_unread = "%#ErrorMsg#(" . lingr_unread_count . ")"
  649. elseif lingr_unread_count == 0
  650. let lingr_unread = "()"
  651. endif
  652. endif
  653. " build tabline
  654. let s .= '%#TabLineFill#%T%=%<[' . getcwd() . ']' . lingr_unread
  655. return s
  656. endfunction
  657. augroup vimrc-scratch-buffer
  658. autocmd!
  659. " Make a scratch buffer when unnamed buffer.
  660. autocmd BufEnter * call s:scratch_buffer()
  661. autocmd FileType qfreplace autocmd! vimrc-scratch * <buffer>
  662. function! s:scratch_buffer()
  663. if exists('b:scratch_buffer') || bufname('%') !=# '' || &l:buftype !=# ''
  664. return
  665. endif
  666. let b:scratch_buffer = 1
  667. setlocal buftype=nofile nobuflisted noswapfile bufhidden=hide
  668. augroup vimrc-scratch
  669. autocmd! * <buffer>
  670. autocmd BufWriteCmd <buffer> call s:scratch_on_BufWriteCmd()
  671. augroup END
  672. endfunction
  673. function! s:scratch_on_BufWriteCmd()
  674. silent! setl buftype< buflisted< swapfile< bufhidden< nomodified
  675. autocmd! vimrc-scratch * <buffer>
  676. if bufname('%') ==# '' && exists('b:scratch_buffer')
  677. execute 'saveas' . (v:cmdbang ? '!' : '') ' <afile>'
  678. filetype detect
  679. endif
  680. unlet! b:scratch_buffer
  681. endfunction
  682. augroup END
  683. 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
  684. let g:github_user = 'raa0121'
  685. let g:github#user = 'raa0121'