antiX-23 – based on Debian 12 Bookworm – ideas

Forum Forums antiX-development Development antiX-23 – based on Debian 12 Bookworm – ideas

  • This topic has 182 replies, 27 voices, and was last updated May 2-9:37 pm by Brian Masinick.
Viewing 3 posts - 181 through 183 (of 183 total)
  • Author
    Posts
  • #105861
    Member
    blur13
      Helpful
      Up
      0
      ::

      Try running “sudo visudo” and you’ll be using nano whether you like it or not. Editing the sudoers file is difficult enough for a novice without the added trial of doing it in the archaic nano.

      My point is that usually you edit text files, conf files, dot files, etc with whatever editor you want. But on occasion, there are no obvious ways to choose text editor, and sudo will default to its default editor, which is usually nano. Sudo visudo is one such example. I think viewing updated conf files presented while upgrading with apt is another. Having the default editor be micro, where intuitive commands such as ctrl+q work, would be beneficial for the majority of users.

      https://www.howtogeek.com/devops/how-to-use-micro-the-better-alternative-to-nano/

      (the article is three years old, so the part about not being on apt isnt true anymore. Micro is in the debian repos)

      • This reply was modified 16 hours, 52 minutes ago by blur13.
      • This reply was modified 16 hours, 45 minutes ago by blur13.
      #105864
      Moderator
      Brian Masinick
        Helpful
        Up
        0
        ::

        Regardless of what the setting happens to be, you can easily change it.

        For me, this worked:

        sudo update-alternatives –config editor

        Once I ran it, a list of the editors I have installed was listed (I have MANY of them); it was set to nano as the default, so I changed it to jmacs, which is the Joe/Jupp editor set to emacs emulation. Then I ran sudo visudo and it came up in Jmacs as expected.

        --
        Brian Masinick

        #105865
        Moderator
        Brian Masinick
          Helpful
          Up
          0
          ::

          Also, once you use sudo update-alternatives –config editor

          you can set (and optionally change) the EDITOR environment variable.
          I had it set to geany and I changed it to emacs by explicitly typing export EDITOR=emacs

          Then I ran sudo visudo and it came up in emacs as expected.

          So to summarize, it’s easy to put environment variables in .profile, .bashrc, or whatever configuration file you use at startup time.
          If it’s a shell variety such as sh, ksh, zsh, or bash, the syntax is as above export EDITOR={your-desired-editor}.
          As mentioned above, you can change it interactively as well, but that will only remain during the current shell session unless you
          add or update EDITOR in your personal configuration.

          --
          Brian Masinick

        Viewing 3 posts - 181 through 183 (of 183 total)
        • You must be logged in to reply to this topic.