sindresorhus / pure

Pretty, minimal and fast ZSH prompt
MIT License
13.22k stars 977 forks source link

How do I disable VI mode? #560

Closed ubershmekel closed 4 years ago

ubershmekel commented 4 years ago

I'm on a mac and it seems Option-⬅ triggers VI mode. I just wanted to skip between different parts of the command I'm editing.

In general there's no documentation describing this vi mode, how to use it. I'd personally just like to remove it. Is there a way to disable the VI mode or at least change the keys that trigger it?

mafredri commented 4 years ago

Hi, Pure doesn't enable VI-mode in any way, we simply support displaying VI-mode status, when it's activated by the user. If you look through your Zsh config, you should find a statement like bindkey -v somewhere, try removing that.

ubershmekel commented 4 years ago

EDIT 2 - I found the solution to the problem in these stackoverflow links: https://apple.stackexchange.com/questions/400564/how-do-you-disable-vi-like-behavior-in-macos-terminal/400600 https://stackoverflow.com/questions/12382499/looking-for-altleftarrowkey-solution-in-zsh

EDIT - nope, it's still broken with \033e and \033b. It enters into some VI mode, and I'm super confused. CONTROL-U stops working, and I have to hit a to start editing the command line again. Back to the drawing board.

...Please ignore the text that follows :( ...

There was no bindkey -v to be found. I found that in bash as well, my option-left shortcut wasn't skipping words backwards. Turns out that I had a setting in the terminal app that caused option-left to enter VI mode.

To fix this on macOS 10.15.6, I opened the terminal app's preferences, and had to set the bindings.

Option-left = \033b
Option-right = \033e

The problem was that Option-right was set to \033f 🤔

Screen Shot 2020-09-02 at 5 22 55 PM

I wrote this solution in https://stackoverflow.com/questions/81272/how-to-move-the-cursor-word-by-word-in-the-os-x-terminal/63715149#63715149 as well.

I guess pure is in the clear here so I'll close the issue. Thank you!