Re: Select syntax colouring from within Nano?

Benno Schulenberg <[email protected]> Sat, 1 Aug 2020 10:06:14 +0200
Newsgroups gmane.editors.nano.general
Message-ID <[email protected]>
Hello Liam,

Op 31-07-2020 om 17:28 schreef Gretton, Liam:
> Firstly, congrats on the new 5.0 release. I really like the scroll bar!

Thanks!  :)

> Is there a way from within Nano to select a syntax colouring mode? I know I can
> force it by using -Y when starting the editor, but it would be useful to be able
> to do so if I've already opened a file that Nano hasn't recognised.

There is no way to select a syntax from inside nano.  It would require a
whole new menu, plus a keystroke, and maybe even a browser to only show
the available syntaxes...  That is too much.

There is a way to make nano change the used syntax: save the file under
a different name that has an extension that nano recognizes.

When nano does not apply the correct syntax to a file, one could do either:
1) amend the relevant syntax to recognize the type of file you're editing,
2) add or modify the first line so that nano recognizes it,
3) rename the file to have a standard extension.

Benno
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEv9AJBh5TUFKtDfIVDSjU0qCs6IQFAl8lInYACgkQDSjU0qCs
6IRWrQ/+OtzB9IXsMOUWlKS4CKomk8ueF5LVQgs+X5ALnRP4rCUkhWVZPeodLHB4
O6fjovkO1oqFJqmyWc4xJaO4RjWK21idOXN4SvCtBQxf62iDnVVgKez69AY/YAEK
wTw416D5qWWDHmDHvxWT1vDZ9gEdxlNITRA3Ngsi3H0TsnrUY2lwZ/F86Q0069ZG
E+WjKGvW6RKapnCoyiZxQ4uPK5ElR6LleYepItSWSmHUsCib+kSwQNXTlLXu2IKk
zzKbIx1ib+nI/zUFBa89xJwceisJskiOsIeZ3pji61FiEo06UPDac2Ih9DlHcwNu
YuQR1wk6HAOtHSHSlOSLCI8qGdZijePszRQTkXfGZddsiH2GEx/Fb8nGvgJpKSBv
Nxm9DAgm58VP3EgcdeayQK0gTGCpJ7KuSitmJe/KwrniIIxy3TYbd15IbzMBc4gO
od7/4kahKHQl8Gcz7PmDNhuL1gXloLGhRx5LUeI3JrLLXSS39otGD4XOAuFqtjmd
0SIp9n7ZA7khYHyIoxaGzH0tqB9tdevtt6iyYIhQHVqotlwXkx1p4qkK8NZ9C3ZK
3pbqPU+r02UWDmhpYX6/Y42nmcej/m5XFSrkmykhE6I0+CuAZeJU7072koF5ZfP0
wmuaKw6TUA2iHZE88X/vy51LpR6bSxNhMyObrgisTbw2RCEELlc=
=GEql
-----END PGP SIGNATURE-----