Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2

Author Topic: [outdated] New Notepad++ raw file highlighting mode!  (Read 19494 times)

Kazimuth

  • Bay Watcher
  • [ARTIFICIAL_HIVEABLE]
    • View Profile
    • github
[outdated] New Notepad++ raw file highlighting mode!
« on: August 28, 2013, 04:48:55 pm »

This project is out of date! Go to the updated version here:

http://www.bay12forums.com/smf/index.php?topic=158324.0

(thanks Sirmaril!)



I made a highlighting mode for Notepad++!

A sample:
Spoiler (click to show/hide)

The download: https://www.dropbox.com/s/bmor3vsz5nf6c1k/df_raw_lang_npp_0.2.zip

To install:
Download the archive and unzip it somewhere.
Start up NPP, open the languages menu, and select 'Define your language':
Spoiler (click to show/hide)
In the language dialog, select 'Import':
Spoiler (click to show/hide)
Select the extracted xml file and hit 'Open':
Spoiler (click to show/hide)
Reboot notepad. Now, you should see something like this:
Spoiler (click to show/hide)
Select that option when you're working with a raw file and boom, highlighting!

It's supposed to highlight only tokens built in to DF, so as to still work with total-conversion mods. If something is highlighted and shouldn't be, or isn't and should, either you're missing a bracket somewhere or I missed some tokens; if you can't find the problem, post in the thread and I'll try to fix it.

Original post:
Spoiler (click to show/hide)
« Last Edit: June 21, 2017, 09:10:42 pm by Kazimuth »
Logged
I'm not sure this was a good idea

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Notepad++ raw file highlighting mode
« Reply #1 on: August 28, 2013, 07:49:55 pm »

Ah, I've been using another one for a while, and this one looks much better...

smirk

  • Bay Watcher
    • View Profile
Re: Notepad++ raw file highlighting mode
« Reply #2 on: September 01, 2013, 12:19:14 pm »

Excellent! There is another of these floating around (in the Mods and Utilities List somewhere), but it's several years and quite a few versions out of date. Giving this one a try now.
Logged
When i think of toady i think of a toad hopping arround on a keyboard
also
he should stay out of the light it will dry out his skin
his moist amphibian skin
.

crazyjake56

  • Bay Watcher
    • View Profile
Re: Notepad++ raw file highlighting mode
« Reply #3 on: September 01, 2013, 12:30:09 pm »


This really is amazing.
« Last Edit: September 01, 2013, 02:39:01 pm by crazyjake56 »
Logged

Etherdrinker

  • Bay Watcher
  • ☼Etherdrink☼
    • View Profile
Re: New Notepad++ raw file highlighting mode!
« Reply #4 on: October 29, 2013, 10:05:09 am »

Nice! added to my Notepad ++ :3

Proudnerd

  • Bay Watcher
  • [LIKES_FIGHTING] [CAFFEINE _DEPENDANT]
    • View Profile
    • My writing profile
Re: New Notepad++ raw file highlighting mode!
« Reply #5 on: October 29, 2013, 10:27:32 am »

Looks excellent thanks. I've been struggling along with just the original notepad. guess id better try something else.
Logged
"Oi Urdim! Monom just died, can ye go fetch his old hand from the pile o' severed limbs?"
"Eh how am I supposed to know which one's his?"
"I dunno, just grab the one that stinks the least and throw it in."

Lolfail0009

  • Bay Watcher
  • [PROGRAMMER:C#] [PROGRAMMER:C++] [PRONOUNS:SHE]
    • View Profile
Re: New Notepad++ raw file highlighting mode!
« Reply #6 on: February 03, 2014, 08:27:55 pm »

Sadly, it doesn't seem to highlight anything for me, even after following all the steps; is there a problem with newer versions of NP++?

Raidau

  • Bay Watcher
    • View Profile
Re: New Notepad++ raw file highlighting mode!
« Reply #7 on: February 04, 2014, 06:53:31 am »

Sadly, it doesn't seem to highlight anything for me, even after following all the steps; is there a problem with newer versions of NP++?

I use latest version and it works
Logged
Marital status manipulator
Custom item descriprions
Natural Balance Mod (2013-2015) development suspended...

SalmonGod

  • Bay Watcher
  • Nyarrr
    • View Profile
Re: New Notepad++ raw file highlighting mode!
« Reply #8 on: February 05, 2014, 01:37:38 pm »

Thanks for this!
Logged
In the land of twilight, under the moon
We dance for the idiots
As the end will come so soon
In the land of twilight

Maybe people should love for the sake of loving, and not with all of these optimization conditions.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: New Notepad++ raw file highlighting mode!
« Reply #9 on: November 15, 2014, 02:10:36 am »

This is awfully old and nobody seems to have made a new one in the meantime; may I put it up on github to keep it updated for the future?

Abadrausar

  • Bay Watcher
  • empowering ideas
    • View Profile
    • ♫♪♀HDFPS♂♪♫
Re: New Notepad++ raw file highlighting mode!
« Reply #10 on: November 15, 2014, 06:41:04 am »

This is awfully old and nobody seems to have made a new one in the meantime; may I put it up on github to keep it updated for the future?

Nice idea!
You could even put here the git URL if you do, so everybody can find your maintained version from the original post.

Another good idea will be a changelog somewhere...

Thanks for giving away your updates to the community  :)
Logged
::: Humble Dwarf Fortress Publishing System ♫♪♀HDFPS♂♪♫ Mods Push Published in DFFD are auto updated in local Players Catalog :::

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: New Notepad++ raw file highlighting mode!
« Reply #11 on: November 15, 2014, 05:16:57 pm »

Great work Kazimuth!

I tweaked this a little bit to add in some of the keywords new to 0.40 such as GAIT and VISION_ARC (I'm sure I missed some), and messed with the delimiters a tad to make keywords highlight properly inside compound tags.  One additional format is that single-quoted strings (i.e., tiles) appear in red.

After much banging of head on desk, there doesn't appear to be any way to use code-folding without an explicit "close" to the structure.  Had it worked, you'd be able to click a "-" next to a [CREATURE: and hide it while you're working on a different one.  DF raws "close" a structure when another one at the same level or higher opens, but Notepad++ expects that things might be nested.  Anyone know how to build an "open only" structure in Notepad++?

I also couldn't figure out how to recognize color tokens, but that's a lot less important.

Hope this is helpful to the modders out there.

Spoiler: Language definition (click to show/hide)
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: New Notepad++ raw file highlighting mode!
« Reply #12 on: November 16, 2014, 04:27:56 pm »

Bethesda .ini files are raw-like in nesting syntax and work just fine that way... Python also has no explicit end, only whitespace change.

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: New Notepad++ raw file highlighting mode!
« Reply #13 on: November 17, 2014, 12:14:16 pm »

Bethesda .ini files are raw-like in nesting syntax and work just fine that way... Python also has no explicit end, only whitespace change.
I was asking if there's a way to introduce code-folding with no explicit end.  There's no doubt that the raws themselves process correctly.

This is all that Notepad++ has for its Python language description:
Code: [Select]
        <Language name="python" ext="py pyw" commentLine="#">
            <Keywords name="instre1">and as assert break class continue def del elif else except exec False finally for from global if import in is lambda None not or pass print raise return triple True try while with yield</Keywords>
        </Language>
which is not even close to the same format as a user-defined language.  It just sort of magically knows where to fold the code.  The definition for XML is even more sparse, so it looks like a lot of this is hardcoded into Notepad++ :(

I'll see what happens if I try to put the DF format into this format.  Hopefully nothing bursts into flames.

Edit: As I thought, inserting a new language into the standard list doesn't work.  Would be nice to find a way to work in code-folding since it would help new modders realize when for example the syndrome begins and ends.
« Last Edit: November 17, 2014, 12:25:11 pm by Dirst »
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

Kaelem Gaen

  • Bay Watcher
  • And then it appeared the most terrifying creature
    • View Profile
Re: New Notepad++ raw file highlighting mode!
« Reply #14 on: November 20, 2014, 03:11:08 pm »

I too would be interested in a RAW/Init/D-init highlighting thing that kept up to date with changes in DF.
Pages: [1] 2