summaryrefslogtreecommitdiffstats
path: root/runtime/doc/tips.txt
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-01-02 16:39:53 +0100
committerBram Moolenaar <Bram@vim.org>2021-01-02 16:39:53 +0100
commit7e6a515ed14e204fafb3dd6e98f2fb543e64aedd (patch)
tree75163fe37994ee84b512bbd8d833453583fd3bd8 /runtime/doc/tips.txt
parent02faa944c69ea22a7a5338135b686dac2c946ca1 (diff)
Update runtime files.
Diffstat (limited to 'runtime/doc/tips.txt')
-rw-r--r--runtime/doc/tips.txt27
1 files changed, 26 insertions, 1 deletions
diff --git a/runtime/doc/tips.txt b/runtime/doc/tips.txt
index a66de919ad..af78965e96 100644
--- a/runtime/doc/tips.txt
+++ b/runtime/doc/tips.txt
@@ -1,4 +1,4 @@
-*tips.txt* For Vim version 8.2. Last change: 2009 Nov 07
+*tips.txt* For Vim version 8.2. Last change: 2020 Dec 29
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -30,6 +30,7 @@ Executing shell commands in a window |shell-window|
Hex editing |hex-editing|
Using <> notation in autocommands |autocmd-<>|
Highlighting matching parens |match-parens|
+Opening help in the current window |help-curwin|
==============================================================================
Editing C programs *C-editing*
@@ -530,4 +531,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: