tmux-plugins / tmux-open

Tmux key bindings for quick opening of a highlighted file or url
MIT License
643 stars 62 forks source link

Can't set other editor than vim #27

Closed guygadebois closed 7 years ago

guygadebois commented 7 years ago

Hey, thanks for this cool plugin! I'd really like to have files opening with emacs though! As written in the doc, I've tried to set $EDITOR in my .zshrc, and reload my terminal env (even restarting tmux) Tried both with "emacs" an "/usr/bin/emacs" but vim keeps opening when I hit C-o.

bruno- commented 7 years ago

Hmm.. it looks like the default EDITOR value, which is vi, is kicking in for you. Here's the relevant function https://github.com/tmux-plugins/tmux-open/blob/master/open.tmux#L28-L34 I'm surprised this is failing even after tmux restarts as there's really no magic to this..

guygadebois commented 7 years ago

Thank you for the pointer! I've finally spotted the issue: in my setup my shell emulator (konsole) opens directly tmux, and tmux then uses zsh underlying. So my $EDITOR env value was set for zsh, but not for tmux. I've added setenv EDITOR "emacs -nw" in my tmux.conf file and now it works!

Closing this issue as this had nothing to do with tmux-open