=== modified file 'autoload/info.vim' --- autoload/info.vim 2013-11-15 11:52:48 +0000 +++ autoload/info.vim 2013-11-15 10:59:28 +0000 @@ -5,12 +5,6 @@ let s:line_ref_regex = '^\* .*::' " let s:inline_ref_regex = '\*note\( \|\n\)\(.\+\n\)*.*::' -function! s:dbg(msg) - if(exists('g:info_debug')) - echom a:msg - endif -endfunction - function! info#HeadingNext() if(search(s:heading_regex)) norm! zt @@ -25,7 +19,7 @@ function! info#GoToRef(name) let l:name = escape(a:name, '$.*') - call s:dbg("'".l:name."'") + " echom "'".l:name."'" let l:pat = s:navigation_regex . l:name . ', ' let l:line = search(l:pat, 'w') if(l:line) @@ -42,18 +36,6 @@ endif endfunction -function! info#GoRelative(type) - let l:line = search(s:navigation_regex, 'cnb') - if(l:line == 0) | return | endif - let l:navi = getline(l:line) - call s:dbg('navigation|'.l:navi) - let l:type = escape(a:type, '$.*') - let l:match = matchlist(l:navi, ', '.l:type.': \([^,]\+\)') - call s:dbg('match '.string(l:match)) - if(empty(l:match)) | return | endif - call info#GoToRef(l:match[1]) -endfunction - function! info#FollowRef() if(search(s:line_ref_regex, 'cnb', line('.'))) let l:line = getline('.') @@ -61,7 +43,7 @@ else let l:endpos = searchpos('::', 'cn', line('.')+1) let l:startpos = searchpos('\*note', 'cnb', line('.')-1) - call s:dbg('*note '.string([l:startpos, l:endpos])) + " echom '*note '.string([l:startpos, l:endpos]) if(l:endpos == [0, 0] || l:startpos == [0, 0]) return endif @@ -77,16 +59,3 @@ call info#GoToRef(l:line) endif endfunction - -function! info#Open(name) - if(&filetype != 'info' || &modified) - new - else - set modifiable - 0,$d - endif - execute '0r! info --subnodes '.shellescape(a:name) - .,$d - set nomodified nomodifiable filetype=info - 1 -endfunction === modified file 'ftplugin/info.vim' --- ftplugin/info.vim 2013-11-15 11:52:48 +0000 +++ ftplugin/info.vim 2013-11-15 10:11:00 +0000 @@ -1,36 +1,9 @@ if &filetype == 'info' - nnoremap InfoHeadingNext :call info#HeadingNext() - nnoremap InfoHeadingPrev :call info#HeadingPrev() - nnoremap InfoNext :call info#GoRelative('Next') - nnoremap InfoPrev :call info#GoRelative('Prev') - nnoremap InfoUp :call info#GoRelative('Up') - nnoremap InfoFollow :call info#FollowRef() - nnoremap InfoLinkNext :call search('\(^\* .*::\\|\*note\( \\|\n\)\)') - nnoremap InfoLinkPrev :call search('\(^\* .*::\\|\*note\( \\|\n\)\)', 'b') if !exists("g:no_plugin_maps") && !exists("g:no_info_maps") - if !hasmapto('InfoHeadingNext') - nmap ]] InfoHeadingNext - endif - if !hasmapto('InfoHeadingPrev') - nmap [[ InfoHeadingPrev - endif - if !hasmapto('InfoFollow') - nmap InfoFollow - endif - if !hasmapto('InfoLinkNext') - nmap InfoLinkNext - endif - if !hasmapto('InfoLinkPrev') - nmap [Z InfoLinkPrev - endif - if !hasmapto('InfoNext') - nmap n InfoNext - endif - if !hasmapto('InfoPrev') - nmap p InfoPrev - endif - if !hasmapto('InfoUp') - nmap u InfoUp - endif + nnoremap ]] :call info#HeadingNext() + nnoremap [[ :call info#HeadingPrev() + nnoremap :call info#FollowRef() + nnoremap :call search('\(^\* .*::\\|\*note\( \\|\n\)\)') + nnoremap [Z :call search('\(^\* .*::\\|\*note\( \\|\n\)\)', 'b') endif endif === removed directory 'plugin' === removed file 'plugin/info.vim' --- plugin/info.vim 2013-11-15 11:52:48 +0000 +++ plugin/info.vim 1970-01-01 00:00:00 +0000 @@ -1,1 +0,0 @@ -command! -bar -nargs=1 Info call info#Open()