Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function! MyFunkyNav()
- let search_orig = @/
- let @/ = '^" \*\*\*'
- normal! jmhN
- let chapter_name = getline('.')
- normal! 'hzz
- echom chapter_name[2:]
- let @/=search_orig
- endfunction
- nnoremap j :call MyFunkyNav()<CR>
- " *** Chapter 1 ***
- " Source the file, put cursor here, press j
- " As soon as you reach the center of your screen,
- " and the document will start scrolling,
- " echoing will stop. Why?
- " *** Chapter 2 ****
- " *** Chapter 3 ***
- " **** Chapter 4 ****
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement