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:
- Be able to simply copy&paste a sublime-keybindings file (of course most actions are not yet supported).
- Generate one for the current state as well and make default
- Safe those and user-defined overwrites (future step) under XDG-paths
- Make all possible commands available via keybindings or Command prompt
Rough overview
Simple keybinding
{ "keys": ["ctrl+q"], "command": "exit" },
More complex keybinding
{ "keys": ["left"], "command": "move", "args": {"by": "characters", "forward": false} },
{ "keys": ["ctrl+left"], "command": "move", "args": {"by": "words", "forward": false} },
{ "keys": ["shift+left"], "command": "move", "args": {"by": "characters", "forward": false, "extend": true} },
{ "keys": ["ctrl+shift+left"], "command": "move", "args": {"by": "words", "forward": false, "extend": true} },
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):
- Have a function that parses the value of "keys" to map to
Event::Key(...)
- Have a function that parses the value of "command" to enum
Command
- Enhance
Command to encompass all possible commands
- Create a global
HashMap<Event::Key, Command> out of steps 1 and 2.
- Rewrite the match-statements in Tui, Editor and Command to all map to the same functions
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.
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
argsis not hard to do with rust Enums):Event::Key(...)CommandCommandto 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.