bairui

Vim Movie - Demonstrating the Idea

Oct 12th, 2011
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 0.45 KB | None | 0 0
  1. function! Play()
  2.   let commands = []
  3.   redir => commandstr
  4.   function Do
  5.   redir END
  6.   let commands = split(commandstr, '\n')[1:-2]
  7.   for c in commands
  8.     exe substitute(c, '^\s*\d\+\s*', '', '')
  9.     redraw!
  10.     sleep 1
  11.   endfor
  12. endfunction
  13.  
  14. function! Do()
  15.   normal G
  16.   call setline('.', 'one two three four five')
  17.   call setline('.', split(getline('.'), '\s\+', '\n'))
  18.   exe "normal \<c-v>$G"
  19.   normal y
  20.   normal P
  21. endfunction
  22.  
  23. call Play()
  24.  
  25.  
Add Comment
Please, Sign In to add comment