Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

select modeで文字挿入すると暗黙のうちにyankされる #405

Open
ujihisa opened this issue Jun 4, 2013 · 3 comments
Open

select modeで文字挿入すると暗黙のうちにyankされる #405

ujihisa opened this issue Jun 4, 2013 · 3 comments

Comments

@ujihisa
Copy link
Member

ujihisa commented Jun 4, 2013

:h select-modeによると

Commands in Select mode:
- Printable characters, <NL> and <CR> cause the selection to be deleted, and
  Vim enters Insert mode.  The typed character is inserted.
- Non-printable movement commands, with the Shift key pressed, extend the
  selection.  'keymodel' must include "startsel".
- Non-printable movement commands, with the Shift key NOT pressed, stop Select
  mode.  'keymodel' must include "stopsel".
- ESC stops Select mode.
- CTRL-O switches to Visual mode for the duration of one command. *v_CTRL-O*
- CTRL-G switches to Visual mode.

Otherwise, typed characters are handled as in Visual mode.

とあります。最初のやつを簡単に訳すと「見える文字と改行系のアレをselect-modeのときに入力すると、元のselectされてた部分を削除して、入力した文字が上書きするよ」とあります。この削除 (delete) はinsert modeの<BS>というよりむしろnormal modeのcに近く、registerをselectされてた部分で置き換えます。このことはhelpには明示されていません。

  1. normal modeのdcみたいにyankしちゃうよ、とhelpに明示する
  2. yankしないでinsert modeの<BS>みたいに単純に消す

のどちらかになるのが好ましいと思います。 (個人的には後者が嬉しいですが)

@koron
Copy link
Member

koron commented Jun 5, 2013

まずは 1 やって同時に 2 を提案する、かしらね。
今 2 に変えるのは難しいかも。

いやそもそもコレ系を変えるのはいつだって難しいか…

@Shougo
Copy link
Member

Shougo commented Jun 5, 2013

normal modeのdやcみたいにyankしちゃうよ、とhelpに明示する

visual modeでのdやpと同じ挙動でしょうか。select modeはvisual modeからの派生なので、それにはそれなりの理由がありそうです。ただ、スニペット系のプラグインがselect modeを使用することがよくあり、そのときにはこの挙動が邪魔になりますね。

@thinca
Copy link
Member

thinca commented Jun 5, 2013

select mode の目的を考えると、単にバグの可能性が高そうな気がします。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants