Skip to content
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

vi mode #6

Closed
MovingtoMars opened this issue Jul 10, 2016 · 11 comments
Closed

vi mode #6

MovingtoMars opened this issue Jul 10, 2016 · 11 comments

Comments

@MovingtoMars
Copy link
Owner

https://www.gnu.org/software/bash/manual/html_node/Readline-vi-Mode.html

Not sure how desired this feature is.

@iamcodemaker
Copy link
Contributor

I suspect this will require more than just custom key mappings. Some behavior is different depending on if insert mode or command mode is active. I suppose this could be accounted for with different mappings for different modes.

@iamcodemaker
Copy link
Contributor

I believe implementing this would require detection of Esc key presses. Opened ticki/termion#43.

@iamcodemaker
Copy link
Contributor

Started some work on this here https://github.com/iamcodemaker/liner/tree/vi. Depends on redox-os/termion#45. Going to be some time before it is finished.

@iamcodemaker
Copy link
Contributor

So I'm not sure how to proceed with this. I am almost done with the implementation, and so far the diff is more than 3000 lines. What is the best way to get this merged? I could submit the whole thing at once, but that seems like too much to review at once. I could also submit bits and pieces a little at a time and merge into a staging branch or something. What's the best way to proceed here?

@iamcodemaker
Copy link
Contributor

Just looked at the changes again, if you exclude tests, the diff comes in at about 1k lines. Still very large.

@MovingtoMars
Copy link
Owner Author

Wow, thanks for all that work! You can just submit a pull request and I'll get around to it sometime soon. IMO the changes are too connected to merge seperately.

@iamcodemaker
Copy link
Contributor

Actually, I think I can split some of these changes out. There is a set of changes to abstract key handling out from the Editor object. I can submit that separately. Stand by.

@iamcodemaker
Copy link
Contributor

iamcodemaker commented Jan 3, 2017

#24 contains the first step here. It decouples key press handling from the Editor object. Going forward I can split individual vim features up into chunks and they can be merged to a staging branch. I am still working on refactoring the vim bindings.

@iamcodemaker
Copy link
Contributor

I think my branch is in a good spot. Undo support needs to be improved. But I am going to spend some time refactoring it into incremental changes so that it can be reviewed in chunks. This will also have the benefit of erasing WIP designs, making me look smarter 😄

There may also need to be some additional changes in the future. With the current design, state is not tracked between calls to read_line(). This makes vi mode unable to repeat the last editing command between calls to read_line(). Not terribly difficult to fix, but it will require some thought.

@iamcodemaker
Copy link
Contributor

This can be closed now.

@MovingtoMars
Copy link
Owner Author

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants