<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: jamesc40</title>
    <description>The latest articles on DEV Community by jamesc40 (@jamesc40).</description>
    <link>https://dev.to/jamesc40</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F840724%2F649e1c83-f415-4a6a-babd-e62982837c1f.png</url>
      <title>DEV Community: jamesc40</title>
      <link>https://dev.to/jamesc40</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jamesc40"/>
    <language>en</language>
    <item>
      <title>Vim re-binds that don't suck</title>
      <dc:creator>jamesc40</dc:creator>
      <pubDate>Thu, 09 Jun 2022 20:52:48 +0000</pubDate>
      <link>https://dev.to/jamesc40/vim-re-binds-that-dont-suck-24bk</link>
      <guid>https://dev.to/jamesc40/vim-re-binds-that-dont-suck-24bk</guid>
      <description>&lt;p&gt;On my &lt;a href="https://dev.to/jamesc40/why-new-programmers-should-be-learning-to-do-so-using-vim-3op3"&gt;last post&lt;/a&gt; I spoke about some basic keybindings that allow you to navigate Vim. I would now like to visit a few  more keybindings to incorporate into your workflow and some ideas on what to change them to. &lt;/p&gt;

&lt;p&gt;One of the first things I would advice a new user to rebind is ESC. You'll be hitting this key a lot and it by default is difficult to reach especially from the home row &lt;/p&gt;

&lt;p&gt;&lt;code&gt;imap jj &amp;lt;Esc&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Another popular rebind for escape is tab which you can do in your keyboard settings if you're on mac.&lt;/p&gt;

&lt;p&gt;Additionally when working with multiple windows in vim the default key-bind can be tough to remember for windows so I would recommend these: &lt;br&gt;
&lt;code&gt;&lt;br&gt;
nnoremap &amp;lt;C-h&amp;gt; &amp;lt;C-w&amp;gt;h&lt;br&gt;
nnoremap &amp;lt;C-j&amp;gt; &amp;lt;C-w&amp;gt;j&lt;br&gt;
nnoremap &amp;lt;C-k&amp;gt; &amp;lt;C-w&amp;gt;k&lt;br&gt;
nnoremap &amp;lt;C-l&amp;gt; &amp;lt;C-w&amp;gt;l&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This removes the need to hit &lt;strong&gt;Control AND W&lt;/strong&gt; to change when changing windows.&lt;/p&gt;

&lt;p&gt;You should also consider changing the default behavior for tabs.&lt;br&gt;
&lt;code&gt;&lt;br&gt;
set softtabstop=2          &lt;br&gt;
set shiftwidth=2&lt;br&gt;
set tabstop=2 &lt;br&gt;
set expandtab&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
By default vim sets these as 4 and it looks a little strange coming from another Text Editor.&lt;/p&gt;

&lt;p&gt;Lastly by default the 'p' which is put does not save to the system clipboard and does not use the system clipboard. To change this add this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;set clipboard=unnamedplus&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;These are some of the key-binds that helped smooth my transition to Vim. When first starting out it can seem overwhelming but by taking it one step at a time and finding ways to improve your workflow without getting discouraged is extremely rewarding. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>Why new programmers should be using Vim</title>
      <dc:creator>jamesc40</dc:creator>
      <pubDate>Tue, 10 May 2022 17:30:40 +0000</pubDate>
      <link>https://dev.to/jamesc40/why-new-programmers-should-be-learning-to-do-so-using-vim-3op3</link>
      <guid>https://dev.to/jamesc40/why-new-programmers-should-be-learning-to-do-so-using-vim-3op3</guid>
      <description>&lt;p&gt;At the beginning of my coding journey like most others one of my first steps was to download VSCode onto my computer. &lt;/p&gt;

&lt;p&gt;It wasn't until a few months into learning how to code that I learned of a program that was already on my computer that completely changes the way you interact with a text editor. &lt;/p&gt;

&lt;p&gt;That text editor is Vim and after seeing some of the benefits it could give to power users. I decided to give it a shot. &lt;/p&gt;

&lt;p&gt;After the initial cobwebs wore off I found that after just a few days there were some tasks I was already faster at doing compared to in VSCode which although new was a UI I had been interacting with almost my whole life. The ability to jump to any point on the page with just a few key strokes felt like I was was Neo in The Matrix. &lt;/p&gt;

&lt;p&gt;There are seven basic modes in vim but when first starting out I'd advice for you to just focus on these three&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;em&gt;command mode&lt;/em&gt; (moving with the keyboard)&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;insert mode&lt;/em&gt; (typing in the text editor)&lt;/li&gt;
&lt;li&gt;
&lt;em&gt;visual mode&lt;/em&gt; (used to selected characters ex. copy, paste, etc.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;... and here are some key-binds to get you going  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;switch between command mode and insert mode with &lt;strong&gt;i&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;switch between insert mode and command mode with &lt;strong&gt;Esc&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;navigate up&lt;/strong&gt; in command mode with &lt;strong&gt;k&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;navigate down&lt;/strong&gt; in command mode with &lt;strong&gt;j&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;navigate left&lt;/strong&gt; in command mode with &lt;strong&gt;h&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;navigate right&lt;/strong&gt; in command mode with &lt;strong&gt;l&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;save&lt;/strong&gt; with &lt;strong&gt;:w&lt;/strong&gt; followed by &lt;strong&gt;enter&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;to &lt;strong&gt;quit&lt;/strong&gt; without saving &lt;strong&gt;:q!&lt;/strong&gt; or &lt;strong&gt;ZQ&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;undo&lt;/strong&gt; with &lt;strong&gt;u&lt;/strong&gt; &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;redo&lt;/strong&gt; with &lt;strong&gt;Ctrl+r&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;to &lt;strong&gt;save AND quit&lt;/strong&gt; &lt;strong&gt;:wq&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In conclusion if you've been thinking of giving vim a try or this is your first time hearing about it just learning the basics can be beneficial and who knows you might just find that you prefer it!&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
