aboutsummaryrefslogtreecommitdiff
path: root/plugin/haredoc.vim
diff options
context:
space:
mode:
authorByron Torres <b@torresjrjr.com>2022-06-15 03:12:03 +0100
committerByron Torres <b@torresjrjr.com>2022-06-15 03:19:25 +0100
commit42447ac27614bd8278a810c0546879da0f5b1ae8 (patch)
tree5641c44ac39af1e80c66b94c00138b73dfd90b0e /plugin/haredoc.vim
parentadd plugin/haredoc.vim, make :Haredoc global (diff)
downloadvim-haredoc-42447ac27614bd8278a810c0546879da0f5b1ae8.tar.gz
new gK mapping, u & d scrolling, improved docs
Diffstat (limited to 'plugin/haredoc.vim')
-rw-r--r--plugin/haredoc.vim11
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