Advertisement
Guest User

Untitled

a guest
Apr 10th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 0.57 KB | None | 0 0
  1. function! MyFunkyNav()
  2.     let search_orig = @/
  3.     let @/ = '^" \*\*\*'
  4.     normal! jmhN
  5.     let chapter_name = getline('.')
  6.     normal! 'hzz
  7.    echom chapter_name[2:]
  8.    let @/=search_orig
  9. endfunction
  10. nnoremap j :call MyFunkyNav()<CR>
  11.  
  12. " *** Chapter 1 ***
  13. " Source the file, put cursor here, press j
  14. " As soon as you reach the center of your screen,
  15. " and the document will start scrolling,
  16. " echoing will stop. Why?
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27. " *** Chapter 2 ****
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42. " *** Chapter 3 ***
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57. " **** Chapter 4 ****
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement