7 ms·
It's odd that his 2nd tip is "Learn Vim" and then goes on to describe all the bash/readline keystrokes in Emacs mode. $ set -o vi
by jeberle 16y ago
It's odd that his 2nd tip is "Learn Vim" and then goes on to describe all the bash/readline keystrokes in Emacs mode.
$ set -o vi
- callahad 16y agoI always found modal editing most valuable when editing and navigating through large bodies of text. I'm not quite sure that it makes sense on the command line, where you're rarely dealing with more than a few lines of text, and seldom need to rearrange those particular lines. Nevertheless, I switched to zsh on Sunday, and with it, vi keybindings. It's getting better, but it still doesn't feel quite right.
- tednaleid 16y agoI agree. I'm a vim user and never took to emacs, but the non-modal "emacs" keybindings feel more natural on the command line.
- spudlyo 16y agoDo you know anyone who actually does this? Even die-hard vi folks I know can't get used to modes on the command line.
- mcantor 16y agoI use vim almost pathologically, but I gave up on set -o vi. Since there's no visual indicator of which mode you're in, it's easy to make confusing mistakes and not the right feedback. It just wasn't worth it.
- cosbynator 16y agoYou can overcome the visual indicator (at least in zsh, not sure about bash): http://unix.stackexchange.com/questions/547/make-my-zsh-prompt-show-mode-in-vi-mode http://unix.stackexchange.com/questions/547/make-my-zsh-prom... I'm a recent convert. I don't like using control sequences for anything but screen management.
- gloob 16y agoSorry - I accidentally downvoted you.
- staunch 16y agoI always use set -o vi. It's in all my .bashrc files. Wish every CLI had it.
- jeberle 16y agoI can only speak for myself. Give it a day or two, and it will quickly become as transparent as your editing sessions. Once you cut over, you can forget about chording and arrow keys. Just one key: <Esc>.
- gnosis 16y agoI use vi mode in my shell all the time, and love it. It only took a day or so to get used to it. But then again, I am a die-hard vim user. What I'd really like, though, would be a vim mode for the shell, not just a vi mode. Then I could use some of vim's more advanced features, which would make the mode even more useful.
- bronson 16y agoThere's always Conque.
- sixtofour 16y agoIf you've set -o vi, then when you're editing a command line: esc to get into command mode. v (just the letter v) will open the current command line in a vi or vim session (depending on your default editor). Now vim to your heart's content. :wq will get you out of the vi/vim session, and execute whatever you did in your vi/vim session.
- mro 16y agoFor about a year or two, I've had set -o vi in my .bashrc. It is just so much easier when you work in Vim more than half the time! The modes still trip me up sometimes, but a quick <Esc> or <Ctrl+c> fixes that!
- clvv 16y agoI found myself using Emacs keybinding for line wise operation and movement in both vim and shell. It is just verbose to switch between editing modes sometimes.