![]() ![]() I say this just as an FYI, however representative it is of the potential user base (which, AFAICT, is a minority that care about vim things like this). That xonsh doesn't have it and seems to be having some difficulty in getting it up and running, despite my not knowing how hard or easy it is to implement (again, sorry), is enough of a turn off for me. I know us "vim mode" people can be annoying like this, but I can confidently have it in my text editor (vim or otherwise), my sh-shell (bash/zsh) and my ipython shell. but I'm checking in with this project after being aware of it for a few years, and this is probably the reason why I won't be adopting it. So probably a rude and unhelpful comment. Which one you think is best for Xonsh?Īnd let me know if you'd like me to elaborate on any of the approaches. ![]() I would be willing to try for PR for any of the approaches. This way we can have some caching for, say, Git branch names, but still update Vi mode on every change regardless of it's position in a prompt. Then after each command we could partially template $PROMPT with non-dynamic fields, and fill in the dynamic ones on every intermediate update (like Vi Mode change). those that could change in between running 2 commands in a shell. Non-generic, but optimized solution would be by doing the same thing Fish does - creating a Vi mode sub-prompt and only updating it on mode change.Ī very generic but harder solution would be to implement annotating some of the $PROMPT_FIELDS fields as dynamic - i.e. So I think the most easy and generic solution would be just redrawing all prompts on every change of input_mode if $VI_MODE is set using the any-key+filter keybinding handler. ![]() And only if it doesn't produce any output, is the whole prompt being redrawn. Combined with a custom handler filter that checks for changes in vi_state.input_mode, it's possible to implement redrawing prompt(s) only when Vi mode actually changes, instead of each keystroke.įish optimizes this by only redrawing the leftmost part of the prompt, using fish_mode_prompt() function. Prompt Toolkit allows to set keybindings on Key.Any. I think it could be implemented more efficiently if done in core Xonsh. I tried xontrib-prompt-vi-mode which was caused very poor performance on my machine due to $UPDATE_PROMPT_ON_KEYPRESS = True. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |