4 ms·
I doubt their compelling features will be in OSS terminals any time soon. I’ve wanted a terminal that has a decent multi line editor for years, and there’s noth
by nicoburns 5y ago
I doubt their compelling features will be in OSS terminals any time soon. I’ve wanted a terminal that has a decent multi line editor for years, and there’s nothing out there.
- andrewzah 5y agoVim supports multiline editing and I'd imagine emacs does as well. In bash/zsh, <ctrl-x ctrl-e> opens up $EDITOR so you can use whatever you're accustomed to anyhow. Most of these features are already available if one spends a bit of time configuring their terminal/shell.
- kreetx 5y agoIs multiline editing popular/useful? Thus far, the only occasions I've seen it shown is when someone is demonstrating it.
- andrewzah 5y agoI'd say so, I find myself using it somewhat regularly. It's pretty easy in vim once you learn how to use visual block mode. That or using Sed to replace text in a selection or the entire file. http://paulrougieux.github.io/vim.html#Edit_multiple_lines http://paulrougieux.github.io/vim.html#Edit_multiple_lines
- mplanchard 5y agoI use it not infrequently for crafting big ol bash pipelines to put into scripts, specifically via emacs’ `shell` terminal emulator.
- tomxor 5y agoI use the visual-multi plugin [0] all day in vim/neovim. I don't like using tons of plugins but multi cursor with with selective invocation like the ctrl-d of sublime etc was the main thing I missed when moving to vim. (I use visual block mode too but it's not the same thing). https://github.com/mg979/vim-visual-multi.git https://github.com/mg979/vim-visual-multi.git
- nicoburns 5y agoIf you need to pass lots of arguments to a command it's super useful. Typically I don't do this because it's quite unwieldly with a standard readline editor, but I could if multiline editing was available!
- chaxor 5y agoPut `set -o vi` in your .bashrc That's all you need - you don't need a whole program that collects all of your information.
- jzm2k 5y agoThey are very useful! As a long time Vim user who switched to Kakoune[0] a while back, I didn't even realize I needed a good multiline cursor from my editor before it tried Kakoune. Highly recommend it! [0] https://kakoune.org/ https://kakoune.org/
- zhengt 5y agoWhile this can be done in zsh/bash, it takes investment to understand how to use multiline specifically. And then once you leave the terminal, the same keystroke does not do anything for you. One of Warp is that you don't have to think twice about it because it behaves similarly to text fields everywhere else on your computer. In the terminal, I often have the feeling that personal computing revolution from Xerox PARC & Apple Computer never happened.
- robryk 5y agoThis works in everything that uses libreadline to accept user input (unless the binary has specifically configured library differently iiuc), so should work in all shell-like interfaces. You can customize the shortcuts in inputrc, likewise, for all libreadline-using binaries. By default, readline tries to be emacs-like. You can ask it to be vi-like, or reconfigure lots of its shortcuts to be similar to an editor you like. To be fair, "escape to real editor" is not a thing you usually do in an editor, so that will remain special.
- achenet 5y agoThank you for sharing this tip ^_^
- mftb 5y agoThis stuff has been in the major shells for years, through excellent editor integration. For emacs and vi it's pretty much free. If you want to integrate with a different editor, it's totally doable. Most of the stuff sibling comment is referring to center around the feature: 'edit-and-execute-command' in bash. There is a similar incantation for zsh. I summon it with, 'ESC v' in both.
- nicoburns 5y agoIf I open an editor then my scrollback history isn't visible (or is in a separate window). Maybe vim and emacs offer this, but that's a big commitment just for a terminal. Warp has GUI-grade editing (mouse support, etc) with things like multiple cursors in a very nice interface.
- a5aAqU 5y agoCtrl-z will put Vim to sleep. You can look at the history and then type `fg` to bring the Vim back to the foreground.
- mftb 5y agoNormally I would pull the command I need multi-line editing for back from shell history, using the search operator '!' and print predicate ':p' before invoking bash's 'edit-and-execute-command' on it. I suppose while in the editor then I might need history again, but I can't recall it being an issue.
- NoGravitas 5y agoSo does Emacs. I kind of assume vim and neovim do too, these days.
- kreetx 5y agoIn emacs a shell is like a text buffer where you can simply search or move around as you would do in a text file. To get command history you'd just execute `history` and then ctrl+s (find) it, or move to it with the cursor.
- oblio 5y ago
- root_axis 5y agohaha well "decent" is in the eye of the beholder, I'd argue that vim is not only "decent" but by far the best general purpose IDE available.
- sitkack 5y agoTerminals are largely owned by graybeard maintainers that aren’t interested in innovating the Unix command line. This is not a difficult change.
- TheDong 5y ago> I’ve wanted a terminal that has a decent multi line editor for years, and there’s nothing out there. You can go the other direction. Install neovim. Run `:terminal`. optionally run `:help Terminal-mode` first so you can figure out how to get out.
- EuAndreh 5y agoIn Bash: C-x C-e This opens $EDITOR, and when you finish editing and close it, it runs the code.
- a5aAqU 5y ago> a terminal that has a decent multi line editor for years You can use ctrl-x ctrl-e in most terminals. https://unix.stackexchange.com/questions/85391/where-is-the-bash-feature-to-open-a-command-in-editor-documented https://unix.stackexchange.com/questions/85391/where-is-the-...
- anthk 5y ago>You can use ctrl-x ctrl-e in most terminals. Shells, not terminals.
- tasuki 5y agoI use pretty out of the box zsh with vi-mode and it... just works for multiline editing? I can simply move down and up with j/k...
- jart 5y agoIt depends how you define multiline but check out: https://github.com/jart/bestline https://github.com/jart/bestline
- chaxor 5y agoDoesn't `set -o vi` do this for you? Place it in .bashrc and you're good to go. It's great to use this with awesomewm for windows management, and vimium for browser control. Then you can develop in vim, bash in vim, browse in vim, and switch windows with vim. You don't have to learn 10 different, unintuitive, and ridiculous hotkeys for each different program or level.
- AdwinWhite 5y agoMultiline works out of box in fish shell. I'm not sure how terminal is relevant here.