Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 17 additions & 23 deletions doc/tips.jax
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*tips.txt* For Vim バージョン 9.1. Last change: 2025 Nov 09
*tips.txt* For Vim バージョン 9.1. Last change: 2025 Dec 02


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

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

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

デフォルトでは、ヘルプは分割したウィンドウに表示されます。カレントウィンドウで
開くのが好みであれば、このカスタム `:HelpCurwin` コマンドを試してください:
>
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
set buftype=help
endif
return 'help ' .. a:subject
endfunction
<
デフォルトでは、ヘルプは分割ウィンドウに表示される。状況によっては、カレント
ウィンドウでヘルプを開きたい場合もあるだろう。オプションの helpcurwin パッケー
ジを使用すると、これが可能になる。パッケージは手動で読み込むか、|vimrc| に以
下を追加する: >vim

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

vim:tw=78:ts=8:noet:ft=help:norl:
40 changes: 17 additions & 23 deletions en/tips.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*tips.txt* For Vim version 9.1. Last change: 2025 Nov 09
*tips.txt* For Vim version 9.1. Last change: 2025 Dec 02


VIM REFERENCE MANUAL by Bram Moolenaar
Expand Down Expand Up @@ -30,7 +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|
Opening help in the current window |package-helpcurwin|

==============================================================================
Editing C programs *C-editing*
Expand Down Expand Up @@ -544,28 +544,22 @@ A slightly more advanced version is used in the |matchparen| plugin.
<

==============================================================================
Opening help in the current window *help-curwin*
Opening help in the current window *package-helpcurwin*

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
set buftype=help
endif
return 'help ' .. a:subject
endfunction
<
By default, help is displayed in a split window. In some scenarios, you may
prefer to open the help in the current window. The optional helpcurwin
package makes this possible. Load the package manually, or in your |vimrc|,
with: >vim

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

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