Thanks for the quick reply. After going through the code I ended up finding the methods you suggested and I am trying to figure out what would be the best way to manage key binding modes. After seeing how things are set up in RTADefaultInputMap I think this won't be too difficult to do. I had initially thought I would add new key bindings through menu items to build up a pallet of vim commands and figured some organized menus wouldn't be too annoying. I tested this by adding a new menu item for DeleteRestOfLine by making the menu item, key command, and attaching the RTextAreaEditorKit.DeleteRestOfLineAction but nothing happens when I press my key command. The good news is that I can still add my menus if I want, but it looks like I should be able to update all TextArea keys at once through setInputMap and setActionMap.
My initial though was to do as you have suggested and store an edit mode state then replace the entire inputMap for the desired text areas. Where do you think the edit mode state should be stored? It seems like I could add a mode field and then a setEditMode(int mode, int subMode) function in RTextAreaUI which would manage the swapping of input/action maps. Then it would be easy enough to make a new RTAVimInputMap class which could be in clojure or java but still compatible for RSTA.
As for the actions, could I extend RTextAreaEditorKit and add the additional vim command actions? Then the setMode(int mode, int subMode) function would handle reverting back to default when not in vi mode as well as toggling the different vi modes. Sorry to have so many questions, i am new to input and action maps.
It would be awesome to make some RTSA contributions especially since it has added so much functionality to my project (https://github.com/ghostandthemachine/overtone-sketchpad.git
) from the start;) I have to say, i was pretty surprised to see that there isn't already a vim project for JTextArea. For Java parent classes to be supported though I guess I wouldn't want to extend RTextAreaEditorKit but I could use it as a template to create new vi EditorKits.