Simple VIM function, which
writes all files from buffers.
-
Sometimes it desired to write all files in VIM buffers, into file. This
function will write all files to current opened file, by VIM, starting at
the first line.
-
To install put the function file and source it. Create a short-cut.
.
function BuffersList()
let all = range(0, bufnr('$'))
for b in all
if b > 0
echo bufname(b)
call setline(b, bufname(b))
endif
endfor
endfunction
Add in ~/.gvimrc
- "Write all files in buffers to current file, starting at the first line
- so ~/my_vim/FilesInBuffer.vim
- nmap wfb :call BuffersList()<CR>
|