4 ms·
i don't see the point of adding vi input mode to the emulator when we have it inside bash with `set -o vi`
by kelsey9876543 3y ago
i don't see the point of adding vi input mode to the emulator when we have it inside bash with `set -o vi`
- Gualdrapo 3y agoAs it supports Windows, I guess it would be useful for them
- kelsey9876543 3y agobash runs on windows
- akdkfe223 3y agoFeels a little bit misleading to say that honestly. It runs on windows in what is effectively a chroot/jail/container esque monstrosity. I personally consider that to qualify as a totally separate userspace and therefore not the same operating system as one would assume when you use the term windows without any additional qualifiers.
- miloignis 3y agoAre you referring to WSL/2? The msys2 / Git Bash integration is more integrated with Windows then how I interpret your description.
- drbaba 3y agoMany interpreters don’t use Readline (e.g. IPython and Zsh), and enabling inconsistent Vi keybinsings in each one can be a bit annoying. From that perspective, adding it to the terminal seems a possibly easier way to get it “everywhere”?
- mhitza 3y agoPossibly more universal, but there are also tools like rlwrap [1] that adds readline support to programs that don't have it. From the docs apparently the readline library ships a similar tool ootb nowadays but I haven't tried that and just noticed now when I wanted to share the rlwrap link. [1] https://github.com/hanslub42/rlwrap https://github.com/hanslub42/rlwrap
- williadc 3y agoIPython absolutely uses readline
- drbaba 3y agoNot anymore. Since IPython v5 (5+ years ago?), readline was replaced with prompt_toolkit. EDIT: Here’s an official source: https://ipython.readthedocs.io/en/stable/whatsnew/version5.html#ipython-5-0 https://ipython.readthedocs.io/en/stable/whatsnew/version5.h...
- trapnii 3y agoTo be fair, the vi input mode (or modal input modes) in Contour are way more than simply doing `set -o vi` in bash. You cannot compare those two. The reason why I implemented modal input modes (vi mode) in Contour is, that I noticed Tilix [1] is having vi input modes and people seemed to like it, I wonder if it might be useful to me personally as well, especially since I'm a heavy VIM user, I asked myself if it might make sense to have in a terminal. So let's get it in. I was surprised how much it became part of my daily live, in fact, there's no need to grab the mouse at all when using Contour. You press Ctrl+Shift+Space (configurable) to enter normal mode and move the cursor just like in vim (way beyond the basic support that Alacritty implemented). Especially paired with the indicator statusline support, when showing this one permanently (you can also change the color of that statusline), it became one of the first-class features for me on why I like Contour (not just because I am developing it). Fun things to do (especially when shell integration is enabled): - `yim`: to yank the text in between two markers (that is your command output) - `%`: jump to matching bracket, good when having cat'ed a long json file and you want to quickly browse around - you can also rectangular select like in vim, and then press either p (includes LF) or <S-p> which joins the multiline clipboard text into a single line (removing LF's), that payed off a lot for output like `git status` and wanting to operate on parts of the output (files e.g.) Have a look at the still young website's documentation here: https://contour-terminal.org/input-modes/#supported-text-objects https://contour-terminal.org/input-modes/#supported-text-obj... for a more complete look of what you can do with the keyboard (normal mode) :) [1] https://github.com/thestinger/termite/ https://github.com/thestinger/termite/