<?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: Mauricio Voto</title>
    <description>The latest articles on DEV Community by Mauricio Voto (@mvoto).</description>
    <link>https://dev.to/mvoto</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%2F79650%2F8f32182a-d364-400f-9bcd-fe8be75b6984.jpeg</url>
      <title>DEV Community: Mauricio Voto</title>
      <link>https://dev.to/mvoto</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mvoto"/>
    <language>en</language>
    <item>
      <title>Vim basics(part 2): Navigation, Configuration and Plugins</title>
      <dc:creator>Mauricio Voto</dc:creator>
      <pubDate>Sun, 24 Jun 2018 06:55:49 +0000</pubDate>
      <link>https://dev.to/mvoto/vim-basicspart-2-navigation-configuration-and-plugins-4jde</link>
      <guid>https://dev.to/mvoto/vim-basicspart-2-navigation-configuration-and-plugins-4jde</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;This post is the second one of this Vim basics series, if you haven't checked &lt;a href="https://dev.to/mvoto/vim-basicspart-1-modes-and-commands--6md"&gt;v1&lt;/a&gt; yet&lt;br&gt;
you can see some tips to start using this amazing editor.&lt;br&gt;
After talking about Modes and Commands, things will get interesting, because the topics here will be navigation and configuration. With a few navigation tips you can feel the power and potential behind Vim&lt;br&gt;
and in addition, configuration and plugins might show you comfort to put it at the same level as your current text editor and possibly even better - talking about productivity boost, yeah !&lt;/p&gt;
&lt;h1&gt;
  
  
  Advices
&lt;/h1&gt;

&lt;p&gt;Same as part 1, there are some good advices when talking about navigation and configuration.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigation's 1st rule: don't use arrow keys, get used to &lt;code&gt;hjkl&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Navigation's 2nd rule: practice, practice and practice. You can start &lt;a href="https://vim-adventures.com/"&gt;here&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Configuration's main rule: avoid using someone else's entire config file. If you decide using an
existing config file, read it first and use only the things you understand and that will be a fit
for your needs.&lt;/li&gt;
&lt;li&gt;Configuration's advice: you'll keep improving it forever :)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Navigation
&lt;/h2&gt;

&lt;p&gt;Navigation is one of the most important vim's skills that you must master in order to reach the best performance.&lt;br&gt;
Moving around using your keyboard &lt;strong&gt;only&lt;/strong&gt;. We can think about navigation by dividing into different topics, the ones that we want to cover here are: screen / file, line and word.&lt;br&gt;
Let's see some (in my opinion) most useful navigation keys:&lt;/p&gt;
&lt;h2&gt;
  
  
  Screen / File Navigation
&lt;/h2&gt;

&lt;p&gt;When talking about screen, we're aiming the piece of content you are currently viewing in your vim editor and when talking about file, we're aiming the full content.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;G&lt;/code&gt; - go to the first line of the file&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;gg&lt;/code&gt; - go to the last line of the file&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;5G or 5gg&lt;/code&gt; - go to the 5th line of the file&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;H&lt;/code&gt; - go to the first line of the screen&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;M&lt;/code&gt; - go to the middle line of the screen&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;L&lt;/code&gt; - go to the last line of the screen&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;zt&lt;/code&gt; - scroll the line with the cursor to the top of the screen&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;zz&lt;/code&gt; - scroll the line with the cursor to the center of the screen&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;zb&lt;/code&gt; - scroll the line with the cursor to the bottom of the screen&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Line Navigation
&lt;/h2&gt;

&lt;p&gt;This is about navigating between lines and also navigating to the start and end of the current line.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;h&lt;/code&gt; - move one character left&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;j&lt;/code&gt; - move one line down&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;k&lt;/code&gt; - move one line up&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;l&lt;/code&gt; - move one character right&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;3j / 3k&lt;/code&gt; - moves 3 lines down and 3 lines up respective&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;0&lt;/code&gt; - moves to the start of the current line&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;$&lt;/code&gt; - moves to the end of the current line&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Word Navigation
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;e&lt;/code&gt; – go to the end of the current word.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;E&lt;/code&gt; – go to the end of the current WORD.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;b&lt;/code&gt; – go to the previous (before) word.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;B&lt;/code&gt; – go to the previous (before) WORD.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;w&lt;/code&gt; – go to the next word.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;W&lt;/code&gt; – go to the next WORD.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a delightful preview on something we can get after some time of practice and mastering modes, we can easily do things like multi-line column editing ie:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Ctrl + V
5j
Shift + I
@ + Esc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Configuration
&lt;/h2&gt;

&lt;p&gt;Every person has its own story and it's okay to admire other people's stories. What about start writing your own story and maybe some day other people will admire your story.&lt;br&gt;
That's a good example to follow on your config files.&lt;br&gt;
I started using &lt;a href="https://github.com/alanmesquita/meuvim/blob/master/.vimrc"&gt;one from my friend Alan&lt;/a&gt;&lt;br&gt;
And then after some time switched to the &lt;a href="https://github.com/thoughtbot/dotfiles/blob/master/vimrc"&gt;thoughtbot's one&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Plugins
&lt;/h2&gt;

&lt;p&gt;This topic definitely deserves its own post, but since this is a basics series and I am compromised to keep the posts short and simple, gonna try to handle it on a couple lines :)&lt;br&gt;
My personal advice for trying plugins is do it yourself ! The first step is to check out some existing plugin managers and pick your favourite one(I am using Vundle), so here's a list for you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/Shougo/neobundle.vim"&gt;Neobundle&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/tpope/vim-pathogen"&gt;Pathogen&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/MarcWeber/vim-addon-manager"&gt;VAM&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/junegunn/vim-plug"&gt;Vim-plug&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/gmarik/Vundle.vim"&gt;Vundle&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To customize and manage plugins on vim, you can do it by editing a dotfile at your home folder.&lt;br&gt;
Ie.: for Vundle I have a &lt;code&gt;~/.vimrc.bundles&lt;/code&gt; file and my config lives at &lt;code&gt;~/.vimrc&lt;/code&gt;.&lt;br&gt;
Comments are good to keep them organized.&lt;br&gt;
Here's a list of some popular and (imho) useful / essentials / powerful plugins:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/scrooloose/nerdtree"&gt;NERDTree&lt;/a&gt; - tree explorer / sidebar&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/ctrlpvim/ctrlp.vim"&gt;CtrlP&lt;/a&gt; - full path fuzzy finder&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/mileszs/ack.vim"&gt;Ack&lt;/a&gt; - search in project&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/tpope/vim-fugitive"&gt;Fugitive&lt;/a&gt; - an awesome Git wrapper&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/tpope/vim-surround"&gt;Surround&lt;/a&gt; - simple quoting/parenthesizing&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/myusuf3/numbers.vim"&gt;Numbers&lt;/a&gt; - better line numbers, that results into better
navigation&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/universal-ctags/ctags"&gt;Ctags&lt;/a&gt; - to navigate through the code(classes and
methods definition)&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/neomake/neomake"&gt;NeoMake&lt;/a&gt; - Async linting(only for NeoVim)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I could build a huge list here by suggesting themes, syntax highlight and helpers for different languages, frameworks and same thing for linters, not doing it to keep this series as a starting guide for every developer that wants to start using Vim.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;The most beautiful thing about vim, in my opinion, is how this editor pushes you forward and makes you think while using it. Feels like there's always a best or simplest way of doing your actual task.&lt;br&gt;
So, every time you are doing some navigation, try to take some time and think about a better way on doing it, as mentioned in &lt;a href="https://dev.to/mvoto/vim-basicspart-1-modes-and-commands--6md"&gt;the part 1 post&lt;/a&gt;, it's supposed to take some time for you to be productive when using vim, but worth spending some time googling about something that you want to do but don't know or can't remember / figure out.&lt;br&gt;
Same rule applies to configuration and plugins, every time that it's possible, take some time to improve it, customize it and leave the best way you can.&lt;br&gt;
The results can be amazing and you will find yourself very happy about the progress you've done and your editor will be just like your son / daughter.&lt;br&gt;
Stay tunned for more, still have lots of things to cover on future posts, like searching.&lt;br&gt;
Some good references for you and for me:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.thegeekstuff.com/2009/03/8-essential-vim-editor-navigation-fundamentals/"&gt;https://www.thegeekstuff.com/2009/03/8-essential-vim-editor-navigation-fundamentals/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://vim.wikia.com/wiki/All_the_right_moves"&gt;http://vim.wikia.com/wiki/All_the_right_moves&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/akrawchyk/awesome-vim"&gt;https://github.com/akrawchyk/awesome-vim&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>vim</category>
      <category>basics</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Vim basics(part 1): Modes and Commands </title>
      <dc:creator>Mauricio Voto</dc:creator>
      <pubDate>Thu, 21 Jun 2018 02:50:35 +0000</pubDate>
      <link>https://dev.to/mvoto/vim-basicspart-1-modes-and-commands--6md</link>
      <guid>https://dev.to/mvoto/vim-basicspart-1-modes-and-commands--6md</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Developers like new things and Vim is definitely a totally new and different thing if you are used to editors like Sublime, Atom, Text Mate or VSCode. Seems difficult because is new. Everything that is new for us tends to be difficult. So, let's start with a plan: keep it short, keep it simple, keep it going. It means that the plan is to constantly improve vim knowledge by getting new tips, using it a lot and then master it. Will try to follow that with this Vim series.&lt;/p&gt;

&lt;h1&gt;
  
  
  Advices
&lt;/h1&gt;

&lt;p&gt;Getting started with Vim involves some good advices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Avoid frustration, by not using it when you need speed, keep in mind that you won't get same efficiency as your regular editor for a while. It's similar to learning a new language or framework and if you keep expectations high it will be frustrating.&lt;/li&gt;
&lt;li&gt;No mouse allowed, neither arrow keys for navigation on Normal mode.&lt;/li&gt;
&lt;li&gt;Remind yourself that you will benefit soon from the hard times you may find at the beginning.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Modes
&lt;/h2&gt;

&lt;p&gt;Learning about vim modes:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Normal&lt;/strong&gt;: is the "initial" mode, where you start(unless you changed configs), can navigate and use all edit commands, including the plugins ones.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Insert&lt;/strong&gt;: is the mode that you use for editing the file text itself(there are a few keys to enter this mode, for this article let's assume the i, that takes you to the Insert mode exactly where your cursor is at that moment).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Visual&lt;/strong&gt;: it is basically selecting text, so you can manipulate it(usually v enters this mode).&lt;/p&gt;

&lt;p&gt;When you are not on Normal mode, you can press Esc to switch back to it. And if you want to exit vim, on Normal mode, you can use :q. Now that you know how to exit vim, this article is done, see you next time. Just kidding, lol.&lt;/p&gt;

&lt;h2&gt;
  
  
  Commands
&lt;/h2&gt;

&lt;p&gt;When inside the Normal mode, you can also modify the content by using some commands, all you have to do is navigate into the content you want to change(we'll talk about navigation in another article from this series). A very basic but useful example is how to edit code inside quotes or parenthesis. Let's say we have something like this string:&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;'VisualCode is awesome !'&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;But we want to edit the text inside the quotes, so we perform a command: &lt;code&gt;Ci'&lt;/code&gt;&lt;br&gt;
That would result into: &lt;code&gt;''&lt;/code&gt; and then you can type whatever you want: &lt;code&gt;'Vim is awesome !'&lt;/code&gt;.&lt;br&gt;
Explaining that command:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;C&lt;/code&gt;: for Change&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;i&lt;/code&gt;: for inside&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;'&lt;/code&gt;: for whatever is enclosing the content you want to modify&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You could use &lt;code&gt;D&lt;/code&gt; instead of &lt;code&gt;C&lt;/code&gt;, the difference is that &lt;code&gt;D&lt;/code&gt; just deletes and keep you at the &lt;strong&gt;Normal&lt;/strong&gt; mode when &lt;code&gt;C&lt;/code&gt; does exactly the same thing, but gets you into the &lt;strong&gt;Insert&lt;/strong&gt; mode, so you can write something right away.&lt;/p&gt;

&lt;p&gt;Now let's say you want to duplicate a line:&lt;br&gt;
&lt;code&gt;'Vim is awesome !'&lt;/code&gt;&lt;br&gt;
Then you just type(with cursor at any point of the line): &lt;code&gt;YP&lt;/code&gt;&lt;br&gt;
That would result into:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
'Vim is awesome !'&lt;br&gt;
'Vim is awesome !'&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Explaining the command:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Y&lt;/code&gt;: Yank whole line(if we use it on downcase would perform for whatever you specify next in command, w for word as example)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;p&lt;/code&gt;: paste after cursor(if we use it as capital case it would paste what was yanked before the cursor)&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;To stick with the plan, let's keep it short and simple.&lt;br&gt;
You can now start with your vim by switching modes and trying these two basic commands. Practice a lot and stay tuned for a next posts, where we'll probably cover navigation and more cool commands. Until there, some references to look at:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=_NUO4JEtkDw"&gt;https://www.youtube.com/watch?v=_NUO4JEtkDw&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.viemu.com/vi-vim-cheat-sheet.gif"&gt;http://www.viemu.com/vi-vim-cheat-sheet.gif&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>vim</category>
      <category>modes</category>
      <category>commands</category>
      <category>basics</category>
    </item>
  </channel>
</rss>
