fork download
  1. function! CopyFiltered()
  2. let buffer = join(getbufline(bufname("%"), 1, "$"), "\n")
  3. let buffer = substitute(buffer, "foo", "BAR", "g")
  4. call setreg("*", buffer)
  5. endfunction
  6. noremap <leader>Y :call CopyFiltered()<CR>
  7.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty