If I were you, I would have put all the VIM shortcut in one class, instead of putting them around but :)

For the attachment, the solution could be to attach simultaneously several shortcuts category.
Like that, you could add yours in a specific context, and remove them.

An ugly solution right now could be to duplicate all the NautilusSourceCodeShortcuts entries, and to switch between NautilusSourceCodeShortcuts and VIMShortcuts.

A kind of hack could be:

AbstractNautilusUI class>>buildInsertModeKeymappingsOn: aBuilder
<keymap>
(KMRepository default categoryForName: #NautilusSourceCodeShortcuts) keymaps do: [:km |
(aBuilder shortcut: (km name, 'VIM') asSymbol)
category: VimInsertModeShortcuts
default: km shortcut
do: km action ].

(aBuilder shortcut: #commandMode) 
category: #NautilusSourceCodeShortcuts "#VimInsertModeShortcuts"
default: Character escape asShortcut
do: [ :target |
Editor dumbbellCursor: true.
target sourceTextArea changed.
target sourceTextArea attachKeymapCategory: #VimCommandModeShortcuts ].

It's kind of a hack, but like that you ensure to have the same shortcuts in the midtime

Ben





On Jul 8, 2012, at 3:13 AM, Sean P. DeNigris wrote:


Sean P. DeNigris wrote

- how do I remove an individual shortcut or shortcut category from a
morph? (so I can toggle the command/insert mode shortcuts)


I'm having trouble toggling insert mode... Right now I have
AbstractNautilusUI class>>buildInsertModeKeymappingsOn: aBuilder
<keymap>

(aBuilder shortcut: #commandMode)
category: #NautilusSourceCodeShortcuts "#VimInsertModeShortcuts"
default: Character escape asShortcut
do: [ :target |
Editor dumbbellCursor: true.
target sourceTextArea changed.
target sourceTextArea attachKeymapCategory: #VimCommandModeShortcuts ].

The problem is that:
* I think I have to put these shortcuts into #NautilusSourceCodeShortcuts to
have them load without overriding anything
* If I don't put them in their own category (i.e. #VimInsertModeShortcuts),
I don't know how to remove them when entering command mode (I only see a way
to remove whole categories)

Guille, Ben - are those assumptions correct and how should I proceed?

Thanks,
Sean

--
View this message in context: http://forum.world.st/ANN-Vim-Shortcuts-for-Nautilus-Proof-of-concept-tp4638987p4639034.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.