<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Replace certain characters when typing (YAML)]]></title><description><![CDATA[<p dir="auto">Good evening,</p>
<p dir="auto">I just came across a problem in a tutorial (or the writer of the tutorial) where I imagine you can get a handle on it with notepad++.</p>
<p dir="auto">It’s about the reverse proxy “Traefik V2”. So here there are configuration files YAML files, which have a small peculiarity.</p>
<p dir="auto">There must not be used the superscript ( ’ ), but this character ( ` ). Unfortunately it is so that one must press here first the SHIFT key, then the actual key and afterwards still the blank.</p>
<p dir="auto">Is there a possibility to teach notepad++, if YAML is selected as language, that the apostrophe key ’ is pressed, but this character ` is generated.</p>
<p dir="auto">Thanks a lot</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/20471/replace-certain-characters-when-typing-yaml</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Jul 2026 16:02:51 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/20471.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 14 Dec 2020 18:19:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Replace certain characters when typing (YAML) on Mon, 14 Dec 2020 22:45:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a></p>
<p dir="auto">That was quite a lengthy process.<br />
First I read through the question.<br />
Then I tried to understand the question and what a possible solution might look like.<br />
Then I had coffee and cake and had to start all over again.<br />
In no time at all, 2 hours went by :-D<br />
In the end I did a copy and paste so as not to miss dinner.</p>
<p dir="auto">:-D</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60828</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60828</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 14 Dec 2020 22:45:49 GMT</pubDate></item><item><title><![CDATA[Reply to Replace certain characters when typing (YAML) on Mon, 14 Dec 2020 22:38:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a> ,</p>
<blockquote>
<p dir="auto">hack up something</p>
</blockquote>
<p dir="auto">Okay, not the best choice of words in the context of cats.</p>
<p dir="auto">I was thinking of the old paper-and-scissors “hack” algorithm: taking an already existing solution, copy/paste the simple guts in the right order, tweak a few things.  (I am guessing that Eko took one of his existing scripts, and started from that… though, with as simple as it was, maybe he really did start from scratch.)</p>
<p dir="auto">And yes, what <a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a> came up with followed my mental outline; I just haven’t had time recently to <s>hack</s> <strong>engineer</strong> such solutions when the questions are first posted.</p>
<p dir="auto"><em>… real life getting in the way of the forum, grumble, grumble …</em></p>
]]></description><link>https://community.notepad-plus-plus.org/post/60827</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60827</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 14 Dec 2020 22:38:43 GMT</pubDate></item><item><title><![CDATA[Reply to Replace certain characters when typing (YAML) on Mon, 14 Dec 2020 21:41:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/holger-hasenm%C3%BCller" aria-label="Profile: Holger-Hasenmüller">@<bdi>Holger-Hasenmüller</bdi></a></p>
<p dir="auto">a python script which would translate <code>'</code> to `<br />
But I’m not sure if this is the right way to go, as it means you<br />
can no longer use the single quote in yaml documents.</p>
<pre><code class="language-py">from Npp import editor, SCINTILLANOTIFICATION, MODIFICATIONFLAGS

def on_modify(args):
    if (editor.getLexerLanguage() == 'yaml' and 
        args['modificationType'] == MODIFICATIONFLAGS.INSERTCHECK):
        if "'" in args['text']:
            editor.changeInsertion(args['text'].replace("'", '`'))

editor.callbackSync(on_modify, [SCINTILLANOTIFICATION.MODIFIED])
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/60824</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60824</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 14 Dec 2020 21:41:37 GMT</pubDate></item><item><title><![CDATA[Reply to Replace certain characters when typing (YAML) on Mon, 14 Dec 2020 21:34:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a></p>
<p dir="auto">Oh, no.  If you already have a solution handy, post it ASAP.<br />
I’ve got better things to spend my time on than reinventing the wheel.<br />
:-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60823</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60823</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 14 Dec 2020 21:34:02 GMT</pubDate></item><item><title><![CDATA[Reply to Replace certain characters when typing (YAML) on Mon, 14 Dec 2020 21:32:26 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/alan-kilborn" aria-label="Profile: Alan-Kilborn">@<bdi>Alan-Kilborn</bdi></a></p>
<p dir="auto">because I didn’t want to spoil if you decided to go for it :-D</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60822</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60822</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 14 Dec 2020 21:32:26 GMT</pubDate></item><item><title><![CDATA[Reply to Replace certain characters when typing (YAML) on Mon, 14 Dec 2020 21:29:49 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ekopalypse" aria-label="Profile: Ekopalypse">@<bdi>Ekopalypse</bdi></a></p>
<p dir="auto">Nice one.  Not sure why you chose to “hide” it, but far from me to “unhide” it.  :-)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60821</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60821</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 14 Dec 2020 21:29:49 GMT</pubDate></item><item><title><![CDATA[Reply to Replace certain characters when typing (YAML) on Mon, 14 Dec 2020 21:26:51 GMT]]></title><description><![CDATA[<p dir="auto">hacks … tststs … never thought this day would come … but…</p>
<p dir="auto">;-D</p>
<pre><code>ZnJvbSBOcHAgaW1wb3J0IGVkaXRvciwgU0NJTlRJTExBTk9USUZJQ0FUSU9OLCBNT0RJRklDQVRJT05GTEFHUw0KDQpkZWYgb25fbW9kaWZ5KGFyZ3MpOg0KICAgIGlmIChlZGl0b3IuZ2V0TGV4ZXJMYW5ndWFnZSgpID09ICd5YW1sJyBhbmQgDQogICAgICAgIGFyZ3NbJ21vZGlmaWNhdGlvblR5cGUnXSA9PSBNT0RJRklDQVRJT05GTEFHUy5JTlNFUlRDSEVDSyk6DQogICAgICAgIGlmICInIiBpbiBhcmdzWyd0ZXh0J106DQogICAgICAgICAgICBlZGl0b3IuY2hhbmdlSW5zZXJ0aW9uKGFyZ3NbJ3RleHQnXS5yZXBsYWNlKCInIiwgJ2AnKSkNCg0KZWRpdG9yLmNhbGxiYWNrU3luYyhvbl9tb2RpZnksIFtTQ0lOVElMTEFOT1RJRklDQVRJT04uTU9ESUZJRURdKQ
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/60820</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60820</guid><dc:creator><![CDATA[Ekopalypse]]></dc:creator><pubDate>Mon, 14 Dec 2020 21:26:51 GMT</pubDate></item><item><title><![CDATA[Reply to Replace certain characters when typing (YAML) on Mon, 14 Dec 2020 21:06:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a> said in <a href="/post/60807">Replace certain characters when typing (YAML)</a>:</p>
<blockquote>
<p dir="auto">Those who are experts with the PythonScript plugin might be able to hack up something that will add a handler-function which verifies YAML and then makes that substitution automatically when the “wrong” character is typed.  But you would have to be willing to install the PythonScript plugin.</p>
</blockquote>
<p dir="auto">Ahem…</p>
<blockquote>
<p dir="auto">hack up something</p>
</blockquote>
<p dir="auto">That sounds like unfortunate act that my cat performs, on occasion.<br />
Pythonscript solutions are always professionally architected and developed solutions, not “hacks”.  :-)</p>
<p dir="auto">So this sounds like a job for the “char added” notification message from Scintilla, which could handle a replacement dynamically as the user types.</p>
<p dir="auto">But, what about pasting data – if the wrong character happens to be in a block of pasted data, when does it get corrected?<br />
Due to this, it seems like a fuller solution is needed than just an on-the-fly correction of one character.</p>
<p dir="auto">Still, nothing a script can’t handle, just need to know what the spec is, for whomever might try to write it.<br />
I don’t know if I can find time, I think I have to go see what my cat is up to in the other room…I hear something…</p>
<p dir="auto"><img src="/assets/uploads/files/1607979969890-a4362267-44a1-4825-84e9-c1c8e87fed77-image.png" alt="a4362267-44a1-4825-84e9-c1c8e87fed77-image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/60818</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60818</guid><dc:creator><![CDATA[Alan Kilborn]]></dc:creator><pubDate>Mon, 14 Dec 2020 21:06:11 GMT</pubDate></item><item><title><![CDATA[Reply to Replace certain characters when typing (YAML) on Mon, 14 Dec 2020 20:52:00 GMT]]></title><description><![CDATA[<p dir="auto">isnt it that autohotkey can handle such type of solution ?</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60816</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60816</guid><dc:creator><![CDATA[carypt]]></dc:creator><pubDate>Mon, 14 Dec 2020 20:52:00 GMT</pubDate></item><item><title><![CDATA[Reply to Replace certain characters when typing (YAML) on Mon, 14 Dec 2020 18:25:53 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/holger-hasenm%C3%BCller" aria-label="Profile: Holger-Hasenmüller">@<bdi>Holger-Hasenmüller</bdi></a> ,</p>
<p dir="auto">Sorry, not with any built-in Notepad++ tool.  Normally, the keyboard settings (what character gets typed when a specific key is pressed) are up to the OS, not to the application.</p>
<p dir="auto">Those who are experts with the PythonScript plugin might be able to hack up something that will add a handler-function which verifies YAML and then makes that substitution automatically when the “wrong” character is typed.  But you would have to be willing to install the PythonScript plugin.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/60807</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/60807</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Mon, 14 Dec 2020 18:25:53 GMT</pubDate></item></channel></rss>