Idea: Vim mode

It would be cool to bring some Vim functionalities to DOpus. Some other Vim users could suggest more, I'm not really an expert but I see its advantages.

Poorly-explained examples:

  1. Navigation with hjkl keys. I know this can already be achieved.
  2. Repeat last command with '.'.
  3. Go to start/end with 'gg'/'G'. Previous/next selected file with ctrl+o/ctrl+i. Scroll with ctrl+d and ctrl+u.
  4. Edit filenames in visual mode with 'v' (ctrl+v by default in Vim, but I think 'v' is better).
  5. Delete file with 'dd', delete a number of files with d+number+h/j/k/l.
  6. Copy with 'y', paste with 'p', but allowing number+h/j/k/l.

And so on, hope you get the idea. I know there is much to discuss about this, but I think there is a lot of potential here. Maybe some users already did something similar?

1 Like

I am an avid Vim (or vim-bindings) user and would love to have some navigation options to use DO without taking my hands of the homerow. Sure it's more of a comfort thing than productivity but it would be useful nonetheless even only for a context switch less when using my IDE and switching to DO.

Vim mode, however is a rather large undertaking I suppose, so maybe that could be a user extension by including some kind of scripting/extension language like for example suggest here: Built-in Lua scripting preferably with access to all of the UI and some more low level features. I THINK, the current Jscript implementation does not really offer that, or am I wrong?

In general, I'd be interested in an extension ecosystem. This is what made VIM, ATOM, VS Code, etc so successful. Maybe I am barking up the wrong tree and that has been tried and dismissed. Please disregard if that is the case.

Which things do you need exactly? There is already a scripting API, as well as plugin APIs, and we can add events to them if they make sense and aren't too much trouble to add. But "provide access to all of the UI and some more low level features" isn't detailed enough for us to know what you want.

Hi Leo,

thanks for your quick info. Maybe I had the wrong impression of the extension capabilities, and I am no expert, hence the vague language. I was under the impression that the plugin infrastructure is mostly for the viewer or filetypes in general, and the scripting seems aimed at creating powerful buttons or complex reaction to certain events, not really something running in the main event loop.

I'll take a deeper look at the scripting API, maybe a VIM mode is easily done with it. However, I am more of a user than developer :sweat_smile:

For a vim-like experience, we would need input to be modal, i.e. hjkl move the cursor key if no text is selected (or if in visual/command mode), I am not sure if that is currently possible. I believe most of the use cases are actually covered by the "select", "filter" and "command" features, hence there is no rush :).

On a more general note, I just thought a true extension ecosystem (with store, etc) would be nice since that would enable users to expand the capabilities of DO or simply share cool customizations easily. I do however realize that this is no small feat to implement/retrofit and then also maintain.

Probably not possible.

Well, if you want to fiddle with it, perhaps you could setup what you want via AutoHotkey script. You can have it react only on Opus window, and then setup your Vim-like shortcuts to send keys that Opus normally works with. For axample hjkl to send arrow keys (you can combine with modifier keys if you like), and key sequences could also be doable.