Permalink
Browse files

manpageview 更新

  • Loading branch information...
1 parent d04dfcc commit 9c413d85145dbd813d87a668b55201947a602945 @lilydjwg committed Feb 28, 2012
Showing with 93 additions and 26 deletions.
  1. +1 −1 .VimballRecord
  2. +39 −17 autoload/manpageview.vim
  3. +14 −3 doc/manpageview.txt
  4. +3 −2 doc/tags
  5. +2 −2 plugin/manpageviewPlugin.vim
  6. +34 −0 syntax/mangl.vim
  7. +0 −1 syntax/manphp.vim
View
@@ -5,11 +5,11 @@ vimwiki-1-1-1.vba: call delete('/home/lilydjwg/.vim/autoload/vimwiki.vim')|call
AnsiEsc.vba: call delete('/home/lilydjwg/.vim/plugin/AnsiEscPlugin.vim')|call delete('/home/lilydjwg/.vim/autoload/AnsiEsc.vim')|call delete('/home/lilydjwg/.vim/plugin/cecutil.vim')|call delete('/home/lilydjwg/.vim/doc/AnsiEsc.txt')
CheckAttach-0.9.vba: call delete('/home/lilydjwg/.vim/ftplugin/mail_CheckAttach.vim')|call delete('/home/lilydjwg/.vim/doc/CheckAttach.txt')
math.vba: call delete('/home/lilydjwg/.vim/keymap/math.vim')|call delete('/home/lilydjwg/.vim/plugin/mathmenuPlugin.vim')|call delete('/home/lilydjwg/.vim/autoload/mathmenu.vim')|call delete('/home/lilydjwg/.vim/doc/mathmenu.txt')
-manpageview.vba: call delete('/home/lilydjwg/.vim/plugin/manpageviewPlugin.vim')|call delete('/home/lilydjwg/.vim/autoload/manpageview.vim')|call delete('/home/lilydjwg/.vim/syntax/man.vim')|call delete('/home/lilydjwg/.vim/syntax/mankey.vim')|call delete('/home/lilydjwg/.vim/syntax/info.vim')|call delete('/home/lilydjwg/.vim/syntax/manphp.vim')|call delete('/home/lilydjwg/.vim/doc/manpageview.txt')
visincr.vba: call delete('/home/lilydjwg/.vim/plugin/visincrPlugin.vim')|call delete('/home/lilydjwg/.vim/autoload/visincr.vim')|call delete('/home/lilydjwg/.vim/doc/visincr.txt')|call delete('/home/lilydjwg/.vim/autoload/calutil.vim')
diff_movement.vba: call delete('/home/lilydjwg/.vim/ftplugin/diff_movement.vim')
mail_movement.vba: call delete('/home/lilydjwg/.vim/ftplugin/mail_movement.vim')
CountJump.vba: call delete('/home/lilydjwg/.vim/autoload/CountJump.vim')|call delete('/home/lilydjwg/.vim/autoload/CountJump/Motion.vim')|call delete('/home/lilydjwg/.vim/autoload/CountJump/Region.vim')|call delete('/home/lilydjwg/.vim/autoload/CountJump/Region/Motion.vim')|call delete('/home/lilydjwg/.vim/autoload/CountJump/Region/TextObject.vim')|call delete('/home/lilydjwg/.vim/autoload/CountJump/TextObject.vim')|call delete('/home/lilydjwg/.vim/doc/CountJump.txt')
autofmt.vmb: call delete('/home/lilydjwg/.vim/doc/autofmt.txt')|call delete('/home/lilydjwg/.vim/autoload/autofmt/japanese.vim')|call delete('/home/lilydjwg/.vim/autoload/autofmt/compat.vim')|call delete('/home/lilydjwg/.vim/autoload/autofmt/uax14.vim')|call delete('/home/lilydjwg/.vim/autoload/unicode.vim')|call delete('/home/lilydjwg/.vim/tools/unicode.vim')
mark.vba: call delete('/home/lilydjwg/.vim/autoload/mark.vim')|call delete('/home/lilydjwg/.vim/plugin/mark.vim')|call delete('/home/lilydjwg/.vim/doc/mark.txt')
tagbar.vmb: call delete('/home/lilydjwg/.vim/autoload/tagbar.vim')|call delete('/home/lilydjwg/.vim/doc/tagbar.txt')|call delete('/home/lilydjwg/.vim/plugin/tagbar.vim')|call delete('/home/lilydjwg/.vim/syntax/tagbar.vim')
+manpageview.vba: call delete('/home/lilydjwg/.vim/plugin/manpageviewPlugin.vim')|call delete('/home/lilydjwg/.vim/autoload/manpageview.vim')|call delete('/home/lilydjwg/.vim/syntax/man.vim')|call delete('/home/lilydjwg/.vim/syntax/mangl.vim')|call delete('/home/lilydjwg/.vim/syntax/mankey.vim')|call delete('/home/lilydjwg/.vim/syntax/info.vim')|call delete('/home/lilydjwg/.vim/syntax/manphp.vim')|call delete('/home/lilydjwg/.vim/doc/manpageview.txt')|call delete('/home/lilydjwg/.vim/plugin/cecutil.vim')
View
@@ -1,7 +1,7 @@
" manpageview.vim : extra commands for manual-handling
" Author: Charles E. Campbell, Jr.
-" Date: Oct 21, 2010
-" Version: 23f ASTRO-ONLY
+" Date: Dec 27, 2010
+" Version: 24a ASTRO-ONLY
"
" Please read :help manpageview for usage, options, etc
"
@@ -12,7 +12,7 @@
if &cp || exists("g:loaded_manpageview")
finish
endif
-let g:loaded_manpageview = "v23f"
+let g:loaded_manpageview = "v24a"
if v:version < 702
echohl WarningMsg
echo "***warning*** this version of manpageview needs vim 7.2"
@@ -83,21 +83,28 @@ if !exists("g:manpageview_pgm_pl")
let g:manpageview_pgm_pl = "perldoc"
let g:manpageview_options_pl = ";-f;-q"
endif
-if !exists("g:manpageview_pgm_php") && executable("links")
-" call Decho("installed php help support via manpageview")
- let g:manpageview_pgm_php = "links -dump http://www.php.net/"
+if !exists("g:manpageview_pgm_php") && (executable("links") || executable("elinks"))
+" call Decho("installed php help support via manpageview")
+ let g:manpageview_pgm_php = (executable("links")? "links" : "elinks") " -dump http://www.php.net/"
let g:manpageview_syntax_php = "manphp"
let g:manpageview_nospace_php = 1
let g:manpageview_K_php = "manpageview#ManPagePhp()"
endif
+if !exists("g:manpageview_pgm_gl") && (executable("links") || executable("elinks"))
+ let g:manpageview_pgm_gl = (executable("links")? "links" : "elinks")." -dump http://www.opengl.org/sdk/docs/man/xhtml/"
+ let g:manpageview_syntax_gl = "mangl"
+ let g:manpageview_nospace_gl = 1
+ let g:manpageview_K_gl = "manpageview#ManPagePhp()"
+ let g:manpageview_sfx_gl = ".xml"
+endif
if !exists("g:manpageview_pgm_py") && executable("pydoc")
" call Decho("installed python help support via manpageview")
let g:manpageview_pgm_py = "pydoc"
let g:manpageview_K_py = "manpageview#ManPagePython()"
endif
-if exists("g:manpageview_hypertext_tex") && executable("links") && !exists("g:manpageview_pgm_tex")
+if exists("g:manpageview_hypertext_tex") && !exists("g:manpageview_pgm_tex") && (executable("links") || executable("elinks"))
" call Decho("installed tex help support via manpageview")
- let g:manpageview_pgm_tex = "links ".g:manpageview_hypertext_tex
+ let g:manpageview_pgm_tex = (executable("links")? "links" : "elinks")." ".g:manpageview_hypertext_tex
let g:manpageview_lookup_tex = "manpageview#ManPageTexLookup"
let g:manpageview_K_tex = "manpageview#ManPageTex()"
endif
@@ -232,6 +239,9 @@ fun! manpageview#ManPageView(viamap,bknum,...) range
" call Decho('has parenthesis: manpagebook<'.manpagebook.'> matches "($"')
let manpagebook= ""
endif
+ if manpagebook =~ '\d\+\a\+'
+ let manpagebook= substitute(manpagebook,'\a\+','','')
+ endif
else
" ManPageView(booknumber,"topic")
@@ -250,20 +260,20 @@ fun! manpageview#ManPageView(viamap,bknum,...) range
" 3 abc -or- abc 3
" call Decho("(3 abc -or- abc 3) case a:0=".a:0)
if topic =~ '^\d\+'
-" call Decho("case topic =~ ^\d\+")
+" call Decho("case 1: topic =~ ^\d\+")
let manpagebook = topic
let manpagetopic= a:2
elseif a:2 =~ '^\d\+$'
-" call Decho("case topic =~ \d\+$")
+" call Decho("case 2: topic =~ \d\+$")
let manpagebook = a:2
let manpagetopic= topic
elseif topic == "-k"
-" call Decho("case topic == -k")
+" call Decho("case 3: topic == -k")
" call Decho("user requested man -k")
let manpagetopic = a:2
let manpagebook = "-k"
elseif bknum != ""
-" call Decho('case bknum != ""')
+" call Decho('case 4: bknum != ""')
let manpagetopic = topic
let manpagebook = bknum
else
@@ -291,6 +301,9 @@ fun! manpageview#ManPageView(viamap,bknum,...) range
if manpagetopic =~ '\.'
let ext = substitute(manpagetopic,'^.*\.','','e')
endif
+ if exists("g:manpageview_pgm_gl") && manpagetopic =~ '^gl'
+ let ext = "gl"
+ endif
" infer the appropriate extension based on the filetype {{{3
if ext == ""
@@ -479,7 +492,7 @@ fun! manpageview#ManPageView(viamap,bknum,...) range
" allow K to use <cWORD> when in man pages
if manpageview_syntax == "man"
- nmap <silent> <script> <buffer> K :<c-u>call manpageview#ManPageView(1,v:count,expand("<cWORD>"))<CR>
+ nmap <silent> <script> <buffer> K :<c-u>let g:mpv_before_k_posn= SaveWinPosn(0)<bar>call manpageview#ManPageView(1,v:count,expand("<cWORD>"))<CR>
endif
" allow user to specify file encoding {{{3
@@ -577,7 +590,6 @@ fun! manpageview#ManPageView(viamap,bknum,...) range
endif
exe cmdmod.'silent! %s/.\b//ge'
endif
- 1d
setlocal ro nomod noswf
endif
@@ -636,11 +648,16 @@ fun! manpageview#ManPageView(viamap,bknum,...) range
q
endif
endif
+ call SaveWinPosn()
" call Decho("***warning*** no manpage exists for <".manpagetopic."> book=".manpagebook)
echohl ErrorMsg
echo "***warning*** sorry, no manpage exists for <".manpagetopic.">"
echohl None
sleep 2
+ if exists("g:mpv_before_k_posn")
+ sil! call RestoreWinPosn(g:mpv_before_k_posn)
+ unlet g:mpv_before_k_posn
+ endif
elseif manpagebook == ""
" call Decho('exe file '.fnameescape('Manpageview['.manpagetopic.']'))
exe 'file '.fnameescape('Manpageview['.manpagetopic.']')
@@ -752,6 +769,7 @@ endfun
" s:ManPageInfo: {{{2
fun! s:ManPageInfo(type)
" call Dfunc("s:ManPageInfo(type=".a:type.")")
+ let s:before_K_posn= SaveWinPosn(0)
if &ft != "info"
" restore K and do a manpage lookup for word under cursor
@@ -1061,7 +1079,8 @@ endfun
" ---------------------------------------------------------------------
" manpageview#ManPageTex: {{{2
fun! manpageview#ManPageTex()
- let topic= '\'.expand("<cWORD>")
+ let s:before_K_posn = SaveWinPosn(0)
+ let topic = '\'.expand("<cWORD>")
" call Dfunc("manpageview#ManPageTex() topic<".topic.">")
call manpageview#ManPageView(1,0,topic)
" call Dret("manpageview#ManPageTex")
@@ -1077,7 +1096,8 @@ endfun
" ---------------------------------------------------------------------
" manpageview#:ManPagePhp: {{{2
fun! manpageview#ManPagePhp()
- let topic=substitute(expand("<cWORD>"),'()\=.*$','.php','')
+ let s:before_K_posn = SaveWinPosn(0)
+ let topic = substitute(expand("<cWORD>"),'() \= .*$','.php','')
" call Dfunc("manpageview#ManPagePhp() topic<".topic.">")
call manpageview#ManPageView(1,0,topic)
" call Dret("manpageview#ManPagePhp")
@@ -1086,7 +1106,8 @@ endfun
" ---------------------------------------------------------------------
" manpageview#:ManPagePython: {{{2
fun! manpageview#ManPagePython()
- let topic=substitute(expand("<cWORD>"),'()\=.*$','.py','')
+ let s:before_K_posn = SaveWinPosn(0)
+ let topic = substitute(expand("<cWORD>"),'() \= .*$','.py','')
" call Dfunc("manpageview#ManPagePython() topic<".topic.">")
call manpageview#ManPageView(1,0,topic)
" call Dret("manpageview#ManPagePython")
@@ -1097,6 +1118,7 @@ endfun
fun! manpageview#KMan(ext)
" call Dfunc("manpageview#KMan(ext<".a:ext.">)")
+ let s:before_K_posn = SaveWinPosn(0)
if a:ext == "perl"
let ext= "pl"
elseif a:ext == "gvim"
View
@@ -1,8 +1,8 @@
-*manpageview.txt* Man Page Viewer Oct 21, 2010
+*manpageview.txt* Man Page Viewer Nov 26, 2010
Author: Charles E. Campbell, Jr. <NdrchipO@ScampbellPfamily.AbizM>
(remove NOSPAM from Campbell's email first)
-Copyright: (c) 2004-2009 by Charles E. Campbell, Jr. *manpageview-copyright*
+Copyright: (c) 2004-2010 by Charles E. Campbell, Jr. *manpageview-copyright*
The VIM LICENSE applies to ManPageView.vim and ManPageView.txt
(see |copyright|) except use "ManPageView" instead of "Vim"
no warranty, express or implied. use at-your-own-risk.
@@ -20,6 +20,7 @@ Copyright: (c) 2004-2009 by Charles E. Campbell, Jr. *manpageview-copyright*
Info...................................: |manpageview-info|
Php....................................: |manpageview-php|
Extending ManPageView..................: |manpageview-extend|
+ Manpageview Suggestion.................: |manpageview-suggest|
3. ManPageView Options......................: |manpageview-options|
4. ManPageView History......................: |manpageview-history|
@@ -166,7 +167,7 @@ Copyright: (c) 2004-2009 by Charles E. Campbell, Jr. *manpageview-copyright*
The help on |manpageview_extend| covers these variables in more
detail.
- MULTIPLE MAN PAGES *manpage-pageup* *manpage-pagedown*
+ MULTIPLE MAN PAGES *manpageview-pageup* *manpageview-pagedown*
With >
man -a topic
@@ -176,6 +177,15 @@ Copyright: (c) 2004-2009 by Charles E. Campbell, Jr. *manpageview-copyright*
PageUp : move to preceding manpage
PageDown: move to succeeding manpage
<
+ MANPAGEVIEW SUGGESTION *manpageview-suggest*
+
+ As an example, for C: put in .vim/ftplugin/c/c.vim: >
+ nno <buffer> K :<c-u>exe v:count."Man ".expand("<cword>")<cr>
+< This map allows K to immediately use manpageview with functions in a
+ C program. One may make similar maps for other languages, of course,
+ or simply put the map in one's <.vimrc>.
+
+
==============================================================================
3. ManPageView Options *manpageview-options* {{{1
@@ -304,6 +314,7 @@ Copyright: (c) 2004-2009 by Charles E. Campbell, Jr. *manpageview-copyright*
* (in progress) KMan [ext] to set default
extension for the K map
Oct 21, 2010 * added python help via pydoc (suffix: .py)
+ Oct 25, 2010 * Version 23 released
v22: Nov 10, 2008 * if g:manpageview_K_{ext} (ext is some
extension) exists, previously that would
be enough to institute a K map. Now, if
View
@@ -873,8 +873,6 @@ lua_error_format ft_lua.txt /*lua_error_format*
lua_error_format lua-ftplugin.txt /*lua_error_format*
lua_path ft_lua.txt /*lua_path*
lua_path lua-ftplugin.txt /*lua_path*
-manpage-pagedown manpageview.txt /*manpage-pagedown*
-manpage-pageup manpageview.txt /*manpage-pageup*
manpageview manpageview.txt /*manpageview*
manpageview-K manpageview.txt /*manpageview-K*
manpageview-contents manpageview.txt /*manpageview-contents*
@@ -886,9 +884,12 @@ manpageview-info manpageview.txt /*manpageview-info*
manpageview-man manpageview.txt /*manpageview-man*
manpageview-open manpageview.txt /*manpageview-open*
manpageview-options manpageview.txt /*manpageview-options*
+manpageview-pagedown manpageview.txt /*manpageview-pagedown*
+manpageview-pageup manpageview.txt /*manpageview-pageup*
manpageview-perl manpageview.txt /*manpageview-perl*
manpageview-php manpageview.txt /*manpageview-php*
manpageview-python manpageview.txt /*manpageview-python*
+manpageview-suggest manpageview.txt /*manpageview-suggest*
manpageview-usage manpageview.txt /*manpageview-usage*
manpageview.txt manpageview.txt /*manpageview.txt*
manpageview_extend manpageview.txt /*manpageview_extend*
@@ -12,9 +12,9 @@ set cpo&vim
" ---------------------------------------------------------------------
" Public Interface: {{{1
if !hasmapto('<Plug>ManPageView') && &kp =~ '^man\>'
- nmap <unique> K <Plug>ManPageView
+ nmap <unique> K <Plug>ManPageView
endif
-nmap <silent> <script> <Plug>ManPageView :<c-u>call manpageview#ManPageView(1,v:count,expand("<cword>"))<CR>
+nno <silent> <script> <Plug>ManPageView :<c-u>call manpageview#ManPageView(1,v:count1,expand("<cword>"))<CR>
com! -nargs=* -count=0 Man call manpageview#ManPageView(0,<count>,<f-args>)
com! -nargs=* -count=0 HMan let g:manpageview_winopen="hsplit" |call manpageview#ManPageView(0,<count>,<f-args>)
View
@@ -0,0 +1,34 @@
+" mangl.vim : a vim syntax highlighting file for man pages on GL
+" Author: Charles E. Campbell, Jr.
+" Date: Nov 23, 2010
+" Version: 1a NOT RELEASED
+" ---------------------------------------------------------------------
+syn clear
+let b:current_syntax = "mangl"
+
+syn keyword manglGLType GLbyte GLenum GLshort GLint GLdouble GLubyte GLuint GLfloat GLushort
+syn keyword manglCType const void char short int long double unsigned
+syn match manglCType '\s\*\s'
+syn match manglGLKeyword '\<[A-Z_]\{2,}\>'
+syn keyword manglNormal GL
+
+syn match manglTitle '^\s*\%(Name\|C Specification\|Parameters\|Description\|Notes\|Associated Gets\|See Also\|Copyright\|Errors\|References\)\s*$'
+syn match manglNmbr '\<\d\+\%(\.\d*\)\=\>'
+syn match manglDelim '[()]'
+
+hi def link manglGLType Type
+hi def link manglCType Type
+hi def link manglTitle Title
+hi def link manglNmbr Number
+hi def link manglDelim Delimiter
+hi def link manglGLKeyword Keyword
+
+" cleanup
+if !exists("g:mangl_nocleanup")
+ setlocal mod ma noro
+ %s/ ? / /ge
+ %s/\[\d\+]//ge
+ %s/\(\d\+\)\s\+\*\s\+/\1*/ge
+ %s@\<N\> \(\d\)@N/\1@ge
+ setlocal nomod noma ro
+endif
View
@@ -5,7 +5,6 @@
" Version: 3
" ---------------------------------------------------------------------
syn clear
-
let b:current_syntax = "manphp"
syn keyword manphpKey Description Returns

0 comments on commit 9c413d8

Please sign in to comment.