Email: bknpk@hotmail.com Phone: +972-54-7649119


V

 

Simple VIM function, which writes all files from buffers.

  1. 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.

  2. 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

    1. "Write all files in buffers to current file, starting at the first line
    2. so ~/my_vim/FilesInBuffer.vim
    3. nmap wfb :call BuffersList()<CR>


  ...




Search This Site


Feedback This Site




new pages on this site