2

joe (Joe's Own Editor) manual outlines the command syntax like so:

joe [global-options] [ [local-options] filename ]...

My question is, how do I demarcate global-options from local-options?

An example:

joe --wordwrap -nobackup file1 file2 file3

Even though I placed --wordwrap (to turn wordwrap off), and -nobackup (to turn backup file creation off), they only apply to the first file. The subsequent files, file2 and file3, still will have word wrap on, and backup files will be created for them if edited and saved.

Of course I could do this:

joe --wordwrap -nobackup file1 --wordwrap -nobackup file2 --wordwrap -nobackup file3

.. but that is cumbersome, and would imply there wouldn't be global-options at all. I could also edit /etc/joe/joerc and /etc/joe/ftyperc (or copy them to the user's home dir, and make the overriding edits there) to turn word wrap and backups off for all files, but on systems where I'm only visiting (and that might have, say, a shared /home/ubuntu user/homedir, say, rather than individual user accounts/homedirs), I would rather not make permanent changes to the system tools that other users might use, yet it would be handy to be able to enter the editor args on the command line (perhaps even via a keyboard macro) without having to repeat the args for each file.

So is there a way to have global-options in joe on the command line for parameters that can be also used as local-options?

("Why don't you use Vi[m] or Emacs instead?" Because I've never found vi[m] intuitive, I have forgotten the Emacs chords which I had mastered in the 90's, and joe does the job nicely, so why not? :-)

1 Answer 1

3

Whether an option is global or local is a property of the option, not something you can control. In the documentation, there are two separate lists of options: the first is the list of global options, the second the list of local options. Global options include options like asis, assume_color, etc. and affect the overall behaviour of the editor (e.g. your terminal's support for colour doesn't depend on the file you're editing). Local options include autoindent, encoding etc. and can be set automatically based on a file's extension.

I don't see a way of applying a local option to all files on the command-line, apart from using shell expansion.

1
  • I was afraid that would be the case – thanks for confirming it! Since I'd like to use the command line method only on server instances whose configs I don't wish to modify, the only workaround to speed up command entry is to create a local keyboard macro to push out the options (and which I can then use repeatedly if editing more than one file at a time).
    – Ville
    Jan 10, 2017 at 22:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .