VimArea - Day 7 - Complicated control schema
Alright, the controls of the Vim is indeed complicated. I am going to jot down each criteria and thought about it more.

Problems

The Repeat modifier

In fact I just discovered I can put numbers before each command or actions. For example, if I want to remove 10 lines below the cursor. One could type d10j, which means "delete, and the range is repeat the j command 10 times.". But this could go further. I could also type 10d10j. Which extends the meaning to "Do this action 10 times: delete, and the range is repeat the j command 10 times." i.e. removing 100 lines and below.

Thus gives the idea: before each movement and action. You can specify a modifier for the number of time to repeat. Although this is not hard to implement at first, but it is hard to modified the existing structure to support this type of input.

The difficulties is I need to implement this with the REDO / UNDO action. The problem is this repeat modifier can be before the action is opened. And the state recorded is after the state is opened. Thus there is no way for the recorder to know what the modifier is. I suspect the modifier does not need to be recorded. The record should be the change before and after only.

So if I could just find a way to get the modifier without intercepting other control handlers...

Sub-command dilemma

I could use y<movement> to yank a range of text. So the yank command itself support cursor movement. However, in VISUAL mode, the y command here is yank the selected range immediately, which in terms does not support movement. The code will be conflicted if both y is using the same procedure.

The cursor position after yank seemed to be always the first character of the yanked range.

Command bundling

Because the commands are bundled together, which means the item I have completed the VISUAL command. I would also complete various commands supported is VISUAL. Which might be bad or good depends on what commands are actually bundled with it and how frequent / important the command was used.

It's all about the cursor

Vim is good at letting user move the cursor to the desired position at a few keystrokes. More importantly, eliminate the need for using a mouse. ( too lazy to move my hand from keyboard. )

I am also thinking to implement blog's main editor with some degree of mouse-elimination.


That's it for the progress report. I am still struggling for the best way to implement the controls.

Articles in the series


Useful Links

Project home | Demo

Tag(s): vim BotanJS
Profile picture
斟酌 鵬兄
Tue Mar 22 2016 10:39:28 GMT+0000 (Coordinated Universal Time)
Last modified: Wed Apr 06 2016 19:50:10 GMT+0000 (Coordinated Universal Time)
Comments
No comments here.
Do you even comment?
website: 
Not a valid website
Invalid email format
Please enter your email
*Name: 
Please enter a name
Submit
抱歉,Google Recaptcha 服務被牆掉了,所以不能回覆了