Skip to content

Commit 6a2f221

Browse files
authored
Merge pull request #284 from mnishz/gui_for_Vim_8.1
Update gui from Vim 8.0 to 8.1
2 parents 89561b1 + 67a6b2a commit 6a2f221

File tree

2 files changed

+130
-16
lines changed

2 files changed

+130
-16
lines changed

doc/gui.jax

Lines changed: 68 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*gui.txt* For Vim バージョン 8.0. Last change: 2014 Mar 08
1+
*gui.txt* For Vim バージョン 8.1. Last change: 2018 Mar 06
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -67,7 +67,8 @@ GUIの初期化は次の順序で行われる:
6767
- GVIMINIT環境変数が存在し空でないなら、それがExコマンドとして実行される。
6868
- ユーザーのgvimrcファイルが存在するなら、それが読み込まれる。このファイル
6969
の名前は通常 "$HOME/.gvimrc" である。":version" でこれを確認できる。
70-
- Win32では、$HOMEが設定されていないときは、"$VIM\_gvimrc" が読み込まれる。
70+
- Win32では、必要であれば Vim によって $HOME が設定される、|$HOME-windows|
71+
を参照。
7172
- "_gvimrc" ファイルが見つからないときには、".gvimrc" も試される。逆のときも
7273
同様である。
7374
$MYGVIMRC が設定されていないならば、$MYGVIMRC に最初に見つかったファイルの名
@@ -78,8 +79,9 @@ GUIの初期化は次の順序で行われる:
7879
のセキュリティ上の制限が適用される。".gvimrc" が見つからないときには、
7980
"_gvimrc" も試される。MacintoshとDOS/Win32では、"_gvimrc" が最初に試される。
8081

81-
NOTE: Vimを起動するときに、"-U" 引数を指定せずに "-u NONE" を指定するか、ある
82-
いは "-U NONE" を指定して起動すると、最初のもの以外は全て実行されない。
82+
NOTE: Vimを起動するときに、"-U" 引数を指定せずに "-u NONE" もしくは
83+
"-u DEFAULTS" を指定するか、あるいは "-U NONE" を指定して起動すると、最初のも
84+
の以外は全て実行されない。
8385

8486
これらは全て、ユーザーの.vimrcファイルを読み込む、というような、通常のVimの初
8587
期化の後に実行される。|initialization|を参照。
@@ -130,7 +132,8 @@ Vimは起動時に、スクリーンに合わせてウィンドウの位置を
130132
:winp[os]
131133
GUI vimウィンドウの左上隅の現在の位置をピクセルで表示する。全
132134
てのバージョンで機能する訳ではない。
133-
|getwinposx()||getwinposy()| も参照のこと。
135+
|getwinpos()||getwinposx()| および |getwinposy()| も参照のこ
136+
と。
134137

135138
:winp[os] {X} {Y} *E466*
136139
与えられた{X}{Y}の座標にGUI vimウィンドウを移動する。座標は
@@ -157,7 +160,7 @@ X Window Systemでは、これらのコマンドでVimのウィンドウの情
157160
<
158161
*gui-IME* *iBus*
159162
X で各国の文字を入力するためのインプットメソッドで XIM フレームワークに依るも
160-
の、特に iBus は、gVim で使用すると不具合が起こることが知られている。スペース
163+
の、特に iBus は、gvim で使用すると不具合が起こることが知られている。スペース
161164
を入力できなかったり、キーを押してからそれがアプリケーションに届くまで大きな遅
162165
延が発生したりする。
163166

@@ -472,7 +475,8 @@ X11でこのレジスタを使うには、|x11-selection|も参照。これは
472475
メニュー項目を追加することは大きな力を秘めている。ある一連のキー操作を覚えられ
473476
ないようなときに最も便利である。
474477

475-
別の言語用にメニューを作成するには、|:menutrans|を参照。
478+
別の言語用にメニューを作成するには、|:menutrans| を参照。
479+
メニューをまったく使いたくない場合は、|'go-M'| を参照。
476480

477481
*menu.vim*
478482
標準のメニューは "$VIMRUNTIME/menu.vim" ファイルから読み込まれる。パスがどこを
@@ -490,7 +494,22 @@ Syntax メニューの最初の項目{訳注:「対応形式をメニューに
490494
を加える: >
491495
:let do_syntax_sel_menu = 1
492496
493-
<
497+
以下のメニュー項目は、使用可能なすべてのカラースキーム、キーマップおよびコンパ
498+
イラ設定を表示する。
499+
Edit > Color Scheme ~
500+
Edit > Keymap ~
501+
Tools > Set Compiler ~
502+
しかしながら、'runtimepath' 内のディレクトリから関連するファイルをすべて検索す
503+
るので読み込みに多少時間がかかる。したがって、それらは (イベント |CursorHold|
504+
によって) 遅れて読み込まれる、もしくは手動で読み込むこともできる。すでに存在す
505+
るすべての項目を起動時に読み込んでおきたい場合、以下を加える: >
506+
:let do_no_lazyload_menus = 1
507+
508+
Note: menu.vim が読み込まれるのは、`:syntax on` もしくは `:filetype on` が実行
509+
されたとき、もしくはユーザーの .vimrc ファイルが読み込まれた後である。これは、
510+
オプション 'encoding' およびメッセージ用の言語 (`:language messages`) がそれよ
511+
り前に設定されていなければならないことを意味する (もし変更したいのであれば)。
512+
494513
*console-menus*
495514
このドキュメントはGUIの項目であるけれども、CUI版のVimでも実際にメニューを使用
496515
することができる。そのときには明示的に|menu.vim|を読み込まなければならないだろ
@@ -787,10 +806,42 @@ Note: 区切りの定義にはコマンドの指定が必要である。その
787806
Win32とGTK+ GUIでは、']' で始まるメニュー名はメインのメニューバーから除外され
788807
る。それを表示するには|:popup||:tearoff|コマンドを使用しなければならない。
789808

809+
*window-toolbar* *WinBar*
810+
各ウィンドウはローカルなツールバーを持つことができる。これはウィンドウの先頭行
811+
を使用し、したがってテキスト用の領域は 1 行少なくなる。ツールバー内の項目は
812+
"WinBar" で始まらなければならない。
813+
814+
テキストのみを使用することができる。Unicode を使用する場合、項目をアイコンのよ
815+
うに見せるために特殊文字を使うことができる。
816+
817+
項目が収まらない場合、最後の項目は使用することができない。ツールバーは折り返さ
818+
ない。
819+
820+
Note: これらのコマンドを実行しているとき、Vim はどのモードでもありうる。メ
821+
ニューはノーマルモード用に定義されるべきで、かつ現状のモードを変えることなく実
822+
行される。したがって、カレントウィンドウがビジュアルモードで、かつメニューコマ
823+
ンドが意図的にモードを変えない場合、Vim はビジュアルモードのままである。もっと
824+
もよいのは、副作用を避けるために `:nnoremenu` を使用することである。
825+
826+
デバッガツールの例: >
827+
nnoremenu 1.10 WinBar.Step :Step<CR>
828+
nnoremenu 1.20 WinBar.Next :Next<CR>
829+
nnoremenu 1.30 WinBar.Finish :Finish<CR>
830+
nnoremenu 1.40 WinBar.Cont :Continue<CR>
831+
<
832+
ウィンドウツールバーは ToolbarLine および ToolbarButton ハイライトグループを使
833+
用する。
834+
835+
ウィンドウを分割する際、ウィンドウツールバーは新しいウィンドウにはコピーされな
836+
い。
837+
790838
*popup-menu*
791839
Win32、GTK+、Motif、Athena、Photon GUIでは、特別なメニュー "PopUp" を定義する
792840
ことができる。これは、'mousemodel' がpopupあるいはpopup_setposに設定されている
793841
ときに、マウスの右ボタンが押されると表示されるメニューである。
842+
例: >
843+
nnoremenu 1.40 PopUp.&Paste "+gP
844+
menu PopUp
794845
795846
796847
5.3 メニューの定義を表示する *showing-menus*
@@ -951,10 +1002,15 @@ Win32とGTK+ GUIでは、カーソルの位置にメニューをポップアッ
9511002
:popu[p] {name} メニュー項目{name}をポップアップ表示する。その
9521003
メニューは少なくとも1つ以上の項目を持っている
9531004
必要がある。メニューバーに表示されている必要は
954-
ない。
1005+
ない (|hidden-menus| を参照)。
1006+
{Win32 および GTK GUI、もしくは +insert_expand
1007+
付きでコンパイルした場合の端末内で利用可能}
9551008

9561009
:popu[p]! {name} 上記と同様だが、カーソル位置でなくマウスポイン
9571010
タの位置にメニューを表示する。
1011+
端末では、これは通常最後にクリックした、もしく
1012+
は離した、最後に分かっている位置である (マウス
1013+
の動きは無関係である)。
9581014

9591015
例: >
9601016
:popup File
@@ -966,6 +1022,9 @@ Win32とGTK+ GUIでは、カーソルの位置にメニューをポップアッ
9661022
これはメインのメニューバーにメニュー項目を作らずにポップアップメニューを作成す
9671023
る。
9681024

1025+
Note: GUI では、:popup コマンドは選択がなされる前に直ちに終了する。端末の場合
1026+
はユーザーが選択を行うまで待つ。
1027+
9691028
Note: ']' で始まるメニュー項目はメニューバーに表示されない。
9701029

9711030
==============================================================================

en/gui.txt

Lines changed: 62 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*gui.txt* For Vim version 8.0. Last change: 2014 Mar 08
1+
*gui.txt* For Vim version 8.1. Last change: 2018 Mar 06
22

33

44
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -67,7 +67,7 @@ When the GUI starts up initializations are carried out, in this order:
6767
executed as an Ex command.
6868
- If the user gvimrc file exists, it is sourced. The name of this file is
6969
normally "$HOME/.gvimrc". You can check this with ":version".
70-
- For Win32, when $HOME is not set, "$VIM\_gvimrc" is used.
70+
- For Win32, $HOME is set by Vim if needed, see |$HOME-windows|.
7171
- When a "_gvimrc" file is not found, ".gvimrc" is tried too. And vice
7272
versa.
7373
The name of the first file found is stored in $MYGVIMRC, unless it was
@@ -79,7 +79,8 @@ When the GUI starts up initializations are carried out, in this order:
7979
and DOS/Win32 "_gvimrc" is tried first.
8080

8181
NOTE: All but the first one are not carried out if Vim was started with
82-
"-u NONE" and no "-U" argument was given, or when started with "-U NONE".
82+
"-u NONE" or "-u DEFAULTS" and no "-U" argument was given, or when started
83+
with "-U NONE".
8384

8485
All this happens AFTER the normal Vim initializations, like reading your
8586
.vimrc file. See |initialization|.
@@ -133,7 +134,7 @@ task bar with the 'guiheadroom' option.
133134
:winp[os]
134135
Display current position of the top left corner of the GUI vim
135136
window in pixels. Does not work in all versions.
136-
Also see |getwinposx()| and |getwinposy()|.
137+
Also see |getwinpos()|, |getwinposx()| and |getwinposy()|.
137138

138139
:winp[os] {X} {Y} *E466*
139140
Put the GUI vim window at the given {X} and {Y} coordinates.
@@ -161,7 +162,7 @@ window Vim is running in with these commands: >
161162
*gui-IME* *iBus*
162163
Input methods for international characters in X that rely on the XIM
163164
framework, most notably iBus, have been known to produce undesirable results
164-
in gVim. These may include an inability to enter spaces, or long delays
165+
in gvim. These may include an inability to enter spaces, or long delays
165166
between typing a character and it being recognized by the application.
166167

167168
One workaround that has been successful, for unknown reasons, is to prevent
@@ -481,6 +482,7 @@ menus and menu items. They are most useful for things that you can't remember
481482
what the key sequence was.
482483

483484
For creating menus in a different language, see |:menutrans|.
485+
If you don't want to use menus at all, see |'go-M'|.
484486

485487
*menu.vim*
486488
The default menus are read from the file "$VIMRUNTIME/menu.vim". See
@@ -497,7 +499,22 @@ in the menu (which can take a bit of time to load). If you want to have all
497499
filetypes already present at startup, add: >
498500
:let do_syntax_sel_menu = 1
499501
500-
<
502+
The following menuitems show all available color schemes, keymaps and compiler
503+
settings:
504+
Edit > Color Scheme ~
505+
Edit > Keymap ~
506+
Tools > Set Compiler ~
507+
However, they can also take a bit of time to load, because they search all
508+
related files from the directories in 'runtimepath'. Therefore they are
509+
loaded lazily (by the |CursorHold| event), or you can also load them manually.
510+
If you want to have all these items already present at startup, add: >
511+
:let do_no_lazyload_menus = 1
512+
513+
Note that the menu.vim is sourced when `:syntax on` or `:filetype on` is
514+
executed or after your .vimrc file is sourced. This means that the 'encoding'
515+
option and the language of messages (`:language messages`) must be set before
516+
that (if you want to change them).
517+
501518
*console-menus*
502519
Although this documentation is in the GUI section, you can actually use menus
503520
in console mode too. You will have to load |menu.vim| explicitly then, it is
@@ -783,10 +800,40 @@ In the Win32 and GTK+ GUI, starting a menu name with ']' excludes that menu
783800
from the main menu bar. You must then use the |:popup| or |:tearoff| command
784801
to display it.
785802

803+
*window-toolbar* *WinBar*
804+
Each window can have a local toolbar. This uses the first line of the window,
805+
thus reduces the space for the text by one line. The items in the toolbar
806+
must start with "WinBar".
807+
808+
Only text can be used. When using Unicode, special characters can be used to
809+
make the items look like icons.
810+
811+
If the items do not fit then the last ones cannot be used. The toolbar does
812+
not wrap.
813+
814+
Note that Vim may be in any mode when executing these commands. The menu
815+
should be defined for Normal mode and will be executed without changing the
816+
current mode. Thus if the current window is in Visual mode and the menu
817+
command does not intentionally change the mode, Vim will remain in Visual
818+
mode. Best is to use `:nnoremenu` to avoid side effects.
819+
820+
Example for debugger tools: >
821+
nnoremenu 1.10 WinBar.Step :Step<CR>
822+
nnoremenu 1.20 WinBar.Next :Next<CR>
823+
nnoremenu 1.30 WinBar.Finish :Finish<CR>
824+
nnoremenu 1.40 WinBar.Cont :Continue<CR>
825+
<
826+
The window toolbar uses the ToolbarLine and ToolbarButton highlight groups.
827+
828+
When splitting the window the window toolbar is not copied to the new window.
829+
786830
*popup-menu*
787831
In the Win32, GTK+, Motif, Athena and Photon GUI, you can define the
788832
special menu "PopUp". This is the menu that is displayed when the right mouse
789833
button is pressed, if 'mousemodel' is set to popup or popup_setpos.
834+
Example: >
835+
nnoremenu 1.40 PopUp.&Paste "+gP
836+
menu PopUp
790837
791838
792839
5.3 Showing What Menus Are Mapped To *showing-menus*
@@ -945,10 +992,14 @@ it behaves in a strange way.
945992
:popu[p] {name} Popup the menu {name}. The menu named must
946993
have at least one subentry, but need not
947994
appear on the menu-bar (see |hidden-menus|).
948-
{only available for Win32 and GTK GUI}
995+
{only available for Win32 and GTK GUI or in
996+
the terminal when compiled with +insert_expand}
949997

950998
:popu[p]! {name} Like above, but use the position of the mouse
951999
pointer instead of the cursor.
1000+
In the terminal this is the last known
1001+
position, which is usually at the last click
1002+
or release (mouse movement is irrelevant).
9521003

9531004
Example: >
9541005
:popup File
@@ -959,6 +1010,10 @@ pointer if ! was used). >
9591010
:popup ]Toolbar
9601011
This creates a popup menu that doesn't exist on the main menu-bar.
9611012

1013+
Note that in the GUI the :popup command will return immediately, before a
1014+
selection has been made. In the terminal the commands waits for the user to
1015+
make a selection.
1016+
9621017
Note that a menu that starts with ']' will not be displayed.
9631018

9641019
==============================================================================

0 commit comments

Comments
 (0)