Skip to content

Commit eca78e7

Browse files
authored
Merge pull request #1121 from vampire-yuta/fix-visual.txt
update visual.txt
2 parents dd1a19f + 9f0b527 commit eca78e7

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

doc/visual.jax

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*visual.txt* For Vim バージョン 9.0. Last change: 2022 May 06
1+
*visual.txt* For Vim バージョン 9.0. Last change: 2022 Jun 18
22

33

44
VIMリファレンスマニュアル by Bram Moolenaar
@@ -492,6 +492,13 @@ abcdefghijklmnXXXXXXuvwxyz
492492
われる。ビジュアルモードと選択モードで別々にマッピングを定義するときは|:xmap|
493493
|:smap|を使うこと。
494494

495+
以下は特定のエッジケースの一例: >
496+
:vnoremap <C-K> <Esc>
497+
これは、ビジュアルモードの時はビジュアルモードが終了するが、選択モードの時は、
498+
マップされたキーの実行後に選択モードが復元されるため動作しない。以下を使用する
499+
必要がある: >
500+
:snoremap <C-K> <Esc>
501+
<
495502
ユーザーは印字可能な文字を押すと選択された領域が置換されることを期待している。
496503
そのため、選択モードで印字可能な文字にマップするのは避けること。または |:map|
497504
|:vmap|のあとで |:sunmap| をして選択モードに対するマップを削除すること。

en/visual.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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
22

33

44
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
509509
mode Vim automatically switches to Visual mode, so that the same behavior as
510510
in Visual mode is effective. If you don't want this use |:xmap| or |:smap|.
511511

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+
<
512519
Users will expect printable characters to replace the selected area.
513520
Therefore avoid mapping printable characters in Select mode. Or use
514521
|:sunmap| after |:map| and |:vmap| to remove it for Select mode.

0 commit comments

Comments
 (0)