aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/tips.txt
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-01 21:56:01 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-01 22:29:03 -0400
commitc1dd4e83b494d19a5ebcb7ffb936cb4649f11637 (patch)
treecf945ae6c174d372c74497efa8baee2e7aeabc7f /runtime/doc/tips.txt
parentb1cd67b62e58c7f7d4139416e6813f8f50bc0fd6 (diff)
downloadrneovim-c1dd4e83b494d19a5ebcb7ffb936cb4649f11637.tar.gz
rneovim-c1dd4e83b494d19a5ebcb7ffb936cb4649f11637.tar.bz2
rneovim-c1dd4e83b494d19a5ebcb7ffb936cb4649f11637.zip
vim-patch:7e6a515ed14e
Update runtime files. https://github.com/vim/vim/commit/7e6a515ed14e204fafb3dd6e98f2fb543e64aedd Omit vim9.
Diffstat (limited to 'runtime/doc/tips.txt')
-rw-r--r--runtime/doc/tips.txt24
1 files changed, 24 insertions, 0 deletions
diff --git a/runtime/doc/tips.txt b/runtime/doc/tips.txt
index 1362b730b7..bcb2e48cbf 100644
--- a/runtime/doc/tips.txt
+++ b/runtime/doc/tips.txt
@@ -446,4 +446,28 @@ A slightly more advanced version is used in the |matchparen| plugin.
autocmd InsertEnter * match none
<
+==============================================================================
+Opening help in the current window *help-curwin*
+
+By default, help is displayed in a split window. If you prefer it opens in
+the current window, try this custom `:HelpCurwin` command:
+>
+ command -bar -nargs=? -complete=help HelpCurwin execute s:HelpCurwin(<q-args>)
+ let s:did_open_help = v:false
+
+ function s:HelpCurwin(subject) abort
+ let mods = 'silent noautocmd keepalt'
+ if !s:did_open_help
+ execute mods .. ' help'
+ execute mods .. ' helpclose'
+ let s:did_open_help = v:true
+ endif
+ if !getcompletion(a:subject, 'help')->empty()
+ execute mods .. ' edit ' .. &helpfile
+ endif
+ return 'help ' .. a:subject
+ endfunction
+<
+
+
vim:tw=78:ts=8:noet:ft=help:norl: