t9md / atom-vim-mode-plus

vim-mode improved
https://atom.io/packages/vim-mode-plus
MIT License
1.4k stars 112 forks source link

expose select operator as normal command #893

Closed t9md closed 7 years ago

t9md commented 7 years ago

Came up with idea while thinking for question in #890.

This PR expose Select operator as normal command.

Why I haven't exposed this operator till now is, vmp's this part was not clean/consistent enough to expose user. Also I didn't understand for select operation clearly as I do now.

Changes summary.

jackcasey commented 7 years ago

:+1: I think this is what I have been missing from occurrence, an easy way to visual select all occurrences rather than any other operation, I always got confused about and forgot about g (cmd)d (isn't command d the default?). Also while on the topic, is there a way to 'make cursors at occurrence'? I guess now it'd just be s o <text-object> <esc>?

What is your plan to replace s for its current behaviour of "change character"? Or don't you ever use that?

t9md commented 7 years ago

👍 I think this is what I have been missing from occurrence, an easy way to visual select all occurrences rather than any other operation, I always got confused about and forgot about g (cmd)d (isn't command d the default?). Also while on the topic, is there a way to 'make cursors at occurrence'? I guess now it'd just be s o ?

I created set-cursor-at-start etc, operator in local experiment but removed. Here is it https://gist.github.com/t9md/c70f5d6528904601755422ae66124f26.

Why I removed is I thinks s o TARGET then escape is enough.

What is your plan to replace s for its current behaviour of "change character"? Or don't you ever use that?

I WILL replace default s with select operator by keymapSToSelect conditional keymap. It's opt-in config disabled by default, so not breaking default s unless explicitly enabled it. But I will of course enabled this in my config.

bogdan0083 commented 7 years ago

Also while on the topic, is there a way to 'make cursors at occurrence'? I guess now it'd just be s o <text-object> <esc> ?

@jackcasey we already discussed this question here: #890. Maybe that will be helpful :)

t9md commented 7 years ago

@jackcasey @bogdan0083

When you enable keymapSToSelect, what s can do is described in spec

vmp's spec is readable-dsl, you can think it as collection of example operation.