4 ms·
This works in ZSH as well, I also didn't know about it so this is definitely going to save me a lot of keystrokes. Although I already had some of the regular sh
by bittersweet 17y ago
This works in ZSH as well, I also didn't know about it so this is definitely going to save me a lot of keystrokes. Although I already had some of the regular shortcuts memorized (like ctrl-a goes to start of the line) being able to use one set of keybindings is great!
- sundarurfriend 17y agoAnd in Zsh, you could even have it show the current Vi mode (Insert or Command) in the prompt. I don't have my .zshrc handy, I'll try to get the command once I get the .zshrc.
- nuclear_eclipse 17y agoWow, that's been my biggest trouble with vi mode for years, and I've been using Zsh for a long time and didn't know it could do that. I would be eternally grateful if you could post the solution here...
- sundarurfriend 17y agoI'm at work after a long vacation, so got access to my .zshrc. Here's the relevant part: #It starts in insert mode export VIMODE=INS function zle-keymap-select { VIMODE="${${KEYMAP/vicmd/CMD}/(main|viins)/INS}" zle reset-prompt } zle -N zle-keymap-select bindkey -v I use Oh My Zsh, but as far as I know this should work without it too. Wish HN had a notify-on-reply system like Reddit's orangered. Would you see this? Would you not? Would I miss eternal gratefulness from a fellow HN citizen? Oh, how I wish I knew the answer!
- nuclear_eclipse 17y agoMaybe you won't even see this ;) , but it unfortunately doesn't seem to work on my vanilla Zsh. Perhaps I'll look into OMZ a bit and see if things work out that way. Thanks anyways :)