zsh set editor code example
Example 1: zsh default editor
# Examples are for vim, but you can change the path
# to whatever you want
# e.g: /usr/bin/code for visual studio code
# In bash:
echo "export EDITOR=/usr/bin/vim" >> ~/.bashrc
echo "export VISUAL=/usr/bin/vim" >> ~/.bashrc
# In zsh:
echo "export EDITOR=/usr/bin/vim" >> ~/.zshrc
echo "export VISUAL=/usr/bin/vim" >> ~/.zshrc
# In ksh:
echo "export EDITOR=/usr/bin/vim" >> ~/.kshrc
echo "export VISUAL=/usr/bin/vim" >> ~/.kshrc
Example 2: zsh edit
vim ~/.zshrc