Skip to content

Instantly share code, notes, and snippets.

@mvoto
Last active June 13, 2018 15:26
Show Gist options
  • Select an option

  • Save mvoto/21c6b5bb2f9430974862d08134dfb83a to your computer and use it in GitHub Desktop.

Select an option

Save mvoto/21c6b5bb2f9430974862d08134dfb83a to your computer and use it in GitHub Desktop.

Revisions

  1. mvoto revised this gist Jun 13, 2018. 1 changed file with 2 additions and 4 deletions.
    6 changes: 2 additions & 4 deletions learning-vim.md
    Original file line number Diff line number Diff line change
    @@ -68,9 +68,7 @@ Explaining the command:
    To stick with the plan, let's keep it short and simple.
    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:
    Until there, some references to look at:

    - https://www.youtube.com/watch?v=_NUO4JEtkDw
    - http://www.viemu.com/vi-vim-cheat-sheet.gif

    Cheers !
    - http://www.viemu.com/vi-vim-cheat-sheet.gif
  2. mvoto revised this gist Jun 9, 2018. 1 changed file with 0 additions and 3 deletions.
    3 changes: 0 additions & 3 deletions learning-vim.md
    Original file line number Diff line number Diff line change
    @@ -15,9 +15,6 @@ Getting started with Vim involves some good advices:
    - No mouse allowed, neither arrow keys for navigation on Normal mode.
    - Remind yourself that you will benefit soon from the hard times you may find at the beginning.


    # Where / How to Start / Basics

    ## Modes

    Learning about vim modes:
  3. mvoto revised this gist Jun 9, 2018. 1 changed file with 15 additions and 11 deletions.
    26 changes: 15 additions & 11 deletions learning-vim.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Intro / Motivation / Why should I ?
    # Introduction

    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.
    @@ -21,11 +21,11 @@ Getting started with Vim involves some good advices:
    ## Modes

    Learning about vim modes:
    Normal: is the "initial" mode, where you start(unless you changed configs), can navigate and use all edit commands, including
    **Normal**: is the "initial" mode, where you start(unless you changed configs), can navigate and use all edit commands, including
    the plugins ones.
    Insert: is the mode that you use for editing the file text itself(there are a few keys to enter this mode, for this article
    **Insert**: 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).
    Visual: it is basically selecting text, so you can manipulate it(usually v enters this mode).
    **Visual**: it is basically selecting text, so you can manipulate it(usually v enters this mode).

    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.
    @@ -45,12 +45,11 @@ But we want to edit the text inside the quotes, so we perform a command: `Ci'`
    That would result into: `''` and then you can type whatever you want: `'Vim is awesome !'`.
    Explaining that command:

    * C: for Change
    * i: for inside
    * ': for whatever is enclosing the content you want to modify
    * `C`: for Change
    * `i`: for inside
    * `'`: for whatever is enclosing the content you want to modify

    You could use D instead of C, the difference is that D just deletes and keep you at the Normal mode when C does exactly
    the same thing, but gets you into the Insert mode, so you can write something right away.
    You could use `D` instead of `C`, the difference is that `D` just deletes and keep you at the **Normal** mode when `C` does exactly the same thing, but gets you into the **Insert** mode, so you can write something right away.

    Now let's say you want to duplicate a line:
    `'Vim is awesome !'`
    @@ -61,15 +60,20 @@ That would result into:
    'Vim is awesome !'
    'Vim is awesome !'
    `

    Explaining the command:

    * Y: Yank whole line(if we use it on downcase would perform for whatever you specify next in command, w for word as example)
    * p: paste after cursor(if we use it as capital case it would paste what was yanked before the cursor)
    * `Y`: Yank whole line(if we use it on downcase would perform for whatever you specify next in command, w for word as example)
    * `p`: paste after cursor(if we use it as capital case it would paste what was yanked before the cursor)

    # Conclusion

    To stick with the plan, let's keep it short and simple.
    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:

    - https://www.youtube.com/watch?v=_NUO4JEtkDw
    - http://www.viemu.com/vi-vim-cheat-sheet.gif

    Cheers !
  4. mvoto revised this gist Jun 9, 2018. 1 changed file with 56 additions and 6 deletions.
    62 changes: 56 additions & 6 deletions learning-vim.md
    Original file line number Diff line number Diff line change
    @@ -3,23 +3,73 @@
    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.

    # Advices

    Getting started with Vim involves some good advices:

    - 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.
    - No mouse allowed, neither arrow keys for navigation on Normal mode.
    - Remind yourself that you will benefit soon from the hard times you may find at the beginning.


    # Where / How to Start / Basics

    ## Modes

    Learning about vim modes:
    Normal: is the "initial" mode, where you start(unless you changed configs), can navigate and use all edit commands, including
    the plugins ones.
    Insert: is the mode that you use for editing the file text itself
    Visual: it is basically selecting text
    Insert: 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).
    Visual: it is basically selecting text, so you can manipulate it(usually v enters this mode).

    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.

    # Advices
    ## Commands

    - 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.
    - No mouse allowed, neither arrow keys for navigation on Normal mode.
    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:

    ```'VisualCode is awesome !'```

    But we want to edit the text inside the quotes, so we perform a command: `Ci'`
    That would result into: `''` and then you can type whatever you want: `'Vim is awesome !'`.
    Explaining that command:

    * C: for Change
    * i: for inside
    * ': for whatever is enclosing the content you want to modify

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

    Now let's say you want to duplicate a line:
    `'Vim is awesome !'`
    Then you just type(with cursor at any point of the line): `YP`
    That would result into:

    `
    'Vim is awesome !'
    'Vim is awesome !'
    `
    Explaining the command:

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

    # Conclusion

    To stick with the plan, let's keep it short and simple.
    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.

    Cheers !
  5. mvoto created this gist May 29, 2018.
    25 changes: 25 additions & 0 deletions learning-vim.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    # Intro / Motivation / Why should I ?

    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.


    # Where / How to Start / Basics

    Learning about vim modes:
    Normal: is the "initial" mode, where you start(unless you changed configs), can navigate and use all edit commands, including
    the plugins ones.
    Insert: is the mode that you use for editing the file text itself
    Visual: it is basically selecting text

    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.

    # Advices

    - 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.
    - No mouse allowed, neither arrow keys for navigation on Normal mode.