npizzigati / Vimish

Vim mode for the OmegaT computer-aided translation tool
GNU General Public License v3.0
4 stars 1 forks source link

Holding shift and moving the cursor does not select text #4

Closed equipematou closed 1 year ago

equipematou commented 1 year ago

Hey Nick, sometimes I drop the cursor somewhere, hold shift, and use the arrows to select text. For some reason this is not working. Is that something that might be added? Thanks!

npizzigati commented 1 year ago

Thanks for trying out the plugin!

About the issue, holding shift and using arrow keys to select would be surprising behavior for a Vim mode, so it's not really on the roadmap. However, you should be able to select with the arrow keys now in the more recent versions of the plugin, including the latest version (after entering into visual mode). Does this help at all?

equipematou commented 1 year ago

Thanks. I was thinking the plugin was something of a hybrid as the OmegaT cmd/ctl keys work, e.g. cmd-m to insert a machine translation, and the shift-arrow select might be part of that. I was the one who reported on the list that the Mac cmd-? OmegaT keys did not work; I think that led to the 0.2.4 release. No problem, I understand the plugin better now.

I don't use visual mode, so I had to look into it to understand how it works. It appears that only character-visual (v) mode works? In any case that is useful to select in visual mode and y to copy the highlighted text. I will have to use it more to see how it works in the overall flow of working with segments, but it looks promising.

The only other problem I have had with it is that in so many instances a single esc does not work to exit into normal cmd mode; if there is a pop-up window open with an option of any sort (typically a glossary pop-up), the first escape only closes the pop-up window and leaves it in insert mode. I understand that is unavoidable, but I must either watch the cursor or habitually tap esc a couple of times to be sure it is out of insert mode. It is a matter of adapting to the environment.

Anyway, especially in a second editing pass the vim mode is quite useful to be able to move around and operate from the keyboard. Thanks for releasing it!

npizzigati commented 1 year ago

Thanks. I was thinking the plugin was something of a hybrid as the OmegaT cmd/ctl keys work, e.g. cmd-m to insert a machine translation, and the shift-arrow select might be part of that. I was the one who reported on the list that the Mac cmd-? OmegaT keys did not work; I think that led to the 0.2.4 release. No problem, I understand the plugin better now.

Ah, I see. Yes, Vimish is a mix of Vim and OmegaT shortcuts. It definitely leans to the Vim side, but the intention is to sort of get the best of both worlds.

It appears that only character-visual (v) mode works?

Yes. Since there are no newlines in an OmegaT segment, visual-line mode ("V") in Vimish would be of very limited use, and I decided not to implement it.

In any case that is useful to select in visual mode and y to copy the highlighted text.

This is where the fun of Vim comes in. All the motions available in normal mode are also available in visual mode, so it becomes really easy to do neat things like: Select the current word that the cursor is in using (viw), select all text inside parentheses (vi)), select the next three words (v3w), select to a particular letter (vt[letter]), and a million other things.

The only other problem I have had with it is that in so many instances a single esc does not work to exit into normal cmd mode; if there is a pop-up window open with an option of any sort (typically a glossary pop-up), the first escape only closes the pop-up window and leaves it in insert mode.

An imperfect solution here might be to map another key (or key chord) to the escape key (as described in the readme). That way you could switch back and forth between normal and insert modes while keeping the glossary popup open.

npizzigati commented 1 year ago

I'm going to close this issue, but please feel free to open another one with any other questions or problems you have.