- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdiffoff.vim
More file actions
Latest commit
28 lines (21 loc) · 600 Bytes
/
Copy pathdiffoff.vim
File metadata and controls
28 lines (21 loc) · 600 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function!GetBufferList()
returnfilter(range(1,bufnr('$')), 'buflisted(v:val)')
endfunction
function!GetMatchingBuffers(pattern)
returnfilter(GetBufferList(), 'bufname(v:val) =~ a:pattern')
endfunction
function!WipeMatchingBuffers(pattern)
letl:matchList=GetMatchingBuffers(a:pattern)
letl:count=len(l:matchList)
ifl:count < 1
echo'No buffers found matching pattern ' . a:pattern
return
endif
ifl:count==1
letl:suffix=''
else
letl:suffix='s'
endif
exec'bw ' . join(l:matchList, '')
endfunction
command! Goffdiff callWipeMatchingBuffers('fugitive://')