<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Vscode on Janusworx</title><link>https://janusworx.com/tags/vscode/</link><description>Recent content in Vscode on Janusworx</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>feedback@janusworx.com (Mario Jason Braganza)</managingEditor><webMaster>feedback@janusworx.com (Mario Jason Braganza)</webMaster><copyright>© 2026, Mario Jason Braganza</copyright><lastBuildDate>Mon, 16 Aug 2021 15:18:10 +0530</lastBuildDate><atom:link href="https://janusworx.com/tags/vscode/index.xml" rel="self" type="application/rss+xml"/><item><title>Multiline Regex Search in VS Code</title><link>https://janusworx.com/work/multiline-regex-search-in-vs-code/</link><pubDate>Mon, 16 Aug 2021 15:18:10 +0530</pubDate><author>feedback@janusworx.com (Mario Jason Braganza)</author><guid>https://janusworx.com/work/multiline-regex-search-in-vs-code/</guid><description>&lt;p&gt;&lt;a href="https://janusworx.com/images/2021/kindle-notes.png" &gt;&lt;figure&gt;&lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 alt="picture of notes imported from an amazon kindle in vscode"
 src="https://janusworx.com/images/2021/kindle-notes.png"
 &gt;&lt;/figure&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;hr style='margin-left: auto; margin-right: auto;margin-bottom: 40px; width:100px; border: none; background-color:rgb(238, 238, 238); color: rgb(238, 238, 238); height: 1px;' /&gt; 
&lt;p&gt;This is a picture of my notes, when I import them in from the Kindle.&lt;br&gt;
And every time I have to corral them into some sort of structure or write a blog post, I needed to laboriously get rid of all the Kindle metadata with multiple searches (and replaces.)&lt;/p&gt;
&lt;p&gt;I mean these lines&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;==========
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Draft No. 4 (John McPhee)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;- Your Highlight on page 27 | location 406-407 | Added on Sunday, 15 August 2021 12:43:15&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;But having &lt;a href="https://janusworx.com/blog/python-regular-expressions-real-world-projects/" target="_blank" rel="noreferrer"&gt;learnt Regex&lt;/a&gt; about a year ago, I have been using it on and off and have come to appreciate the power it offers.&lt;br&gt;
And I’ve been increasingly trying to solve all of my text search issues using regex, everywhere.&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;With a recent book, I managed to &lt;a href="https://cb.janusworx.com/notice/A7nXyrNLRp2VvF2ceu" target="_blank" rel="noreferrer"&gt;use regex&lt;/a&gt; to get rid of single lines all at once.&lt;br&gt;
It still took me 3 sets of search and replaces though.&lt;br&gt;
So today, I got lazier and curiouser and wondered if I could do all three lines together.&lt;br&gt;
I was trying combinations of &lt;code&gt;/g&lt;/code&gt; and &lt;code&gt;/gs&lt;/code&gt; to somehow get the regex engine to span lines, but no dice.&lt;br&gt;
A bit of web surfing led me to &lt;a href="https://code.visualstudio.com/updates/v1_29#_multiline-search" target="_blank" rel="noreferrer"&gt;this post&lt;/a&gt; which told me that, all I needed to do was match newline literals &lt;code&gt;\n&lt;/code&gt;&lt;br&gt;
This led, to me tinkering and coming up with this search regex&lt;br&gt;
&lt;code&gt;==========[\n\s]D.*[\n\s]-.*&lt;/code&gt;&lt;br&gt;
Which led to …&lt;/p&gt;
&lt;hr style='margin-left: auto; margin-right: auto;margin-bottom: 40px; width:100px; border: none; background-color:rgb(238, 238, 238); color: rgb(238, 238, 238); height: 1px;' /&gt;
&lt;p&gt;&lt;a href="https://janusworx.com/images/2021/kindle-notes-2.png" &gt;&lt;figure&gt;&lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 alt="picture of notes imported from an amazon kindle in vscode with search results"
 src="https://janusworx.com/images/2021/kindle-notes-2.png"
 &gt;&lt;/figure&gt;
&lt;/a&gt;&lt;/p&gt;
&lt;hr style='margin-left: auto; margin-right: auto;margin-bottom: 40px; width:100px; border: none; background-color:rgb(238, 238, 238); color: rgb(238, 238, 238); height: 1px;' /&gt; 
&lt;p&gt;matching everything in one fell swoop!&lt;br&gt;
All hail the power of regex!&lt;/p&gt;
&lt;p&gt;P.S. Subscribe to my &lt;a href="https://janusworx.com/subscribe/" target="_blank" rel="noreferrer"&gt;mailing list&lt;/a&gt;!&lt;br&gt;
Forward these posts and letters to your friends and get them to subscribe!&lt;br&gt;
P.P.S. Feed my &lt;a href="https://www.amazon.in/hz/wishlist/ls/2QAUKHHAMOOVS?ref_=wl_share" target="_blank" rel="noreferrer"&gt;insatiable reading habit&lt;/a&gt;.&lt;/p&gt;
&lt;div class="footnotes" role="doc-endnotes"&gt;
&lt;hr&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;(emphasis on trying. I’m no regex genius)&amp;#160;&lt;a href="#fnref:1" class="footnote-backref" role="doc-backlink"&gt;&amp;#x21a9;&amp;#xfe0e;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</description></item><item><title>Programming, Day 3, Setting up VS Code to launch from the Command Line in OS X</title><link>https://janusworx.com/work/programming-day-3-vscode-command-line-osx/</link><pubDate>Tue, 05 Jun 2018 08:44:42 +0530</pubDate><author>feedback@janusworx.com (Mario Jason Braganza)</author><guid>https://janusworx.com/work/programming-day-3-vscode-command-line-osx/</guid><description>&lt;p&gt;Problem:&lt;br&gt;
I wanted to launch Microsoft’s Visual Studio Code from the command line at will.&lt;/p&gt;
&lt;!-- TEASER_END --&gt; 
&lt;p&gt;What I did:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Launch VS Code&lt;/li&gt;
&lt;li&gt;Hit cmd-shift-p (⌘-⇧-P)&lt;/li&gt;
&lt;li&gt;Begin to type Shell … and choose and execute “Shell Command: Install &amp;lsquo;code&amp;rsquo; command in PATH”&lt;/li&gt;
&lt;li&gt;Launch Terminal and check to see if VS Code launches by typing the &lt;code&gt;code&lt;/code&gt; command.&lt;/li&gt;
&lt;li&gt;Edit the &lt;code&gt;.bash_profile&lt;/code&gt; file in the home folder and change the &lt;code&gt;$EDITOR&lt;/code&gt; variable like so …&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;code&gt;# Setting Visual Studio Code as $EDITOR&lt;/code&gt;&lt;br&gt;
&lt;code&gt;export VISUAL=code&lt;/code&gt;&lt;br&gt;
&lt;code&gt;export EDITOR=&amp;quot;$VISUAL&amp;quot;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;And that should just about do it.&lt;/p&gt;
&lt;p&gt;Restart the terminal or source the bash_profile file for changes to take effect.&lt;/p&gt;</description></item></channel></rss>