Hello Benno,
Lately, I was creating nano syntax highlighting files when I encountered a strange behavior. When I wrote:
syntax "test" "\.my_config$"
It correctly highlights the file /home/.my_config
, but then failed when I added an anchor to it:
syntax "test" "^\.my_config$"
I looked up the man page over and over again, but it
stated clearly that:
When nano is run, this syntax will be automatically activated if the current filename matches the extended regular _expression_ fileregex.
which means that it's the
filename that matches the regex.
In convention,
filename is the basename including the extension, which is not the same as the full path name. This is where I found frustrated, as nano is in fact matching the full pathname instead! Therefore, I strongly suggest clarifying what
filename actually means.
Thanks,
davidhcefx