grok vi
This commit is contained in:
@@ -3,13 +3,14 @@ title: "vim basics"
|
|||||||
tags: [ "vim", "basic" ]
|
tags: [ "vim", "basic" ]
|
||||||
---
|
---
|
||||||
|
|
||||||
1. Insert text by pressing `i`.
|
1. Insert text by pressing `a`.
|
||||||
1. Stop inserting text by pressing `Ctrl+[`.
|
1. Stop inserting text by pressing `Ctrl+[`.
|
||||||
1. Exit with `ZZ`.
|
1. Exit with `ZZ`.
|
||||||
1. Congratulations, you now know `vim`.
|
1. Congratulations, you now know `vim`.
|
||||||
|
|
||||||
## Extras
|
## Extras
|
||||||
|
|
||||||
|
- [Learning Vim](vim/vi.md)
|
||||||
- [Navigation](vim/navigate.md)
|
- [Navigation](vim/navigate.md)
|
||||||
- [Completion](vim/completion.md)
|
- [Completion](vim/completion.md)
|
||||||
- [Search](vim/search.md)
|
- [Search](vim/search.md)
|
||||||
|
46
writing/vim/vi.md
Normal file
46
writing/vim/vi.md
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
---
|
||||||
|
title: "How to Learn `vim`"
|
||||||
|
tags: [ "vim", "learning" ]
|
||||||
|
requires: [ "vim basics" ]
|
||||||
|
---
|
||||||
|
|
||||||
|
1. Uninstall `vim`.
|
||||||
|
1. Install `vi`.
|
||||||
|
1. Write a few blog posts.
|
||||||
|
|
||||||
|
The [ancient wisdom](https://stackoverflow.com/questions/1218390/what-is-your-most-productive-shortcut-with-vim/1220118#1220118) is correct - everyone should start with `vi`.
|
||||||
|
But the standard wisdom fails to mention writing.
|
||||||
|
So people just 'try to remember', then they edit a couple of configuration files with `vim`, then stop, because it's a pain to think about keystrokes while thinking about how the configuration file works.
|
||||||
|
Nobody can learn like that.
|
||||||
|
|
||||||
|
Learn with a blog, or writing emails in `vim`, or writing anything, as long as it's *real writing*.
|
||||||
|
Write a journal or some recipes.
|
||||||
|
Write literally anything which is written in paragraphs.
|
||||||
|
|
||||||
|
And while you're writing, remember one rule: if you want something, `vi` can do it, you just need to look up how.
|
||||||
|
|
||||||
|
Blog first, then try out some of these commands:
|
||||||
|
|
||||||
|
- `hjkl`
|
||||||
|
- `x`
|
||||||
|
- `:!grep very %`
|
||||||
|
- `onew line<Esc>...`
|
||||||
|
- `Onew line<Esc>...`
|
||||||
|
- `~`
|
||||||
|
- `~~~~`
|
||||||
|
- `$r!`
|
||||||
|
- `w %-2`
|
||||||
|
- `x!`
|
||||||
|
- `0RTipex`
|
||||||
|
- `_4rX`
|
||||||
|
- `bc2e`
|
||||||
|
- `c2E`
|
||||||
|
- `cw`
|
||||||
|
- `cW`
|
||||||
|
- `ci'`
|
||||||
|
- `zz`
|
||||||
|
- `:set number`
|
||||||
|
- `:set nonumber`
|
||||||
|
- `:set relativenumber`
|
||||||
|
- `:set number relativenumber`
|
||||||
|
|
Reference in New Issue
Block a user