help-nano
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: changing the default comment string for nano -- not possible


From: Benno Schulenberg
Subject: Re: changing the default comment string for nano -- not possible
Date: Thu, 8 Dec 2022 16:03:23 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2


Op 08-12-2022 om 02:43 schreef Calvin Smith:
i would like to know how you can change the comment character from # to
something else for a different programming language.  [...]

You set the comment character in the syntax file for the relevant language.

I try to put

comment "//"

in my .nanorc file, but the program just gives me an error and the default comment remains a #. What's the proper way to change this setting?

There is no way to change the default comment character _globally_ -- you
can only change the comment character per syntax.  As 'man nanorc' says:

  For each kind of file a separate syntax can be defined via the following
  commands:

  syntax name ["fileregex" ...]
        Start the definition of a syntax with this name.  All subsequent
        color and other such commands will be added to this syntax, until
        a new syntax command is encountered.

(And the 'comment' command is one of these subsequent commands.)

Benno

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]