Git Product home page Git Product logo

learn-vim's Introduction

Learn Vim (the Smart Way)

What's This?

Learn Vim (the Smart Way) is a guide to learn the good parts of Vim.

There are many places to learn Vim: the vimtutor is a great place to start and the help manual has all the references you will ever need. However, the average user needs something more than vimtutor and less than the help manual. This guide attempts to bridge that gap by highlighting only the key features to learn the most useful parts of Vim in the least time possible.

This guide is written for both beginner and advanced Vimmers. It starts out with broad and simple concepts and ends with specific and advanced concepts. If you're an advanced user already, I would encourage you to read this guide from start to finish anyway, because you will learn something new!

I Want More Vim Tips!

Follow @learnvim for updates, Vim tips, etc.

Support This Project

This guide is and will always be free.

If you want to financially support this project, you can purchase this guide on Leanpub.

Table Of Contents

Prologue

Part 1: Learn Vim the Smart Way

Part 2: Customize Vim the Smart Way

Part 3: Learn Vimscript the Smart Way

Translations

License & Copyright

The materials here are all © 2020-2021 Igor Irianto.

Creative Commons License

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International.

learn-vim's People

Contributors

abhi-k9 avatar ashfinal avatar cyrusyip avatar darager avatar djavrell avatar earik87 avatar ehds avatar flespark avatar forin-xyz avatar hattdroid avatar iggredible avatar jain-anshu avatar jcodeteo avatar joaothallis avatar ltxlouis avatar mathjiajia avatar mo1ein avatar mynameis222222 avatar nicoder avatar nikita-skobov avatar pantras avatar qq88976321 avatar rabinpoudyal avatar sourav-majumdar-math avatar syohex avatar ultirequiem avatar victorhck avatar whrvt avatar yuhanchan avatar zl190 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

learn-vim's Issues

Portuguese version

Hello, Igor!

I would like create a portuguese version of your work.

I read some old issues and appears that translations are happening in separated from this repository. Is that right?
So, in advance I cloned this repo and just started it.

But, to don't face the risk of start a work that other person already started I come here to know is that exists or I am free to do it.

Btw, if you want, you can link it with a WIP tag.
Aprenda-Vim

Editando capitulo 21

Hola, gracias por tomarte el trabajo en la edicion del documento, si te parece bien voy a tratar esta semana de traducir y pasarte el ch21_vimrc.md

Ya lo empece, pero no se como voy a estar de tiempos (estoy recien llegado de vacaciones y seguro algo me pasa)

Saludos! y perdon si este no es el medio.

Wrong :g command syntax

The global command :g/^$/,/./-1j seems to be wrong since Vim >= 9.0 throws

E16: Invalid range: ,/./-1j

when I run this example given section Reduce Multiple Empty Lines to One Empty Line. Surprisingly the commands works nevertheless.

There must be another way to specify ranges in the cmd for :g.

A valid alternative to reduce multiple empty lines to only one empty line is

:g/^$/v/./j

Useful LSP plugin

Hello, have you consider add one chapter intro about LSP plugin, such as coc , sometimes they are very useful.
Even neovim now has built-in support for LSP directly.

https://github.com/neoclide/coc.nvim

ch11_visual_mode.md

shall the 'last' and 'first' be first, last?

`<    Go to the last place of the previous visual mode highlight
`>    Go to the first place of the previous visual mode highlight

Misexplain the :g command (maybe)

Thank you for your work! It's a really helpful guide and I learned a lot from it

https://github.com/iggredible/Learn-Vim/blob/master/ch13_the_global_command.md#advanced-sort

However, in the section above, it says that This command also follows the form :g/pattern1/,/pattern2/command, but I can't find anything about this form from the doc

In my opinion, it should be illustrated like this:

  • :g is the global command pattern.
  • /\[/ is the only pattern. It matches a literal left square bracket "[".
  • +1,/\]/-1 is a range, it begins from the line below the current cursor position (current cursor is placed at [), to the line above ]. thus, if not abbreviated, it should be written as .+1,/\]/-1.
  • sort is the command-line command which the range applies.

If I add a dot before +1, it works well, that's why I think this explanation makes more sense.

remove vimrc section in ch02

Hello.
At the begining of chap02 it's mentioned a suggestion to add in vimrc file. And it's followed by a small explanation about how to do that.
Don't know if this still it's necesary, maybe this part was written before chap00 was created. Now in that very first chapter there's a small explanation about what vimrc is, so maybe the explanation in cha02 it's not necessary...
What do you think?

BTW: The spanish translation it's finished (I'm still doing proofreading, etc) and can be found, apart in GitHub repo, also in GitBook

Suggestion in chapter 00

Hello.
In the chapter 00 you can read:

The :help command and Google are your best friends.

Well, many people out there (like me) have another best friends when we are talking about search engines. :)
Can that sentence change a bit to include not only just one brand?
Greetings

capital letters for commands?

Hello!

translating the chapter 6, I found that you have changed the commands to capital letters. Let's pick up this section as example.

There you say:

Ctrl-H    Delete one character
Ctrl-W    Delete one word
Ctrl-U    Delete the entire line

Since that in Vim, for example, it's not the same i or I for insert text, shouldn't be more appropriate this?

Ctrl-h    Delete one character
Ctrl-w    Delete one word
Ctrl-u    Delete the entire line

just asking.

Greetings!

ask for clarification ch27

Hello.

Translating the section Dictionary in chapter 27 I don't undertand what means when you say namespace. Don't know how to translate that word, because don't understand completly the second example...

Also in next section (Funcref) after the first example I can read

let MyFar = function("MyFunc")

Should be MyVar instead MyFar?

Thanks for your support

Vim Plugins

Typo or not?

Hello!
In chapter 16 in this section I found the word milage
Don't know what does it mean. Not sure if its a typo or it's right.

Greetings.

errors in ch12? ch13?

Hello,
I was trying to update the chinese version of "Learn-Vim". In the section "Pattern Matching" of ch12 (search_and_substitute), i found some words a bit confusing. i am not ture that if it's a error or my misunderstand.

In the line 342:

  • (\w+) (\w+) is a group match. \w is one of Vim's predefined ranges for a word character ([0-9A-Za-z_]). The ( ) surrounding it captures a word character match in a group. Notice the space between the two groupings. (\w+) (\w+) captures two groups. The first group captures "one" and the second group captures "two".

The first group captures "one" and the second group captures "two".
Should it be changed to "In the first line, the first group captures "let", and the second group captures "one"?

Another doubt in the section “Advanced Sort” of ch13(the global command):
In the line 538 and 539:

  • :g/\[/ is the global command pattern.
  • /\[/+1 is the first pattern. It matches a literal left square bracket "[". The +1 refers to the line below it.

In the line 538, the character "/[/" which followed ":g", is repeatitive with line 539. Should it be changed to ":g is the global command" ?

Meaning MVP in Chap 29

Hello!

I was translating Chap29 and I found:

For MVP, this command was good enough,

What does mean MVP in this context? (Maybe a silly question...)

Greetings

Chapter 4 !}column -t -s "|" doesnt work

I'm a newbie to Vim, when following the chapters I got stuck at chapter 4 when running the command !}column -t -s "|" , my cursor was on "Id"

The error message I got is the following

[No write since last change]
zsh:1: command not found: }column

shell returned 127

My whole test file looks like

  1 Id|Name|Cuteness
  2 01|Puppy|Very
  3 02|Kitten|Ok
  4 03|Bunny|Ok
  5

After googling a bit I found that :%!column -t -s "|" works for me, but that's suppose to pipe the whole file to column instead of just a paragraph stated in chapter 4. Am I missing some setting in vimrc? Or something else?

Errors in ch08?

Hello.

I was reading/translating the Clearing a register section in ch08 and I found texts a bit confusing, don't know if really are errors or maybe my english fails! (sure it's last option!)

First:

Technically, there is no need to clear any register because the next register you store under the same name will overwrite it.

Maybe register should be text ?

Second:

Another alternative is to run the command :call setreg('a', '') where "a is the register a.

Says where "a is register a, but where is the text "a in that sentence?

Please, if this is right, just close and ignore this issue!!

Greetings

Wrong command explanation in an example (Chapter 4)

First, thank you for your guide, it is really amazing!

In order to try and give a little contribution, I want to report a small oversight happened here

If I am learning Vim correctly, "To change from your current location to the end of the current paragraph, say c}", should become one of these:

  • To change from your current location to the end of the current paragraph, say }
  • To delete from your current location to the end of the current paragraph, say d}

Edit: Indeed, this makes sense as long as we agree upon the meaning of "change": maybe I misunderstood what it means to change in this context. If that is the case, sorry for wasting your time

It's a wonderful read

Hey, Just created this issue to let you know that the book is coming up nicely so far. Thanks for the efforts, looking forward to all the chapters !

issues with Spanish Updated

Hello Igor.
I ask you to remove the link to Spanish Updated version. Since that repo is a copy of my translation, but without respect my work with translation and the license (CC-by-sa-nc).
That is not a fork of mine. He has copied the files and create his own repo. And I have spend many hours doing translation, reviews, etc that not appears in that repo.
Greetings

missing word in ch20?

Hello.
in chapter 20, Viminfo section you can read:

the next time you open Vim you still that text stored in the register.

Reading that I found a bit weird... maybe missing a word after "still"... or maybe I'm wrong...

Greetings!

Sentence a bit confusing in Ch25

Hello.

I was translating ch25, section "And", and found a sentence a bit confusing:

Unlike "or", "and" will evaluate the subsequent expression after it reaches the first falsy expression. It will continue to evaluate the subsequent truthy expressions until the end or when it sees the first falsy expression.

Maybe it's me (so I'm not native english speaker) ?

If you find that text is right, just close this issue...

Syntax in example ch13

Hello.

In ch13 in this section the syntax of example is:
:g/pattern/command

and later in the same chapter in other section the syntax add a curly brackets:

:g!/{pattern}/{command}

it's right, or should use the same syntax?

Greetings

Index errors.

"Ch22", which is displayed in the Table of Contents. But in the first line inside the file ('ch22_vimrc.md`), it change to "ch21".
The same errors occured in ch23, ch24, ch25, ch26, ch27, ch28, ch29.

Installing fzf

In ch03_searching_files.md:

For some reason, I both had to add the Plugs in .vimrc and use the PlugInstall command to install the plugins. Perhaps we could enrich the guide to mention that, what do you think?

Happy to make a PR :)

Proposal for a translation to Korean

First of all, thanks for this amazing project.
It seems like no one is working for a Korean version yet.
I'd like to work on it if you wouldn't mind!

can i transfer it to my native language

Hi dear,
I want transfer it to my native language.
But your licensed looks i cannot make any changes, including translation.
So i'm not sure if i can translate it

In addition, maybe you can add language management.
I think many people are willing to add the translation pr in your book(including me).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.