bairui

Lisp Navigation

Jan 8th, 2012
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. " Lisp Navigation
  2.  
  3. let b:search = ''
  4.  
  5. function! SaveSearch()
  6.   let b:search = @/
  7. endfunction
  8.  
  9. function! RestoreSearch()
  10.   let @/ = b:search
  11. endfunction
  12.  
  13. nnoremap <up>  :call SaveSearch()<cr>?^\s*(\s*\S?e<cr>:call RestoreSearch()<cr>
  14. nnoremap <down>  :call SaveSearch()<cr>/^\s*(\s*\S/e<cr>:call RestoreSearch()<cr>
  15. nnoremap <right> :call SaveSearch()<cr>/(\s*\S/e<cr>:call RestoreSearch()<cr>
  16. nnoremap <left>  :call SaveSearch()<cr>?(\s*\S?e<cr>:call RestoreSearch()<cr>
Advertisement
Add Comment
Please, Sign In to add comment