.vimrc 22 KB

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