Skip to content

Commit bd6804c

Browse files
authored
Merge pull request #2436 from h-east/update-tips
Update tips.{txt,jax}
2 parents 0b23da6 + c7e3b87 commit bd6804c

File tree

2 files changed

+34
-46
lines changed

2 files changed

+34
-46
lines changed

doc/tips.jax

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*tips.txt* For Vim バージョン 9.1. Last change: 2025 Nov 09
1+
*tips.txt* For Vim バージョン 9.1. Last change: 2025 Dec 02
22

33

44
VIM リファレンスマニュアル by Bram Moolenaar
@@ -29,7 +29,7 @@ xterm でのスクリーンの切り替え |xterm-screens|
2929
バイナリ編集 |hex-editing|
3030
自動コマンドで <> 表記を使う |autocmd-<>|
3131
対応する括弧を強調する |match-parens|
32-
カレントウィンドウでヘルプを開く |help-curwin|
32+
カレントウィンドウでヘルプを開く |package-helpcurwin|
3333

3434
==============================================================================
3535
C のプログラムを編集する *C-editing*
@@ -551,28 +551,22 @@ NOTE: これを利用するには 'cpoptions' から '<' フラグを外して
551551
<
552552

553553
==============================================================================
554-
カレントウィンドウでヘルプを開く *help-curwin*
554+
カレントウィンドウでヘルプを開く *package-helpcurwin*
555555

556-
デフォルトでは、ヘルプは分割したウィンドウに表示されます。カレントウィンドウで
557-
開くのが好みであれば、このカスタム `:HelpCurwin` コマンドを試してください:
558-
>
559-
command -bar -nargs=? -complete=help HelpCurwin execute s:HelpCurwin(<q-args>)
560-
let s:did_open_help = v:false
561-
562-
function s:HelpCurwin(subject) abort
563-
let mods = 'silent noautocmd keepalt'
564-
if !s:did_open_help
565-
execute mods .. ' help'
566-
execute mods .. ' helpclose'
567-
let s:did_open_help = v:true
568-
endif
569-
if !getcompletion(a:subject, 'help')->empty()
570-
execute mods .. ' edit ' .. &helpfile
571-
set buftype=help
572-
endif
573-
return 'help ' .. a:subject
574-
endfunction
575-
<
556+
デフォルトでは、ヘルプは分割ウィンドウに表示される。状況によっては、カレント
557+
ウィンドウでヘルプを開きたい場合もあるだろう。オプションの helpcurwin パッケー
558+
ジを使用すると、これが可能になる。パッケージは手動で読み込むか、|vimrc| に以
559+
下を追加する: >vim
576560

561+
packadd helpcurwin
562+
<
563+
読み込み後:
564+
- コマンド `:HelpCurwin` {subject} を使用すると、カレントウィンドウでヘルプを
565+
開くことができる。
566+
- カレントウィンドウに変更されたバッファが含まれている場合、プラグインはバッ
567+
ファを置き換える前に確認を求める。確認された場合、バッファは非表示になる
568+
(|hidden-buffer|)。
569+
- ヘルプファイル |helpcurwin.txt| が使用可能になり、プラグインについてより詳細
570+
に説明している。
577571

578572
vim:tw=78:ts=8:noet:ft=help:norl:

en/tips.txt

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*tips.txt* For Vim version 9.1. Last change: 2025 Nov 09
1+
*tips.txt* For Vim version 9.1. Last change: 2025 Dec 02
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -30,7 +30,7 @@ Executing shell commands in a window |shell-window|
3030
Hex editing |hex-editing|
3131
Using <> notation in autocommands |autocmd-<>|
3232
Highlighting matching parens |match-parens|
33-
Opening help in the current window |help-curwin|
33+
Opening help in the current window |package-helpcurwin|
3434

3535
==============================================================================
3636
Editing C programs *C-editing*
@@ -544,28 +544,22 @@ A slightly more advanced version is used in the |matchparen| plugin.
544544
<
545545

546546
==============================================================================
547-
Opening help in the current window *help-curwin*
547+
Opening help in the current window *package-helpcurwin*
548548

549-
By default, help is displayed in a split window. If you prefer it opens in
550-
the current window, try this custom `:HelpCurwin` command:
551-
>
552-
command -bar -nargs=? -complete=help HelpCurwin execute s:HelpCurwin(<q-args>)
553-
let s:did_open_help = v:false
554-
555-
function s:HelpCurwin(subject) abort
556-
let mods = 'silent noautocmd keepalt'
557-
if !s:did_open_help
558-
execute mods .. ' help'
559-
execute mods .. ' helpclose'
560-
let s:did_open_help = v:true
561-
endif
562-
if !getcompletion(a:subject, 'help')->empty()
563-
execute mods .. ' edit ' .. &helpfile
564-
set buftype=help
565-
endif
566-
return 'help ' .. a:subject
567-
endfunction
568-
<
549+
By default, help is displayed in a split window. In some scenarios, you may
550+
prefer to open the help in the current window. The optional helpcurwin
551+
package makes this possible. Load the package manually, or in your |vimrc|,
552+
with: >vim
569553

554+
packadd helpcurwin
555+
<
556+
After it has loaded:
557+
- The command `:HelpCurwin` {subject} can be used to open help in the current
558+
window.
559+
- If the current window contains a modified buffer, the plugin asks for
560+
confirmation before replacing it. If confirmed, the buffer becomes
561+
hidden |hidden-buffer|.
562+
- The help file, |helpcurwin.txt|, will be available and describes the plugin
563+
in more details.
570564

571565
vim:tw=78:ts=8:noet:ft=help:norl:

0 commit comments

Comments
 (0)