-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configurable keybindings #107
Comments
Looking at the suggested config I see that the only input is key/shortcut, while for modal editors it should also be a mode and some previous info like |
Modal editing can be done (sublime has a Vintage mode for vi-keybindings, based on this keymap and some (don't know enough here) smaller plugins). Lets do it like this: I currently work on a fork (https://github.com/msirringhaus/xi-term). I pack all keymap-related changes in a separate branch. You can then take a look at it and decide for yourself. |
Anyway, the best approach is to have this in xi-core itself |
Just fyi: My fork now has support for undo/redo, copy+paste, moving around + selections, and multiple cursors. |
@msirringhaus woah that's awesome!
I'll take a look at your branch as soon as possible (which should be Monday). |
Well, that branch has now "long" been merged into master. I think you can just look at HEAD and take what you like. Most of the really sublime-specific stuff happens in In those files all the parsing from user-input (be it prompt or keyboard shortcuts) to rust enum "Command" happens. Everything below that doesn't care how the commands are derived. But again, that editor has no modes (which is exactly what I want), so if you want to go in the direction of vim, you need to restructure of course. |
@msirringhaus would you mind opening a PR so we can discuss the changes easily? I have your branch checked out locally already but I can't comment directly on the code. |
open |
I would love to have a more sublime-text like terminal editor.
This project seems to drift more towards vim.
It might be possible to get both, if keybindings where completely user-configurable with a config-file like sublime does it.
Would you be interested in a pull request for something like this?
Goals:
Rough overview
Simple keybinding
More complex keybinding
This seems to be very flexible and I think would allow for a vim-like binding as well as sublime-like or maybe even emacs.
Code changes
For now, I would stick with the simple bindings first (although
args
is not hard to do with rust Enums):Event::Key(...)
Command
Command
to encompass all possible commandsHashMap<Event::Key, Command>
out of steps 1 and 2.This might not be the direction you want to go, which is fine. If so, I would simply create a hard fork and diverge, if thats ok with you.
The text was updated successfully, but these errors were encountered: