From 42447ac27614bd8278a810c0546879da0f5b1ae8 Mon Sep 17 00:00:00 2001 From: Byron Torres Date: Wed, 15 Jun 2022 03:12:03 +0100 Subject: new gK mapping, u & d scrolling, improved docs --- plugin/haredoc.vim | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'plugin') 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() 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('') 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 q :close + nnoremap u + nnoremap d else execute '!haredoc '..symbol endif -- cgit v1.2.3