Advertisement
Guest User

Untitled

a guest
Jun 25th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 0.34 KB | None | 0 0
  1. source ~/.vimrc
  2.  
  3. autocmd FocusGained *.md call FocusGained()
  4. autocmd FocusLost *.md call FocusLost()
  5.  
  6. function! FocusGained()
  7.   normal ggVG"+P
  8.  
  9.   if exists('s:cursor_pos')
  10.     call cursor(s:cursor_pos[1], s:cursor_pos[2])
  11.   endif
  12. endfunction
  13.  
  14. function! FocusLost()
  15.   let s:cursor_pos = getpos(".")
  16.   normal ggvGg_"+y
  17. endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement