]> Sergey Matveev's repositories - dotfiles.git/blob - vim/.vim/ftplugin/go/motion.vim
Initial
[dotfiles.git] / vim / .vim / ftplugin / go / motion.vim
1 nnoremap <silent> <buffer> ]] :call <SID>Go_jump('/^\(func\\|type\)')<cr>
2 nnoremap <silent> <buffer> [[ :call <SID>Go_jump('?^\(func\\|type\)')<cr>
3 nnoremap <silent> <buffer> ]m :call <SID>Go_jump('/^\s*\(func\\|type\)')<cr>
4 nnoremap <silent> <buffer> [m :call <SID>Go_jump('?^\s*\(func\\|type\)')<cr>
5
6 if exists('*<SID>Go_jump') | finish | endif
7
8 fun! <SID>Go_jump(motion) range
9     let cnt = v:count1
10     let save = @/    " save last search pattern
11     mark '
12     while cnt > 0
13         silent! exe a:motion
14         let cnt = cnt - 1
15     endwhile
16     call histdel('/', -1)
17     let @/ = save    " restore last search pattern
18 endfun