Jguer / yay

Yet another Yogurt - An AUR Helper written in Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Choose default editor for PKGBUILD

hograthm opened this issue · comments

How can i choose my preferred editor? By default, yay opens PKGBUILD's in vi.

Ok, so i find the way to choose editor. yay just read the $EDITOR environment variable:
https://github.com/Jguer/yay/blob/master/aur/utils.go#L16-L20
And exec it with PKGBUILD here:
https://github.com/Jguer/yay/blob/master/aur/result.go#L114-L118

Can we implement yaourt's choose editor option? Thus, the user can enter the name of the preferred program and edit PKGBUILD. If no arguments given - run all the way it works now. This should not be difficult.

commented

I find that $EDITOR is the most straightforward and default way of changing the editor.

Is that an argument like --editor ?

that could work, it can also do a yayrc or whatever to set editor

commented

I'll add the --editor arg for now.
Was waiting to test Go's plugin system in 1.8 for the config and git updates so they become something completely optional (but I've seen reports of the plugin system doubling binary sizes).

@Jguer I mean something like this.
2017-02-17-122934_swaygrab

commented

If $EDITOR or $VISUAL is not defined show the warning and the "Edit PKGBUILD with:" prompt.

Will add

That would be great. Thank you!