vi like interface for rappid

4 min read Original article ↗
================================================ vi like interface for rappid ================================================ :Author: jyf :Date: 2013-10-10 .. contents:: index links ========= rappid --------- http://www.jointjs.com/rappid modes ======= first of all, the new features shouldnt confused normal user and those who havnt used vi so i think those new features should be actived when user press a shortkey explicitly. these could corresponds with vi's mode concept so maybe we should call the 3 modes as A. normal mode B. expert mode C. master mode or A. user mode B. geek mode C. nerd mode so when user press some key that actived mode B, he could use some vi-like key to move the selected object. like **hjkl**, or even **y** for copy object and **p** for paste it. and then he could use the classic key **:** for enter the final commandline mode which would , just like vi does, show him an input(begin with : just like the vi does again) at bottom, and he could put commands like **object1 100 200 move** so that that object1 could be move to (100,200) BTW, emacs like could also works but many keybinding would conflict with browser B mode keybindings ===================== also we call it expert mode or geek mode in this mode, user could do these jobs object creating ----------------- shapes has its type id, like 1-20, so people could press **1n** for creating a new type 1 object in the current canvas. **n** is for **new** object selecting ------------------- press **f** and show all the object in the canvas with its own object-id, user could then continue typing the object-id until it could lock to the target object, if you guys ever used vimperator_, i think you might understand what effects it is object moving ------------------ once the object be selected, user could press **hjkl** for moving object left,down, up,right and i think the moving speed should increase by time object modifying on size ------------------------------ user could press **HJKL** for increasing the object size on the 4 directions: left, down,up,right. i think it would let vi user feel nature object rotating ----------------------------- i recommend **[** and **]** for rotating deasil and widdershins. object text modifying ----------------------------- press **i** and you got the input focus on the selected object, if you have done writting, press **esc** object color modifying ----------------------------- press **#** and follow the color expression, it could support #fff or #ffeecc, i think a **<enter>** for commiting the color changing would be better object deleting --------------------------- press **do**, delete object object arrow start point selecting ------------------------------------- i recommend **A**, i notice that most shape type only have 1 arrow start point, so this feature is not common. it shouldnt use **a**, and for A, it still means Arrow ,after you press the key, those arrow start point should show their number just like object selecting. so the really key pressing might be **A2**, that mean user select the number 2 arrow start point on the selected object object arrow point to selecting -------------------------------------- i recommend **a**, and when you press the key, we need the object selecting style again, so user could easily choose the target object, and after that, user could use **hjkl** to choose the precise point on the target object object arrow path deleting ------------------------------------ select any object, no matter is it the arrow start or point to, press **da**, if the object only have one path, delete it, done the job, if it has many path, shows an arrow start point selecting style ui. so the really key pressing might be **da2**, which means to delete the number 2 arrow path of the selected object .. _vimperator: http://www.vimperator.org/vimperator