I made myself a "sheme" that will highlight 6502 instructions, and put comments in another color. Too bad when I open a ".asm" file Notepad ++ recognize it as a x386 asm file instead and I have to manually select my 6502 sheme every time. How can I default to 6502 asm ?
I can find this a bit annoying in TextPad as well, since syntax coloring is based only on the file extension, and I've got a lot of .asm files containing assembly language for many different processors. I don't know if Notepad++ has some kind of content-awareness, but it sure would be a nice feature.
You probably have to modify langs.xml in the Notepad++ installation directory and modify the "ext" here to something else:
Code:
<Language name="asm" ext="asm" commentLine=";" commentStart="" commentEnd="">
Then add "asm" as an extension to your own language definition in userDefineLang.xml.
Personally I use .s for 6502 sources so this isn't a problem for me.
Too bad files don't have meta-information as on the Mac with HFS. There the text editor can keep track of what language you want to view the file in, without modifying the file's normal data.
blargg wrote:
Too bad files don't have meta-information as on the Mac with HFS.
Files on NTFS have meta-information. It's just that the flavors of meta-information seen in NTFS, HFS, and HTTP don't easily map well one to another, and the common Linux file system (ext4) doesn't have it at all. That's why Vim has
modelines and Emacs has
file variables: you stick the meta-information used by your editor in a comment.
I have just about all the highlighting selected for my user defined language but I can't seem to figure out how to give special highlighting to labels. For example, I would like it to give special highlighting to the entire line before a colon appears. How do you guys do it?
Re: raydempsey
Answer from stackoverflow on this very question...
"what you need is not supported by User Defined Languages feature of Notepad++. As commenter already said, you can try for example SynWrite editor if you want to achieve this. Programmers with enough interest can also prepare their own language highlighters for Notepad++ where highlighting of tokens is determined procedurally, what gives virtually unlimited possibilities. (See Notepad++ sources, all built-in languages are done this way.) But UDL's were designed with simplicity in mind, therefore their functionality is limited."
http://stackoverflow.com/questions/2342 ... ht-a-label
thefox wrote:
Then add "asm" as an extension to your own language definition in userDefineLang.xml.
If I remember correctly, this is all I had to, I never modified any other files. Maybe the user file has higher priority in the case of extension conflicts.
Yes this is what I did too. Although I used .650 to separate it from other assembly languages.
I have another problem on Notepad++ though. On the latest version you can define characters and prefixes for literals (so you can have highlighted hexadecimal literals like #$C5) but it doesn't work for letters F and E if they are at the end. For example $0E and $0F only highlights up to the zero.