function! List_lines(window) range if a:window != "" let g:screen_windowname = a:window endif let text = "" let i = a:firstline while i <= a:lastline let text = text . getline(i) . "\n" let i = i + 1 endwhile echo text endfunction command! -range -nargs=* ListLines , call List_lines()