-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remember syntax highlighter #26
Comments
Try the defprefs branch. It reloads default preferences when you load a file without extension. |
That For the purposes of automatic preferences and syntax definitions, ne provides a mechanism for determining virtual extensions based on a buffer’s contents. If you create a
There may also be a ‘ .extensions ’ file in the global directory. If so, and your |
Hi!
At least python ist often startet with "/usr/bin/env python".
…On 15.02.2017 05:16, Todd Lewis wrote:
That |defprefs| branch does a bit more than that at the moment. This
feature is still being tested and is subject to revision before general
release. From the updated docs...
For the purposes of automatic preferences and syntax definitions, ne
provides a mechanism for determining virtual extensions based on a
buffer’s contents. If you create a |̃/.ne/.extensions| file, ne will
examine this file for certain extensions and corresponding patterns, and
if it finds a match with the current buffer it will act as if the
buffer’s name had that extension. Here’s an example |̃/.ne/.extensions| file:
|# Comments and blank lines are allowed. Only lines which match # this
regular expression are used: # ˆ[ \t]*(\w+)[ \t]*([0-9]*)[ \t]*(.+) #
These patterns match some common command interpreters. # Because we
don’t specify the optional number between the virtual # extension and
the pattern, they must match on the first line. sh ˆ#![\t
]*/.*/(bash|sh|ksh|zsh)\s* csh ˆ#![\t ]*/.*/(csh|tcsh)\s* pl ˆ#![\t
]*/.*/perl\b py ˆ#![\t ]*/.*/python[0-9]*\s* rb ˆ#![\t ]*/.*/ruby\s* #
These must match in the first 30 and 10 lines respectively to work. yaml
30 ˆ\+\+\+$ ini 10 ˆ\[\w+\]$ |
There may also be a ‘ .extensions ’ file in the global directory. If so,
and your |̃/.ne/.extensions| file fails to map a virtual extension, then
the one in the global directory will be consulted.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#26 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABQq2cEGQMH5t1dHx8DbjAZNC0GkrGOlks5rcnwPgaJpZM4L2TFC>.
|
This would be a great addition! |
Thanks for trying it out @pepa65. There have been a few changes if you're willing to test some more. The number is now required between the extension and the regex, but zero allows matching all the lines. The updated docs have better examples and should match invocations via the "env" command. The ^ in regex anchors the match to the beginning of the line, so |
:-) With that bit I meant to say I ran into problems copying your code, because my grep recognizes |
Also no colors when files have an extension I've found that NEWS talks about 3.0.2 but the opening screen after |
Sounds like you don't have your The |
The last 2 lines are:
I didn't properly install, I just ran the binary at |
Can you make your window a little taller? |
I did that when my last line was |
It seems just unable to use the |
Is your HOME environment variable set? |
Yes, I'm wondering, is there a way to run with DEBUG that would be helpful? |
You could try Just curious: what OS and distribution are you running? |
Ubuntu 16.04
|
And my complete
|
The problem wasn't obvious until I selected the above text of your You have a trailing space after each of your patterns. Or rather, you have a space as the last character of each of your patterns. With your |
Thanks for persisting with this! I had put them in when I read that the arguments had to be space-delimited, so I thought I'd make sure every part was surrounded by spaces... How silly. |
I've updated the By the way, in the |
Good call. I've never even seen a .csh file, but I'll swap the lines. :-) |
One needs to always change the syntaxhighlighting of a file without extension, e.g. bash scripts. It would be great if ne could rembember this.
The text was updated successfully, but these errors were encountered: