Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

AutoHotkey SyntaxHighlight for Notepad++


  • Please log in to reply
56 replies to this topic
jNizM
  • Members
  • 928 posts
  • Last active: Jan 12 2018 09:23 AM
  • Joined: 01 Aug 2012
@Barney9:
open your userDefineLang and change the value for every <WordsStyle ... />
fontName="Source Code Pro"
<WordsStyle name="KEYWORDS1" fgColor="0060FF" bgColor="FFFFFF" fontName="Source Code Pro" fontStyle="0" nesting="0" />
than import new
[AHK] 1.1.27.04 x64 Unicode | [WIN] 10 Pro (Version 1709)
My GitHub Profile | Donations are appreciated if I could help you

guest3456
  • Members
  • 1704 posts
  • Last active: Nov 19 2015 11:58 AM
  • Joined: 10 Mar 2011
until RaptorX updates his lexer, i guess we are stuck with the UDL version

as for other themes, i have modified the AutoTheme.ahk file that jethrow created for RaptorX. if you followed jNizM's directions and put the userDefineLang_AHK.xml into the root notepad++ folder, then put this script in the same folder. it will create new files for every theme that is defined, based off of the Ruby color scheme. its not perfect, so you might need to tweak the colors for your liking. until RaptorX fixes his lexer, this is what we're stuck with
#NoEnv
SetBatchLines, -1
   
Loop, .\themes\*.xml {
   FileRead, FullXML, % file := A_LoopFileLongPath
   if RegExMatch( FullXML, "si)name=""ruby"".*?LexerType", RUBY ) ; if there is a Ruby Entry
      GoSub, CreateEntry
   else,
      NoEntry .= A_LoopFileLongPath "`n"
}
if ( NoEntry )
   MsgBox, 262208, Could Not Create:, % SubStr( NoEntry, 1, -1 )
Return


CreateEntry:
{
   RegExMatch( RUBY, "si)name=""DEFAULT"".*?bgColor=""\K.{6}", BGCOLOR )
   , RegExMatch( RUBY, "si)name=""IDENTIFIER"".*?fgColor=""\K.{6}", IDENTIFIER )
   , RegExMatch( RUBY, "si)name=""COMMENTLINE"".*?fgColor=""\K.{6}", COMMENT )
   , RegExMatch( RUBY, "si)name=""INSTRUCTION.*?fgColor=""\K.{6}", INSTRUCTION )
   , RegExMatch( RUBY, "si)name=""STRING"".*?fgColor=""\K.{6}", STRING )
   , RegExMatch( RUBY, "si)name=""NUMBER"".*?fgColor=""\K.{6}", NUMBER )
   , RegExMatch( RUBY, "si)name=""CLASS NAME"".*?fgColor=""\K.{6}", CLASS_NAME )
   , RegExMatch( RUBY, "si)name=""DEF NAME"".*?fgColor=""\K.{6}", REGEX )
   , RegExMatch( RUBY, "si)name=""REGEX"".*?fgColor=""\K.{6}", DEF_NAME )
   
   template =
   ( join`r`n
        <Styles>
            <WordsStyle name="DEFAULT" styleID="0" fgColor="%IDENTIFIER%" bgColor="%BGCOLOR%" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="COMMENTS" styleID="1" fgColor="%COMMENT%" bgColor="%BGCOLOR%" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="LINE COMMENTS" styleID="2" fgColor="%COMMENT%" bgColor="%BGCOLOR%" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="NUMBERS" styleID="3" fgColor="%NUMBER%" bgColor="%BGCOLOR%" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="KEYWORDS1" styleID="4" fgColor="%INSTRUCTION%" bgColor="%BGCOLOR%" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS2" styleID="5" fgColor="%REGEX%" bgColor="%BGCOLOR%" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS3" styleID="6" fgColor="%NUMBER%" bgColor="%BGCOLOR%" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS4" styleID="7" fgColor="%IDENTIFIER%" bgColor="%BGCOLOR%" fontName="" fontStyle="2" nesting="0" />
            <WordsStyle name="KEYWORDS5" styleID="8" fgColor="%INSTRUCTION%" bgColor="%BGCOLOR%" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS6" styleID="9" fgColor="ÞF_NAME%" bgColor="%BGCOLOR%" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS7" styleID="10" fgColor="%INSTRUCTION%" bgColor="%BGCOLOR%" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="KEYWORDS8" styleID="11" fgColor="%IDENTIFIER%" bgColor="%BGCOLOR%" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="OPERATORS" styleID="12" fgColor="%INSTRUCTION%" bgColor="%BGCOLOR%" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="FOLDER IN CODE1" styleID="13" fgColor="%IDENTIFIER%" bgColor="%BGCOLOR%" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="FOLDER IN CODE2" styleID="14" fgColor="%IDENTIFIER%" bgColor="%BGCOLOR%" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="FOLDER IN COMMENT" styleID="15" fgColor="%COMMENT%" bgColor="%BGCOLOR%" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS1" styleID="16" fgColor="%STRING%" bgColor="%BGCOLOR%" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS2" styleID="17" fgColor="%IDENTIFIER%" bgColor="%BGCOLOR%" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS3" styleID="18" fgColor="%IDENTIFIER%" bgColor="%BGCOLOR%" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS4" styleID="19" fgColor="%IDENTIFIER%" bgColor="%BGCOLOR%" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS5" styleID="20" fgColor="%IDENTIFIER%" bgColor="%BGCOLOR%" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS6" styleID="21" fgColor="%IDENTIFIER%" bgColor="%BGCOLOR%" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS7" styleID="22" fgColor="%IDENTIFIER%" bgColor="%BGCOLOR%" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS8" styleID="23" fgColor="%IDENTIFIER%" bgColor="%BGCOLOR%" fontName="" fontStyle="0" nesting="0" />
        </Styles>
   )
   FileRead, AHKUDL, % ahkudlfile := "userDefineLang_AHK.xml"
   NewXML := RegExReplace( AHKUDL, "sm`ai)<Styles>.*</Styles>", template)
   FileDelete, % SubStr(ahkudlfile, 1, -4) . SubStr(file, InStr(file, "\", false, 0) + 1) ; delete file if it already exists
   FileAppend, %NewXML%, % SubStr(ahkudlfile, 1, -4) . SubStr(file, InStr(file, "\", false, 0) + 1)
   Return
}


questioned
  • Members
  • 7 posts
  • Last active: Apr 15 2013 09:10 PM
  • Joined: 01 Apr 2013

I modified the Syntax Highlighting theme in this post along with a theme that comes w/ npp to produce this dark theme:

testi.gif

 

I made a post here for all those looking for a dark theme.

Thanks for this post!



guest3456
  • Members
  • 1704 posts
  • Last active: Nov 19 2015 11:58 AM
  • Joined: 10 Mar 2011
if you look at my post above, i posted a script which will generate colors for every theme

nwwkobe
  • Members
  • 1 posts
  • Last active: Apr 17 2013 08:32 AM
  • Joined: 16 Apr 2013

good!!!!!!!!!!!!!!!!!!!!!!!!



joedf
  • Administrators
  • 986 posts
  • AutoHotkey Foundation
  • Last active: Nov 02 2019 08:38 PM
  • Joined: 20 May 2012

dPCFDoa.png

:)


Why ahkscript.org? - autohotkey.com is outdated

jNizM
  • Members
  • 928 posts
  • Last active: Jan 12 2018 09:23 AM
  • Joined: 01 Aug 2012
Update:
- Added first Custom Themes
[AHK] 1.1.27.04 x64 Unicode | [WIN] 10 Pro (Version 1709)
My GitHub Profile | Donations are appreciated if I could help you

kiwijunglist
  • Members
  • 61 posts
  • Last active: Aug 14 2013 05:56 AM
  • Joined: 26 May 2009

I can't get debugger client to work - "Failed to connect to an active debugger client"

 

Spoiler

 

Problem Solved

[X] Start with closed socket (Firewall problems work around)

 

EDIT2: It worked once then stopped working again :( :(



tsr222
  • Members
  • 7 posts
  • Last active: Sep 03 2013 05:36 PM
  • Joined: 17 Nov 2012

Awesome job on all this, jNizM. Any chance of having highlighting for gLabels and vLabels?



fufz
  • Members
  • 1 posts
  • Last active: Sep 08 2013 02:43 AM
  • Joined: 04 Sep 2013

Hi all,

 

I'm just starting to dive into AHK since yesterday, but I'm already very impressed by the power and multitude of the possibilities.

 

In response to this thread:

I've followed instructions to enable syntaxhighlighting and autocomplete for AHK in N++ .

 

I can get it to work, but *only* after I first create a new document in a different language (Java f.i.), start typing there (autocomplete works immediately for that file), and then return to my existing .AHK file.

 

If I simply open N++, load my .AHK file as the only open doc, autocomplete will not start (code coloring does work right from the start btw).

 

I'm using the latest N++ update 6.4.5 for this.

 

Am I doing something wrong, or is this a known issue?

 

 



jNizM
  • Members
  • 928 posts
  • Last active: Jan 12 2018 09:23 AM
  • Joined: 01 Aug 2012
1. rightclick on exist .ahk file and open with npp --> with syntax

2. create new file with .ahk extension, than open with ahk --> with syntax

3. open new tab in npp and write ahk code --> no syntax
3.1 click on language and choose autohotkey --> with syntax
3.2 or save file as .ahk --> with syntax
[AHK] 1.1.27.04 x64 Unicode | [WIN] 10 Pro (Version 1709)
My GitHub Profile | Donations are appreciated if I could help you

r0b1n92
  • Members
  • 10 posts
  • Last active: Apr 30 2015 11:48 PM
  • Joined: 20 Oct 2013

it doesnt work anymore, the links



jNizM
  • Members
  • 928 posts
  • Last active: Jan 12 2018 09:23 AM
  • Joined: 01 Aug 2012
--> Setup Notepad++ for AutoHotkey
[AHK] 1.1.27.04 x64 Unicode | [WIN] 10 Pro (Version 1709)
My GitHub Profile | Donations are appreciated if I could help you

FusionFire
  • Members
  • 153 posts
  • Last active: Jan 24 2016 06:48 AM
  • Joined: 02 Dec 2011

I'm using AHK ANSI-32, followed the instructions in the first post.  Restarted AHK, Language > UserDefined is listed, when I load a AHK script, there is no syntax highlighting ? Shouldn't AHK syntax highlighting be listed under the H heading with the language list ?

 



jNizM
  • Members
  • 928 posts
  • Last active: Jan 12 2018 09:23 AM
  • Joined: 01 Aug 2012

unbenanntuqkt46fd7m.png


[AHK] 1.1.27.04 x64 Unicode | [WIN] 10 Pro (Version 1709)
My GitHub Profile | Donations are appreciated if I could help you