[Pharo-project] [ANN]: Vim Shortcuts for Nautilus (Proof-of-concept)
benjamin.vanryseghem.pharo at gmail.com
Sun Jul 8 07:48:47 EDT 2012
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
(KMRepository default categoryForName: #NautilusSourceCodeShortcuts) keymaps do: [:km |
(aBuilder shortcut: (km name, 'VIM') asSymbol)
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
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
> (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?
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pharo-dev