.vimrc 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657
  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 nrformats+=alpha
  27. colorscheme elflord
  28. syntax on
  29. set enc=utf8
  30. set updatetime=200
  31. " ファイル名に大文字小文字の区別がないシステム用の設定:
  32. " (例: DOS/Windows/MacOS)
  33. "
  34. if filereadable($VIM . '/vimrc') && filereadable($VIM . '/ViMrC')
  35. " tagsファイルの重複防止
  36. set tags=./tags,tags
  37. endif
  38. " コンソールでのカラー表示のための設定(暫定的にUNIX専用)
  39. if has('unix') && !has('gui_running')
  40. let uname = system('uname')
  41. if uname =~? "linux"
  42. set term=builtin_linux
  43. elseif uname =~? "freebsd"
  44. set term=builtin_cons25
  45. elseif uname =~? "Darwin"
  46. set term=beos-ansi
  47. else
  48. set term=builtin_xterm
  49. endif
  50. unlet uname
  51. endif
  52. " コンソール版で環境変数$DISPLAYが設定されていると起動が遅くなる件へ対応
  53. if !has('gui_running') && has('xterm_clipboard')
  54. set clipboard=exclude:cons\\\|linux\\\|cygwin\\\|rxvt\\\|screen
  55. endif
  56. " タブページの切り替えをWindowsのように
  57. " CTRL+Tab SHIFT+Tabで行うように.
  58. if v:version >= 700
  59. nnoremap <C-Tab> gt
  60. nnoremap <C-S-Tab> gT
  61. endif
  62. if has('+regexpengine')
  63. set re=0
  64. endif
  65. filetype off
  66. if has('vim_starting')
  67. set runtimepath+=~/.vim/neobundle.vim.git
  68. endif
  69. call neobundle#rc(expand('~/.bundle'))
  70. let g:neobundle_default_git_protocol='https'
  71. NeoBundleFetch 'Shougo/neobundle.vim'
  72. NeoBundle 'mattn/flappyvird-vim'
  73. NeoBundle 'kamichidu/vim-vdbc', '', 'default'
  74. call neobundle#config('vim-vdbc', {
  75. \ 'depends' : ['Shougo/vimproc'] ,
  76. \ 'build': {
  77. \ 'unix' : 'make -f Makefile',
  78. \ 'windows' : 'make -f Makefile.w64'
  79. \ }
  80. \})
  81. NeoBundle 'tyru/kirikiri.vim'
  82. NeoBundle 'yoppi/fluentd.vim'
  83. NeoBundle 'Shougo/neomru.vim'
  84. NeoBundle 'thinca/vim-threes'
  85. NeoBundle 'jdonaldson/vaxe', '', 'default'
  86. call neobundle#config('vaxe', {
  87. \ 'lazy': 1,
  88. \ 'autoload' : {'filetypes': 'haxe'}
  89. \})
  90. NeoBundle 'vim-jp/vimdoc-ja'
  91. NeoBundle 'itchyny/calendar.vim'
  92. NeoBundle 'fuenor/qfixhowm', '', 'default'
  93. call neobundle#config('qfixhowm', {
  94. \ 'rev': '5bad8770a6d2ffd2e93182d937710ad6e3fe769f'
  95. \ })
  96. NeoBundle 'osyo-manga/unite-qfixhowm'
  97. call neobundle#config('unite-qfixhowm', {
  98. \ 'lazy' : 1,
  99. \ 'autoload' : { 'unite_sources' : ['qfixhowm', 'qfixhowm/new']},
  100. \ 'depends' : ['Shougo/unite.vim', 'fuenor/qfixhowm']
  101. \ })
  102. NeoBundle 'thinca/vim-prettyprint'
  103. call neobundle#config('vim-prettyprint', {
  104. \ 'lazy' : 1,
  105. \ 'autoload' : { 'commands' : ['PP', 'PrettyPrint']}
  106. \ })
  107. NeoBundle 'jnwhiteh/vim-golang'
  108. call neobundle#config('vim-golang', {
  109. \ 'lazy' : 1,
  110. \ 'autoload' : { 'filetypes' : 'go'}
  111. \ })
  112. NeoBundle 'osyo-manga/vim-snowdrop'
  113. call neobundle#config('vim-snowdrop', {
  114. \ 'lazy' : 1,
  115. \ 'autoload' : { 'filetypes' : 'cpp' }
  116. \ })
  117. NeoBundle 'osyo-manga/vim-reunions'
  118. NeoBundle 'osyo-manga/vim-marching'
  119. call neobundle#config('vim-marching', {
  120. \ 'depends' : ['Shougo/vimproc', 'osyo-manga/vim-reunions']
  121. \ })
  122. NeoBundle 'Shougo/echodoc', '', 'default'
  123. call neobundle#config('echodoc', {
  124. \ 'lazy' : 1,
  125. \ 'autoload' : {
  126. \ 'insert' : 1,
  127. \ }})
  128. if has('lua')
  129. NeoBundle 'Shougo/neocomplete.vim', '', 'default'
  130. else
  131. NeoBundle 'Shougo/neocomplcache', '', 'default'
  132. endif
  133. "NeoBundle 'Shougo/neocomplcache-rsense', '', 'default'
  134. "call neobundle#config('neocomplcache-rsense', {
  135. " \ 'lazy' : 1,
  136. " \ 'depends' : 'Shougo/neocomplcache',
  137. " \ 'autoload' : { 'filetypes' : 'ruby' }
  138. " \ })
  139. NeoBundle 'Shougo/unite.vim', '', 'default'
  140. call neobundle#config('unite.vim',{
  141. \ 'lazy' : 1,
  142. \ 'autoload' : {
  143. \ 'commands' : [{ 'name' : 'Unite',
  144. \ 'complete' : 'customlist,unite#complete_source'},
  145. \ 'UniteWithCursorWord', 'UniteWithInput']
  146. \ }})
  147. NeoBundle 'Shougo/vimfiler', '', 'default'
  148. call neobundle#config('vimfiler', {
  149. \ 'lazy' : 1,
  150. \ 'depends' : 'Shougo/unite.vim',
  151. \ 'autoload' : {
  152. \ 'commands' : [
  153. \ { 'name' : 'VimFiler',
  154. \ 'complete' : 'customlist,vimfiler#complete' },
  155. \ { 'name' : 'VimFilerExplorer',
  156. \ 'complete' : 'customlist,vimfiler#complete' },
  157. \ { 'name' : 'Edit',
  158. \ 'complete' : 'customlist,vimfiler#complete' },
  159. \ { 'name' : 'Write',
  160. \ 'complete' : 'customlist,vimfiler#complete' },
  161. \ 'Read', 'Source'],
  162. \ 'mappings' : ['<Plug>(vimfiler_switch)'],
  163. \ 'explorer' : 1,
  164. \ }
  165. \ })
  166. NeoBundle 'Shougo/vimshell', '', 'default'
  167. call neobundle#config('vimshell', {
  168. \ 'lazy' : 1,
  169. \ 'autoload' : {
  170. \ 'commands' : [{ 'name' : 'VimShell',
  171. \ 'complete' : 'customlist,vimshell#complete'},
  172. \ 'VimShellExecute', 'VimShellInteractive',
  173. \ 'VimShellTerminal', 'VimShellPop'],
  174. \ 'mappings' : ['<Plug>(vimshell_switch)']
  175. \ }})
  176. if has('win32')
  177. NeoBundleLocal 'C:\vim\plugin'
  178. else
  179. NeoBundle 'Shougo/vimproc', '', 'default'
  180. call neobundle#config('vimproc', {
  181. \ 'build' : {
  182. \ 'windows' : 'make -f make_mingw32.mak',
  183. \ 'cygwin' : 'make -f make_cygwin.mak',
  184. \ 'mac' : 'make -f make_mac.mak',
  185. \ 'unix' : 'make -f make_unix.mak',
  186. \ },
  187. \ })
  188. endif
  189. NeoBundle 'thinca/vim-quickrun'
  190. call neobundle#config('vim-quickrun', {
  191. \ 'lazy' : 1,
  192. \ 'autoload' : {
  193. \ 'mappings' : [
  194. \ ['nxo', '<Plug>(quickrun)']],
  195. \ 'commands' : 'QuickRun',
  196. \ },
  197. \ })
  198. NeoBundle 'tsukkee/lingr-vim'
  199. call neobundle#config('lingr-vim', {
  200. \ 'lazy' : 1,
  201. \ 'autoload' : {
  202. \ 'commands' : 'LingrLaunch',
  203. \ },
  204. \ })
  205. NeoBundle 'Shougo/neosnippet', '', 'default'
  206. call neobundle#config('neosnippet', {
  207. \ 'lazy' : 1,
  208. \ 'autoload' : {
  209. \ 'insert' : 1,
  210. \ 'filetypes' : 'snippet',
  211. \ 'unite_sources' : ['snippet', 'neosnippet/user', 'neosnippet/runtime'],
  212. \ }})
  213. NeoBundle 'Shougo/neosnippet-snippets', '', 'default'
  214. call neobundle#config('neosnippet-snippets', {
  215. \ 'depends' : 'Shougo/neosnippet'
  216. \ })
  217. NeoBundle 'tyru/open-browser.vim'
  218. call neobundle#config('open-browser.vim',{
  219. \ 'lazy' : 1,
  220. \ 'autoload' : {
  221. \ 'mappings' : '<Plug>(open-browser-wwwsearch)',
  222. \ }})
  223. NeoBundle 'mattn/gist-vim'
  224. call neobundle#config('gist-vim', {
  225. \ 'lazy' : 1,
  226. \ 'autoload' : { 'commands' : 'Gist' }
  227. \ })
  228. NeoBundle 'mattn/webapi-vim'
  229. NeoBundle 'thinca/vim-ft-clojure'
  230. call neobundle#config('vim-ft-clojure', {
  231. \ 'lazy' : 1,
  232. \ 'autoload' : { 'filetypes' : 'clojure' }
  233. \ })
  234. NeoBundle 'ujihisa/neco-ghc'
  235. call neobundle#config('neco-ghc', {
  236. \ 'lazy' : 1,
  237. \ 'autoload' : { 'filetypes' : 'haskell' }
  238. \ })
  239. NeoBundle 'sudo.vim'
  240. NeoBundle 'ujihisa/vimshell-ssh'
  241. call neobundle#config('vimshell-ssh',{
  242. \ 'lazy' : 1,
  243. \ 'autoload' : { 'filetypes' : 'vimshell'}
  244. \ })
  245. NeoBundle 'Shougo/unite-ssh'
  246. call neobundle#config('unite-ssh', {
  247. \ 'lazy' : 1,
  248. \ 'autoload' : { 'unite_sources' : 'ssh' }
  249. \ })
  250. NeoBundle 'ujihisa/neco-look'
  251. NeoBundle 'vim-jp/vital.vim', '', 'default'
  252. call neobundle#config('vital.vim', {
  253. \ 'lazy' : 1,
  254. \ 'autoload' : {
  255. \ 'commands' : ['Vitalize'],
  256. \ 'functions' : ['vital#of', 'vital']
  257. \ }})
  258. NeoBundle 'dag/vim2hs'
  259. call neobundle#config ('vim2hs', {
  260. \ 'lazy' : 1,
  261. \ 'autoload' : { 'filetypes' : 'haskell' }
  262. \})
  263. NeoBundle 'eagletmt/ghcmod-vim'
  264. call neobundle#config('ghcmod-vim', {
  265. \ 'lazy' : 1,
  266. \ 'autoload' : { 'filetypes' : 'haskell' }
  267. \ })
  268. NeoBundle 'thinca/vim-ref'
  269. NeoBundle 'thinca/vim-singleton'
  270. NeoBundle 'mattn/benchvimrc-vim'
  271. call neobundle#config('benchvimrc-vim', {
  272. \ 'lazy' : 1,
  273. \ 'autoload' : { 'commands' : 'BenchVimrc' }
  274. \ })
  275. NeoBundle 'ryutorion/vim-itunes'
  276. NeoBundle 'raa0121/vim-ulilith'
  277. NeoBundle 'mattn/libcallex-vim'
  278. NeoBundle 'thinca/vim-splash'
  279. NeoBundle 'mattn/sonictemplate-vim'
  280. call neobundle#config('sonictemplate-vim', {
  281. \ 'lazy' : 1,
  282. \ 'autoload' : { 'commands' : 'Template' }
  283. \ })
  284. NeoBundle 'thinca/vim-github'
  285. call neobundle#config('vim-github', {
  286. \ 'lazy' : 1,
  287. \ 'autoload' : { 'commands' : 'Github' }
  288. \ })
  289. NeoBundle 'jceb/vim-orgmode'
  290. call neobundle#config('vim-orgmode', {
  291. \ 'lazy' : 1,
  292. \ 'autoload' : { 'filetypes' : 'org' }
  293. \ })
  294. NeoBundle 'itchyny/lightline.vim'
  295. NeoBundle 'osyo-manga/quickrun-hook-u-nya-'
  296. " call neobundle#config('quickrun-hook-u-nya-', {
  297. " \ 'lazy' : 1,
  298. " \ 'depends' : 'thinca/quickrun'
  299. " \ })
  300. NeoBundle 'osyo-manga/unite-quickfix'
  301. call neobundle#config('unite-quickfix', {
  302. \ 'lazy' : 1,
  303. \ 'autoload' : { 'unite_sources' : ['quickfix', 'location_list']},
  304. \ 'depends' : 'Shougo/unite.vim'
  305. \ })
  306. NeoBundle 'basyura/J6uil.vim', '', 'default'
  307. call neobundle#config('J6uil.vim', {
  308. \ 'lazy' : 1,
  309. \ 'autoload' : { 'commands' : 'J6uil' },
  310. \ 'depends' : 'mattn/webapi-vim',
  311. \ })
  312. NeoBundle 'mattn/unite-rhythmbox'
  313. call neobundle#config('unite-rhythmbox', {
  314. \ 'lazy' : 1,
  315. \ 'autoload' : { 'unite_sources' : 'rhythmbox' },
  316. \ 'depends' : 'Shougo/unite.vim'
  317. \ })
  318. NeoBundle 'rbtnn/vimconsole.vim'
  319. call neobundle#config('vimconsole.vim', {
  320. \ 'depends' : 'thinca/vim-prettyprint',
  321. \ 'autoload' : { 'commands' : 'VimConsoleOpen' }
  322. \ })
  323. filetype plugin indent on
  324. if has('clientserver')
  325. call singleton#enable()
  326. end
  327. set ww+=h,l,>,<,[,]
  328. set mouse=a
  329. set ttymouse=xterm2
  330. set clipboard=unnamedplus
  331. " ,is: シェルを起動
  332. nnoremap <silent> ,is :VimShell<CR>
  333. " ,ipy: pythonを非同期で起動
  334. nnoremap <silent> ,ipy :VimShellInteractive python<CR>
  335. " ,irb: irbを非同期で起動
  336. nnoremap <silent> ,irb :VimShellInteractive irb<CR>
  337. " ,ss: 非同期で開いたインタプリタに現在の行を評価させる
  338. vmap <silent> ,ss :VimShellSendString<CR>
  339. " 選択中に,ss: 非同期で開いたインタプリタに選択行を評価させる
  340. nnoremap <silent> ,ss <S-v>:VimShellSendString<CR>
  341. " ,vs: vimshell
  342. nnoremap <silent> ,vs :tabnew +VimShell<CR>
  343. " ,vr: .vimrc
  344. nnoremap <silent> ,vr :tabnew ~/.vimrc<CR>:lcd<CR>
  345. nnoremap <silent> ,so :so ~/.vimrc<CR>
  346. nnoremap <silent> ,nu :tabnew +Unite\ neobundle/update<CR>
  347. nnoremap <silent> ,ll :tabnew +LingrLaunch<CR>
  348. nnoremap <Esc><Esc> :nohlsearch<CR><ESC>
  349. if neobundle#is_installed('neocomplcache')
  350. let g:neocomplcache_enable_at_startup = 1
  351. let g:neocomplcache_enable_smart_case = 1
  352. let g:neocomplcache_enable_camel_case_completion = 1
  353. let g:neocomplcache_enable_underbar_completion = 1
  354. let g:neocomplcache_min_syntax_length = 3
  355. let g:neocomplcache_lock_buffer_name_pattern = '\*ku\*'
  356. if !exists('g:neocomplcache_keyword_patterns')
  357. let g:neocomplcache_keyword_patterns = {}
  358. endif
  359. let g:neocomplcache_keyword_patterns['default'] = '\h\w*'
  360. endif
  361. if neobundle#is_installed('neocomplete.vim')
  362. let g:neocomplete#enable_at_startup = 1
  363. let g:neocomplete#enable_smart_case = 1
  364. let g:neocomplete#enable_camel_case_completion = 1
  365. let g:neocomplete#enable_underbar_completion = 1
  366. let g:neocomplete#min_syntax_length = 3
  367. let g:neocomplete#lock_buffer_name_pattern = '\*ku\*'
  368. if !exists('g:neocomplete#keyword_patterns')
  369. let g:neocomplete#keyword_patterns = {}
  370. endif
  371. let g:neocomplete#keyword_patterns['default'] = '\h\w*'
  372. if !exists('g:neocomplete#force_omni_input_patterns')
  373. let g:neocomplete#force_omni_input_patterns = {}
  374. endif
  375. if !exists('g:neocomplete#sources#omni#input_patterns')
  376. let g:neocomplete#sources#omni#input_patterns = {}
  377. endif
  378. endif
  379. let g:vimfiler_as_default_explorer = 1
  380. "let g:neocomplcache#sources#rsense#home_directory = '/opt/rsense-0.3/'
  381. let g:neocomplcache_text_mode_filetypes = {
  382. \ 'tex': 1,
  383. \ 'plaintex': 1,
  384. \}
  385. let g:neocomplete#text_mode_filetypes = {
  386. \ 'tex': 1,
  387. \ 'plaintex': 1,
  388. \}
  389. let g:neocomplete#force_omni_input_patterns.cpp =
  390. \ '[^.[:digit:] *\t]\%(\.\|->\)\w*\|\h\w*::\w*'
  391. let g:neocomplete#sources#omni#input_patterns.haxe =
  392. \ '\v([\]''"\)]|\w|(^\s*))(\.|\()'
  393. let g:neosnippet#snippets_directory = '~/.vim/snippet'
  394. "tabで補完候補の選択を行う
  395. imap <expr><TAB> neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : pumvisible() ? "\<C-n>" : "\<TAB>"
  396. imap <expr><S-TAB> neosnippet#expandable_or_jumpable() ? "\<Plug>(neosnippet_expand_or_jump)" : pumvisible() ? "\<C-u>" : "\<S-TAB>"
  397. smap <expr><TAB> neosnippet#expandable_or_jumpable() ?
  398. \ "\<Plug>(neosnippet_expand_or_jump)"
  399. \: "\<TAB>"
  400. augroup vimrc
  401. autocmd!
  402. augroup END
  403. autocmd vimrc FileType css setlocal omnifunc=csscomplete#CompleteCSS
  404. autocmd vimrc FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
  405. autocmd vimrc FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
  406. autocmd vimrc FileType python setlocal omnifunc=pythoncomplete#Complete
  407. autocmd vimrc FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
  408. autocmd vimrc BufNewFile,BufRead *.{md,mdwn,mkd,mkdn,mark*} setlocal filetype=markdown
  409. autocmd vimrc FileType haxe setl autowrite
  410. autocmd vimrc FileType hxml setl autowrite
  411. autocmd vimrc FileType nmml.xml setl autowrite
  412. autocmd vimrc BufNewFile,BufRead *.rb set tags+=$HOME/ctags/ruby.tags
  413. let g:vaxe_haxe_version = 3
  414. function! s:init_vaxe_keymap()
  415. " .hxmlファイルを開いてくれるやつ
  416. nnoremap <buffer> ,vo :<C-u>call vaxe#OpenHxml()<CR>
  417. " タグファイル作ってくれるやつ(別途、.ctagsの定義をしませう)
  418. nnoremap <buffer> ,vc :<C-u>call vaxe#Ctags()<CR>
  419. " 自動インポートな
  420. nnoremap <buffer> ,vi :<C-u>call vaxe#ImportClass()<CR>
  421. endfunction
  422. autocmd vimrc FileType haxe call s:init_vaxe_keymap()
  423. autocmd vimrc FileType hxml call s:init_vaxe_keymap()
  424. autocmd vimrc FileType nmml.xml call s:init_vaxe_keymap()
  425. let g:netrw_nogx = 1
  426. nmap gx <Plug>(openbrowser-smart-search)
  427. vmap gx <Plug>(openbrowser-smart-search)
  428. let g:quickrun_config = {}
  429. let g:quickrun_config['markdown'] = {
  430. \ 'outputter': 'browser'
  431. \ }
  432. let g:quickrun_config.ruby = {
  433. \ 'command': 'ruby',
  434. \ 'exec': '/usr/bin/env ruby %s',
  435. \ 'tempfile': '{tempname()}.rb'
  436. \ }
  437. let g:quickrun_config = {
  438. \ 'cpp': {
  439. \ 'cmdopt': '-std=c++11 -Wall'
  440. \ }
  441. \ }
  442. let g:quickrun_config = {
  443. \ '_' : {
  444. \ 'hook/close_unite_quickfix/enable_hook_loaded' : 1,
  445. \ 'hook/unite_quickfix/enable_failure' : 1,
  446. \ 'hook/close_quickfix/enable_exit' : 1,
  447. \ 'hook/close_buffer/enable_failure' : 1,
  448. \ 'hook/close_buffer/enable_empty_data' : 1,
  449. \ 'outputter' : 'multi:buffer:quickfix',
  450. \ 'hook/u_nya_/enable' : 1,
  451. \ 'hook/sweep/enable' : 0,
  452. \ 'outputter/buffer/split' : ':botright 15sp',
  453. \ 'outputter/buffer/running_mark' : 'バン(∩`・ω・)バンバンバンバン゙ン',
  454. \ 'runner' : 'vimproc',
  455. \ 'runner/vimproc/updatetime' : 40,
  456. \ 'runner/vimproc/sleep' : 0,
  457. \ }
  458. \ }
  459. let g:lingr_vim_user = 'raa0121'
  460. let g:J6uil_display_offline = 0
  461. let g:J6uil_display_online = 0
  462. let g:J6uil_echo_presence = 1
  463. let g:J6uil_display_icon = 0
  464. let g:J6uil_display_interval = 0
  465. let g:J6uil_updatetime = 1000
  466. let QFixHowm_Key = 'g'
  467. let howm_dir = '~/howm'
  468. let howm_filename = '%Y/%m/%Y-%m-%d-%H%M%S.txt'
  469. let howm_fileencoding = 'utf-8'
  470. let howm_fileformat = 'unix'
  471. let g:qfixmemo_calendar = 0
  472. let g:calendar_howm_syntax = 0
  473. let mygrepprg = 'grep'
  474. if has('win32unix')
  475. let MyGrep_cygwin17 = 1
  476. endif
  477. let g:calendar_google_calendar = 1
  478. let g:calendar_google_task = 1
  479. let g:marching_clang_command = '/usr/bin/clang'
  480. let g:marching_clang_command_option="-std=c++1y"
  481. let g:marching_enable_neocomplete = 1
  482. let g:marching_include_paths = ['/usr/include/c++/4.8.2/']
  483. let g:snowdrop#libclang_path='/usr/lib'
  484. call unite#filters#matcher_default#use(['matcher_fuzzy'])
  485. let g:unite_enable_start_insert = 1
  486. let g:unite_source_directory_mru_long_limit = 3000
  487. let g:unite_source_file_mru_filename_format = ''
  488. let g:unite_source_file_mru_long_limit = 3000
  489. let g:unite_source_history_yank_enable = 1
  490. let g:unite_split_rule = 'botright'
  491. let g:unite_winheight = 15
  492. augroup plugin-lingr-vim
  493. autocmd!
  494. autocmd FileType lingr-messages nmap <silent> <buffer> t <Plug>(lingr-messages-show-say-buffer)
  495. autocmd FileType lingr-say let &syntax='clojure'
  496. augroup END
  497. function! s:SID_PREFIX()
  498. return matchstr(expand('<sfile>'), '<SNR>\d\+_')
  499. endfunction
  500. set titlelen=100
  501. set guioptions-=e
  502. autocmd vimrc BufEnter * let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  503. autocmd vimrc User plugin-lingr-unread let &titlestring = '%{' . s:SID_PREFIX() . 'titlestring()}'
  504. if !has('gui_running')
  505. set t_Co=256
  506. endif
  507. if exists('$TMUX') || exists('$WINDOW')
  508. set t_ts=k
  509. set t_fs=\
  510. endif
  511. function! s:titlestring()
  512. if &filetype =~ '^lingr'
  513. let &titlestring = 'lingr: ' . lingr#unread_count()
  514. else
  515. let &titlestring = bufname('')
  516. endif
  517. endfunction
  518. " tabline
  519. set showtabline=2 " always show tabline
  520. let g:lightline = {
  521. \ 'colorscheme': 'wombat',
  522. \ 'component': {
  523. \ 'readonly': '%{&readonly?"":""}',
  524. \ },
  525. \ 'separator': { 'left': "\ue0b0", 'right': "\ue0b2" },
  526. \ 'subseparator': { 'left': "\ue0b1", 'right': "\ue0b3" }
  527. \ }
  528. let &tabline = '%!' . s:SID_PREFIX() . 'tabline()'
  529. function! s:tabline()
  530. " show each tab
  531. let s = ''
  532. for i in range(1, tabpagenr('$'))
  533. let list = tabpagebuflist(i)
  534. let nr = tabpagewinnr(i)
  535. let current_tabnr = tabpagenr()
  536. "let title = bufname('')
  537. if i == current_tabnr
  538. let title = fnamemodify(getcwd(), ':t') . '/'
  539. "let title = bufname('')
  540. else
  541. let title = fnamemodify(gettabvar(i, 'cwd'), ':t') . '/'
  542. endif
  543. let title = empty(title) ? '[No Name]' : title
  544. let s .= i == current_tabnr ? '%#TabLineSel#' : '%#TabLine#'
  545. let s .= '%' . i . 'T[' . i . '] ' . title
  546. let s .= ' '
  547. endfor
  548. " show lingr unread count
  549. let lingr_unread = ""
  550. if exists('*lingr#unread_count')
  551. let lingr_unread_count = lingr#unread_count()
  552. if lingr_unread_count > 0
  553. let lingr_unread = "%#ErrorMsg#(" . lingr_unread_count . ")"
  554. elseif lingr_unread_count == 0
  555. let lingr_unread = "()"
  556. endif
  557. endif
  558. " build tabline
  559. let s .= '%#TabLineFill#%T%=%<[' . getcwd() . ']' . lingr_unread
  560. return s
  561. endfunction
  562. augroup vimrc-scratch-buffer
  563. autocmd!
  564. " Make a scratch buffer when unnamed buffer.
  565. autocmd BufEnter * call s:scratch_buffer()
  566. autocmd FileType qfreplace autocmd! vimrc-scratch * <buffer>
  567. function! s:scratch_buffer()
  568. if exists('b:scratch_buffer') || bufname('%') !=# '' || &l:buftype !=# ''
  569. return
  570. endif
  571. let b:scratch_buffer = 1
  572. setlocal buftype=nofile nobuflisted noswapfile bufhidden=hide
  573. augroup vimrc-scratch
  574. autocmd! * <buffer>
  575. autocmd BufWriteCmd <buffer> call s:scratch_on_BufWriteCmd()
  576. augroup END
  577. endfunction
  578. function! s:scratch_on_BufWriteCmd()
  579. silent! setl buftype< buflisted< swapfile< bufhidden< nomodified
  580. autocmd! vimrc-scratch * <buffer>
  581. if bufname('%') ==# '' && exists('b:scratch_buffer')
  582. execute 'saveas' . (v:cmdbang ? '!' : '') ' <afile>'
  583. filetype detect
  584. endif
  585. unlet! b:scratch_buffer
  586. endfunction
  587. augroup END
  588. 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
  589. let g:github_user = 'raa0121'
  590. let g:github#user = 'raa0121'