File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 1
- *visual.txt* For Vim バージョン 9.0. Last change: 2022 May 06
1
+ *visual.txt* For Vim バージョン 9.0. Last change: 2022 Jun 18
2
2
3
3
4
4
VIMリファレンスマニュアル by Bram Moolenaar
@@ -492,6 +492,13 @@ abcdefghijklmnXXXXXXuvwxyz
492
492
われる。ビジュアルモードと選択モードで別々にマッピングを定義するときは| :xmap |
493
493
や| :smap | を使うこと。
494
494
495
+ 以下は特定のエッジケースの一例: >
496
+ :vnoremap <C-K> <Esc>
497
+ これは、ビジュアルモードの時はビジュアルモードが終了するが、選択モードの時は、
498
+ マップされたキーの実行後に選択モードが復元されるため動作しない。以下を使用する
499
+ 必要がある: >
500
+ :snoremap <C-K> <Esc>
501
+ <
495
502
ユーザーは印字可能な文字を押すと選択された領域が置換されることを期待している。
496
503
そのため、選択モードで印字可能な文字にマップするのは避けること。または | :map |
497
504
と| :vmap | のあとで | :sunmap | をして選択モードに対するマップを削除すること。
Original file line number Diff line number Diff line change 1
- *visual.txt* For Vim version 8.2 . Last change: 2022 May 06
1
+ *visual.txt* For Vim version 9.0 . Last change: 2022 Jun 18
2
2
3
3
4
4
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -509,6 +509,13 @@ work both in Visual mode and in Select mode. When these are used in Select
509
509
mode Vim automatically switches to Visual mode, so that the same behavior as
510
510
in Visual mode is effective. If you don't want this use | :xmap | or | :smap | .
511
511
512
+ One particular edge case: >
513
+ :vnoremap <C-K> <Esc>
514
+ This ends Visual mode when in Visual mode, but in Select mode it does not
515
+ work, because Select mode is restored after executing the mapped keys. You
516
+ need to use: >
517
+ :snoremap <C-K> <Esc>
518
+ <
512
519
Users will expect printable characters to replace the selected area.
513
520
Therefore avoid mapping printable characters in Select mode. Or use
514
521
| :sunmap | after | :map | and | :vmap | to remove it for Select mode.
You can’t perform that action at this time.
0 commit comments