" using internal echo appends spaces to pad lines to size of terminal for X cut buffer... function! Echo(window) range let tmpfile = system("mktemp /tmp/vim.XXXXXX") execute a:firstline . "," . a:lastline . "write! " . tmpfile execute "! /bin/cat " . tmpfile silent execute "! /bin/rm -f " . tmpfile endfunction command! -range -nargs=* Echo , call Echo() nnoremap e }mZ{:.,'ZEcho