1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 03:50:04 +08:00
SpaceVim/bundle/unite.vim/plugin/unite/buffer.vim
2020-06-13 14:06:35 +08:00

37 lines
840 B
VimL

"=============================================================================
" FILE: buffer.vim
" AUTHOR: Shougo Matsushita <Shougo.Matsu@gmail.com>
" License: MIT license
"=============================================================================
if exists('g:loaded_unite_source_buffer')
finish
endif
let s:save_cpo = &cpo
set cpo&vim
augroup plugin-unite-source-buffer
autocmd!
autocmd BufEnter,BufWinEnter,BufFilePost *
\ call s:append(expand('<amatch>'))
augroup END
let g:loaded_unite_source_buffer = 1
function! s:append(path) abort "{{{
if bufnr('%') != expand('<abuf>')
return
endif
if !has('vim_starting') || bufname(bufnr('%')) != ''
call unite#sources#buffer#variables#append(bufnr('%'))
endif
endfunction"}}}
let &cpo = s:save_cpo
unlet s:save_cpo
" __END__
" vim: foldmethod=marker