Shortcuts.xml and Link Color

rdyornot
2013-05-11
2013-05-12
  • rdyornot

    rdyornot - 2013-05-11

    I am trying to change the link to a color other than black so they stand out a bit more. So far I have found a few references to the following macros:

    The following macro definitions allow changing these colours:

    <Macro name="setHotBackground" Ctrl="yes" Alt="yes" Shift="no" Key="100">
    <Action type="0" message="2411" wParam="1" lParam=your_colour sParam=""/>
    </Macro>

    <Macro name="setHotForeground" Ctrl="yes" Alt="yes" Shift="no" Key="100">
    <Action type="0" message="2410" wParam="1" lParam=your_colour sParam=""/>
    </Macro>

    However - I can not enter them into shortcuts.xml, whenever I make a change to the file NP++ replaces it with an empty xml file. I've made sure I was the owner of the file, I've run NP++ as administrator. I've entered the macros in the AppData/Roaming location as well as the install directory. I've reinstalled NP++ telling it, alternatively, to use the AppData dir and not to use it. No matter what I do it overwrites the shortcuts.xml file.

    1. How can I manually edit the shortcuts.xml file?
    2. Is there another, perhaps easier, way to change the formatting of hyperlinks?
    3. Can I suggest that "Normal Text" be included with the other languages that can be customized with the style configurator?

    Thanks for any help!
    RC

     
  • THEVENOT Guy

    THEVENOT Guy - 2013-05-12

    Hi rdyornot,

    In order to achieve the modification of your configuration file "Shortcuts.xml", you just have to :

    • Close Notepad++, if necessary.

    • Open your file "shortcuts.xml" with an other editor ( Notepad, Wordpad, Writer... ) and NOT with Notepad++ ! ( VERY important ! )

    • At the end of the section <Macros>, add, for example, the six lines below :

        <Macro name="My Internet Addresses colours (Red/Yellow)" Ctrl="yes" Alt="yes" Shift="no" Key="75">
            <Action type="0" message="2411" wParam="1" lParam="6356991" sParam="" />
            <Action type="0" message="2410" wParam="1" lParam="255" sParam="" />
        </Macro>
        <Macro name="DEFAULT Internet Addresses colours (Blue/White)" Ctrl="yes" Alt="yes" Shift="yes" Key="75">
            <Action type="0" message="2411" wParam="1" lParam="16777215" sParam="" />
            <Action type="0" message="2410" wParam="1" lParam="16711680" sParam="" />
        </Macro>
    
    • Save the changes of "Shortcuts.xml" and restart Notepad++.

    • In macro menu, under existing macros, there are, normally, TWO new macros to set/restore the colour of Internet links !

    • Use the shortcut ALT + CTRL + K, to change the default colours

    • Use the shortcut ALT + CTRL SHIFT + K, to restore the default colours

    • Just move your mouse over an Internet link and enjoy :)

    The value of colour, passed to lParam, is given by the expression :

    65536 * B + 256 * G + R where B, G and R represents a quantity of primary colours Blue, Green and Red, between 0 and 255.

    So the value, of composite three colours, belongs to the interval [0 - 16777215]. Of course, you can change these values as you like.

    In the two macros above, I used shortcuts with the key letter K ( Scan code 75 after parameter 'Key'), because it looks like the CTRL + K of Microsoft Word and Excel to insert an Internet link !

    May be, you'll prefer an other shorcut. So, if you give me an e-mail address, I can send you a small .xls file, in compatibility mode ( Excel 97-2003), which contains the different scan codes, used by Notepad++, for a standard keyboard.

    Of course, my proposition is for everyone, which needs that list :)

    Just, note two points :

    • I'm French and work with a french keyboard ( of course! ) So, for few keys, you'll need to find out the scan code by yourself !

    • This list is almost exhaustive ! ( I just can't find out the right key, on my french keyboard, for the scan code 189 !! and the scan code 223, although not listed in the shorcuts Manager of N++, is sent if I press the '§!' key, on a french keyboard ! )

    I hope these explanations will be useful to you !

    My personal e-mail address : guy.038@wanadoo.fr

    Cheers,

    guy038

     
    Last edit: THEVENOT Guy 2013-05-12

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks