aboutsummaryrefslogtreecommitdiff
path: root/runtime/doc/tips.txt
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-05-04 19:18:16 -0400
committerGitHub <noreply@github.com>2021-05-04 19:18:16 -0400
commit4ad30f775e5564c539324b4818886f067d2ecd99 (patch)
tree97a554379bda7e5fc77e58c690db3f5a72db8c74 /runtime/doc/tips.txt
parent63d8a8f4e8b02e524d85aed08aa16c5d9815598c (diff)
parentd5b063aec1db95704b37a77fdbd968cb6b48cc3b (diff)
downloadrneovim-4ad30f775e5564c539324b4818886f067d2ecd99.tar.gz
rneovim-4ad30f775e5564c539324b4818886f067d2ecd99.tar.bz2
rneovim-4ad30f775e5564c539324b4818886f067d2ecd99.zip
Merge pull request #14424 from janlazo/vim-8.1.1726
vim-patch:8.1.1726,8.2.{296,860,1827,2388,2788,2790,2801}
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: