How to change editor used by php artisan tinker

158 views Asked by At

When you type edit in laravel's tinker shell, it pops up a nano editor for you to type your commands in. The thing is I'm more comfortable with vim and I'm wondering if there's a way to change the default editor from nano to vim.

I already tried export EDITOR=vim in my .bashrc (and .zshrc just incase), to no avail.

2

There are 2 answers

1
Praise Dare On

You also need to modify your .bash_profile to contain export EDITOR=vim. It seems tinker uses that file rather than your .bashrc or .zshrc.

0
l3lackheart On

I only append export EDITOR=vim in my .zshrc and it works!

I think you forgot to run source ~/.zshrc after the changes.