4 ms·
For those who edit with vi, you can use vi rather than emacs commands for editing and history: • for programs using readline, put in $HOME/.inputrc set edit
by kps 12y ago
For those who edit with vi, you can use vi rather than emacs commands for editing and history:
• for programs using readline, put in $HOME/.inputrc
set editing-mode vi
• for programs using libedit / editline, put in $HOME/.editrc
bind -v
- habitue 12y agoBut please, for the sake of the rest of us, don't set vi keys as the default on a server or a shared user account.
- cturner 12y agoFor the determined - the old O'Reilly korn shell book (turtle) has a solid primer for vi mode.
- beaumartinez 12y agoI'd do this, but the lack of indication of the editing mode you're in destroys how useful this'd be to me (I'd have to paranoidly hit Esc all the time).
- drifkin 12y agoI have zsh set up to indicate when I'm in command mode. Mostly based on this post: http://paulgoscicki.com/archives/2012/09/vi-mode-indicator-in-zsh-prompt/ http://paulgoscicki.com/archives/2012/09/vi-mode-indicator-i...
- larrybolt 12y agoI've had this in place for a very long time, since I use vim for most of my editing/coding, but recently I've took a look at emacs. I'm far from being anywhere near proficient in emacs and my main editor is still vim. Also I don't like the fact emacs uses meta so much since on a macbook pro laptop keyboard it isn't so obvious to reach, while I did set my caps-lock key to ESC/Control, and even my tab acts as hyper when combined with another keypress. I did however remove that binding and use the emacs commands in my terminal, because.. why not stay a fit flexible.. But that's my opinion of course.
- dorfsmay 12y agoEven if you join an existing session (eg: pairing) you can type "set -o vi", then type " set -o emacs" when you're done to return the shell to "normal" mode.
- voltagex_ 12y agoIt's really strange, I use the default (emacs?) bindings in Bash, but I edit with vim (if I don't have X to run Sublime...)