It is also worth considering the difference between pressing EnterEnter and pressing EE on the file that you want to edit
export VISUAL=vim;
export EDITOR=vim;
Though this solution might work when you press EE on the file but pressing EnterEnter may vary.