diff options
| author | Byron Torres <b@torresjrjr.com> | 2022-06-15 03:12:03 +0100 |
|---|---|---|
| committer | Byron Torres <b@torresjrjr.com> | 2022-06-15 03:19:25 +0100 |
| commit | 42447ac27614bd8278a810c0546879da0f5b1ae8 (patch) | |
| tree | 5641c44ac39af1e80c66b94c00138b73dfd90b0e | |
| parent | add plugin/haredoc.vim, make :Haredoc global (diff) | |
| download | vim-haredoc-42447ac27614bd8278a810c0546879da0f5b1ae8.tar.gz | |
new gK mapping, u & d scrolling, improved docs
| -rw-r--r-- | doc/haredoc.txt | 22 | ||||
| -rw-r--r-- | doc/tags | 2 | ||||
| -rw-r--r-- | ftplugin/hare.vim | 3 | ||||
| -rw-r--r-- | plugin/haredoc.vim | 11 |
4 files changed, 27 insertions, 11 deletions
diff --git a/doc/haredoc.txt b/doc/haredoc.txt index f33a755..c2e6f60 100644 --- a/doc/haredoc.txt +++ b/doc/haredoc.txt @@ -1,4 +1,4 @@ -*haredoc.txt* *haredoc* haredoc in vim +*haredoc.txt* *haredoc* -- documentation for the Hare programming language This plugin integrates the haredoc command of the Hare programming language, which looks up and displays documentation for Hare symbols/identifiers in your @@ -19,19 +19,31 @@ MAPPINGS *K* *haredoc-K* K Show documentation for the Hare symbol under the - cursor in a |popup-window|. Press q or CTRL-C to - close. + cursor in a |popup-window|. + Press d and u to scroll largs outputs. + Press q or CTRL-C to close. + *gK* *haredoc-gK* +gK Show documentation for the Hare symbol under the + cursor in a |terminal-window|. + Press d and u to scroll largs outputs. + Press q or CTRL-C once or twice to close. + COMMANDS *:Haredoc* :Haredoc {symbol} Show documentation for the given Hare symbol in a - |terminal-window|. Press q or CTRL-C once or twice to - close. + |terminal-window|. + Press d and u to scroll largs outputs. + Press q or CTRL-C once or twice to close. :Haredoc . Same as the |K| command. +:Haredoc , Same as the |gK| command. + + + LICENSE @@ -1,5 +1,7 @@ :Haredoc haredoc.txt /*:Haredoc* K haredoc.txt /*K* +gK haredoc.txt /*gK* haredoc haredoc.txt /*haredoc* haredoc-K haredoc.txt /*haredoc-K* +haredoc-gK haredoc.txt /*haredoc-gK* haredoc.txt haredoc.txt /*haredoc.txt* diff --git a/ftplugin/hare.vim b/ftplugin/hare.vim index 2d31f90..944ee0a 100644 --- a/ftplugin/hare.vim +++ b/ftplugin/hare.vim @@ -5,4 +5,5 @@ setlocal keywordprg=haredoc -nnoremap <buffer> K :call Haredoc('.')<CR> +nnoremap <buffer> K :call Haredoc('.')<CR> +nnoremap <buffer> gK :call Haredoc(',')<CR> diff --git a/plugin/haredoc.vim b/plugin/haredoc.vim index 65171fa..d7ff721 100644 --- a/plugin/haredoc.vim +++ b/plugin/haredoc.vim @@ -7,15 +7,14 @@ command -nargs=? Haredoc :call Haredoc(<q-args>) function Haredoc(symbol) let symbol = a:symbol - let popup = 0 - if symbol == '.' - let popup = 1 + let popup = symbol == '.' ? 1 : 0 + if (symbol == '.' || symbol == ',') let oldiskeyword = &iskeyword setlocal iskeyword+=: let symbol = expand('<cword>') let &iskeyword = oldiskeyword endif - if has('terminal') && has('popupwin') && popup == 1 + if popup == 1 && has('popupwin') && has('terminal') let minheight = 1 + system( \ "haredoc -Ftty '"..symbol.."' 2>&1 | wc -l" \ ) @@ -39,8 +38,10 @@ function Haredoc(symbol) \ ) elseif has('terminal') execute 'terminal ++noclose haredoc '..symbol - set nonumber + set nonumber filetype=hare nnoremap <buffer> q :close<CR> + nnoremap <buffer> <nowait> u <C-U> + nnoremap <buffer> <nowait> d <C-D> else execute '!haredoc '..symbol endif |
