Are you familiar with the $EDITOR and/or $VISUAL environment variables?
Text-based (i.e., CLI) applications which spawn a text editor should respect/support them as much as possible.
Are you familiar with the $EDITOR and/or $VISUAL environment variables?
Text-based (i.e., CLI) applications which spawn a text editor should respect/support them as much as possible.
The options that I see for using $EDITOR are: (1) simply ignore the line option for non-vim editors, (2) add implementation for specific editors, each with their own "jump to line" argument if it exists, or (3) add an additional command line argument that passes args/flags on to the editor. Option (3) seems best to me but I do worry about the number of supported flags - it is quite a lot already! More seriously, this option could be a vector for malicious code execution.
Thanks again, really appreciate the feedback! I'd love to hear your thoughts.
[EDIT: add comment on malicious code execution]
Or you always invoke the editor as "$EDITOR +$LINE $FILE" and if someone wants to use an editor that uses different command line arguments, they have to write a wrapper shell script to rewrite it.
vim, nano, and emacs support this syntax. micro uses "micro ${FILE}:${LINE}", and subl (Mac command line tool for Sublime Text) uses it as well.