Merge pull request #5 from iggredible/master

update from upstream
pull/74/head
Victorhck 3 years ago committed by GitHub
commit 6437d442fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,12 +1,26 @@
# Learn Vim (the Smart Way)
## What is this about?
## 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](https://twitter.com/learnvim) for updates, Vim tips, etc.
## Table Of Contents
## 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 gumroad](https://gumroad.com/l/DADpa/learn-vim-2021).
<a href="https://gumroad.com/l/DADpa/learn-vim-2021"><img src="images/learn-vim-cover.png" width="100"></a>
## Table Of Contents
### Prologue

@ -86,3 +86,10 @@ I also have planned a few more upcoming chapters, so stay tuned!
## I Want More Vim Tricks
To learn more about Vim, please follow [@learnvim](https://twitter.com/learnvim).
## Thank Yous
This guide wouldn't be possible without Bram Moleenar for creating Vim, my wife who had been very patient and supportive throughout the journey, all the [contributors](https://github.com/iggredible/Learn-Vim/graphs/contributors) of the learn-vim project, the Vim community, and many, many others that weren't mentioned.
Thank you. You all help make text editing fun :)

@ -17,7 +17,7 @@ o Starts a new line below the cursor and insert text
O Starts a new line above the cursor and insert text
s Delete the character under the cursor and insert text
S Delete the current line and insert text
gi Insert text in same position where the last insert mode was stopped in current buffer
gi Insert text in same position where the last insert mode was stopped
gI Insert text at the start of line (column 1)
```

@ -15,7 +15,7 @@ Here are the 10 Vim register types:
3. The small delete register (`"-`).
4. The named registers (`"a-z`).
5. The read-only registers (`":`, `".`,and `"%`).
6. The alternate buffer register (`"#`).
6. The alternate file register (`"#`).
7. The expression register (`"=`).
8. The selection registers (`"*` and `"+`).
9. The black hole register (`"_`).

@ -185,7 +185,7 @@ First, let's call the existing macro (assume you have kept the macro from the pr
0W~A.^[
```
What is this `^[`? Didn't you do `0W~A.<Esc>`? `^[` is Vim's *internal code* representation of `<Esc>`. With certain special keys, Vim prints the representation of those keys in the form of internal codes. Some common keys that have internal code representations are `<Esc>`, `<Backspace>`, and `<Enter>`. There are more special keys, but they are not within the scope of this chapter.
What is this `^[`? Didn't you do `0W~A.<Esc>`? Where is the `<Esc>`? `^[` is Vim's *internal code* representation of `<Esc>`. With certain special keys, Vim prints the representation of those keys in the form of internal codes. Some common keys that have internal code representations are `<Esc>`, `<Backspace>`, and `<Enter>`. There are more special keys, but they are not within the scope of this chapter.
Back to the macro, right after the toggle case operator (`~`), let's add the instructions to go to the end of the line (`$`), go back one word (`b`), go to the insert mode (`i`), type "deep fried " (don't forget the space after "fried "), and exit insert mode (`<Esc>`).

@ -414,7 +414,7 @@ Let's talk about the global flag. Run:
Vim substitutes all pancakes with donuts in one swift command. The global command is one of the several flags the substitute command accepts. You pass flags at the end of the substitute command. Here is a list of useful flags:
```
& Reuse the flags from the previous substitute command. Must be passed as the first flag.
& Reuse the flags from the previous substitute command.
g Replace all matches in the line.
c Ask for substitution confirmation.
e Prevent error message from displaying when substitution fails.

@ -523,6 +523,6 @@ Now if you run `echo Lunch()()`, Vim will return "shrimp".
In this chapter, you learned the anatomy of Vim function. You learned how to use different special keywords `range`, `dict`, and `closure` to modify function behavior. You also learned how to use lambda and to chain multiple functions together. Functions are important tools for creating complex abstractions.
This concludes this Vim guide. However, your Vim journey doesn't end here. In fact, it actually starts now. You should have sufficient knowledge to go on your own or even create your own plugins.
This concludes this Vim guide. However, your Vim journey doesn't end here. In fact, it actually starts now. You should have sufficient knowledge to go on your own. You may even create your own plugins. Learning Vim is a lifelong pursuit, so never stop learning!
Happy Vimming, friends!

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

Loading…
Cancel
Save