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 /plugin | |
| parent | add plugin/haredoc.vim, make :Haredoc global (diff) | |
| download | vim-haredoc-42447ac27614bd8278a810c0546879da0f5b1ae8.tar.gz | |
new gK mapping, u & d scrolling, improved docs
Diffstat (limited to '')
| -rw-r--r-- | plugin/haredoc.vim | 11 |
1 files changed, 6 insertions, 5 deletions
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 |
