Set the environment variable VISUAL=kate (kate as an example)
Since now, everytime you want to edit a file as root, just type into the terminal: sudoedit /path/to/file
Pros:
- Safer
- The gui editor launches with the current user’s configuration.
(according to this blog post)

). Since i need this script for a PKGBUILD i’ll save it to ~/projects/git/PKGNAME/scriptname, but since i want to test it, i’ll also save it to /usr/bin/scriptname.