<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Editor on blog.iankulin.com</title><link>https://blog.iankulin.com/tags/editor/</link><description>Recent content in Editor on blog.iankulin.com</description><generator>Hugo</generator><language>en-AU</language><lastBuildDate>Wed, 14 Dec 2022 00:00:00 +0000</lastBuildDate><atom:link href="https://blog.iankulin.com/tags/editor/index.xml" rel="self" type="application/rss+xml"/><item><title>Who is Emmet?</title><link>https://blog.iankulin.com/who-is-emmet/</link><pubDate>Wed, 14 Dec 2022 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/who-is-emmet/</guid><description>&lt;p&gt;&lt;a href="https://www.piqsels.com/en/public-domain-photo-ircsa"&gt;&lt;img src="https://blog.iankulin.com/images/css-hacks.jpg" width="728" alt=""&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I knew there was some magical way of entering all the the &lt;HTML&gt; boilerplate in Visual Studio Code as I&amp;rsquo;d seen it happen in several videos, and assumed is was some sort of macro expansion thing in the editor. Fast forward a few blog post readings and youtube viewings and I keep seeing tangential references to someone called Emmet. Turns out they&amp;rsquo;re the same thing, and it&amp;rsquo;s pretty cool.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s not a new idea to have functionality in code editors to insert snippets of code. &lt;a href="https://docs.emmet.io/"&gt;Emmet&lt;/a&gt; goes a bit further than that - and like many tools made by programmers for programmers it goes way to technical to the point where you need to memorise ridiculous amounts of combos to to some awesome stuff (I&amp;rsquo;m looking at you whoever made it possible to use vi commands in VS Code). Nevertheless, Emmet is extremely handy even at my n00b level.&lt;/p&gt;
&lt;p&gt;The key thing to know, is that it borrows from the CSS selector syntax. So if you want to insert &lt;code&gt;&amp;lt;div&amp;gt;&amp;lt;/div&amp;gt;&lt;/code&gt; you enter &lt;code&gt;div&lt;/code&gt; and press tab.&lt;/p&gt;
&lt;p&gt;Want a div with a class named &amp;ldquo;container&amp;rdquo;?&lt;/p&gt;
&lt;p&gt;&lt;code&gt;div.container&lt;/code&gt; becomes &lt;code&gt;&amp;lt;div class=&amp;quot;container&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The same trick works for an id - Enter&lt;/p&gt;
&lt;p&gt;&lt;code&gt;div#emmet&lt;/code&gt; becomes &lt;code&gt;&amp;lt;div id=&amp;quot;emmet&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Would you like a div, with a heading inside? The greater than sign nests elements, so &lt;code&gt;div&amp;gt;h4&lt;/code&gt; becomes:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;lt;div&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;lt;h4&amp;gt;&amp;lt;/h4&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;lt;div&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you&amp;rsquo;d like some text up in there, try div&amp;gt;h4{Hello world}&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;lt;div&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;lt;h4&amp;gt;Hello world&amp;lt;/h4&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;lt;/div&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can repeat things numbers of times, so to create a list with three items, try &lt;code&gt;ul&amp;gt;li*3&lt;/code&gt; to get:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;lt;ul&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;lt;li&amp;gt;&amp;lt;/li&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;lt;li&amp;gt;&amp;lt;/li&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; &amp;lt;li&amp;gt;&amp;lt;/li&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&amp;lt;/ul&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That&amp;rsquo;s about as complex as I&amp;rsquo;d want to get, though of course it gets more complex. It&amp;rsquo;s a super handy feature that quickly becomes second nature.&lt;/p&gt;</description></item><item><title>Vim</title><link>https://blog.iankulin.com/vim/</link><pubDate>Wed, 10 Aug 2022 00:00:00 +0000</pubDate><guid>https://blog.iankulin.com/vim/</guid><description>&lt;img src="https://blog.iankulin.com/images/1-_bwvjb2jzuuzyxgxm6xwqq.png" width="191" alt=""&gt;
&lt;p&gt;I&amp;rsquo;ve been working through the &lt;a href="https://missing.csail.mit.edu/"&gt;Missing Semester&lt;/a&gt; lectures from MIT, and recently completed the lecture about the &lt;a href="https://github.com/vim/vim"&gt;Vim editor&lt;/a&gt;. Vim is a test editor, called from the command line, and optimised for programming - in the sense that it assumes most of the use of the editor is navigating around a big text file making small changes rather than entering large amount of test.&lt;/p&gt;
&lt;p&gt;It uses simple, short key presses (as opposed to mouse movements or using menus or toolbars) to achieve things. This makes it highly efficient for good typists who know all the commands, and slightly incomprehensible to those who do not. An additional level of complexity is the idea of modes. Vim has several modes, the main ones being:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Normal - for navigating around and making those little edits. To get into this mode press the esc key&lt;/li&gt;
&lt;li&gt;Insert - for entering text - ie the mode you&amp;rsquo;d assume you were in when opening an editor and not that you would have to press the letter &amp;lsquo;i&amp;rsquo; to make that happen&lt;/li&gt;
&lt;li&gt;Command - to run commands - like saving or closing VIM To get into this mode press the &amp;lsquo;:&amp;rsquo; key&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Apart from &lt;a href="https://missing.csail.mit.edu/2020/editors/"&gt;this lecture&lt;/a&gt; here are many good guides for learning VIM, a couple I&amp;rsquo;ve looked at are &lt;a href="https://opensource.com/article/19/3/getting-started-vim"&gt;this one from OpenSource.com&lt;/a&gt; and &lt;a href="https://web.stanford.edu/class/cs107/resources/vim.html"&gt;this one from Stanford&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Even though I will never invest the time to become a power user of Vim, it&amp;rsquo;s available most places you&amp;rsquo;ll be using the command line, so the basics are a requirement for any programmer. Plus if you&amp;rsquo;re ever hired by a film production company to advise on a computer hacking scene, you&amp;rsquo;ll need it to scroll though some syntax highlighted Javascript.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.vimcheatsheet.com/"&gt;&lt;img src="https://blog.iankulin.com/images/iigrixvxp5ayn9ox7gr1dfi_rhlrotwllscafjjqjeq.webp" alt=""&gt;&lt;/a&gt;
&lt;em&gt;Great cheat sheet from &lt;a href="https://www.vimcheatsheet.com/"&gt;https://www.vimcheatsheet.com/&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;</description></item></channel></rss>