Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # The power of Vim
- ## Example 1 (power of dot)
- example.h
- ```c++
- bool Process1(int nitems);
- bool Process2(int position);
- bool Process3(int ntrials, bool property);
- Example
- ```
- ## Example 2 (smart ranges)
- example.ts
- ```typescript
- if (!entry.used && equivalent(entry.key()), qk.key && entry.contexts) {
- }
- ```
- ## Example 3 (delimited blocks)
- example.html
- `cit` change inside tag
- `dat` delete around tag
- ```html
- <div class="something">
- <a href="/somelink">
- <span>asd</span>
- </a>
- </div>
- ```
- ## Example 4 (other motions) vim is not only hjkl
- H // (higher)
- L // (lower)
- M // (middle)
- // scrolling
- zt // scrolling to top
- zz // scrolling to middle
- zb // scrolling to bottom
- ## Example 5 (other commands) power of visual
- ```typescript
- const someconstant1 = 1;
- const someconstant5 = 1;
- const someconstant2 = 1;
- const someconstant4 = 1;
- const someconstant6 = 1;
- const someconstant3 = 1;
- ```
- ## Example 6 (Ex Mode)
- `:g/pattern/d` delete lines (power of g)
- `:g/pattern/exe "somecommand"` execute somecommand on lines matching pattern
- `:s/pattern/newpattern/` search and replace
- ```typescript
- const someFunction(somevar: number) {
- switch (somevar) {
- case 1:
- doSome(somevar);
- break;
- case 2:
- doSome(somevar + 3);
- console.log(2);
- break;
- case 3:
- doSome(somevar);
- break;
- case 4:
- doSome(somevar);
- console.log(2);
- break;
- case 5:
- doSome(somevar);
- console.log(2);
- break;
- default:
- break;
- }
- }
- ```
- ## Example 7 Macros
- `q<some key>` starts recording
- `@<some key>` stops recording
- `@@` run last macro
- qaI"<ESC>f:c$"<ESC>jq
- qa # starts recording in register a
- I"<ESC> # insert " at the soft start of line then go back to normal
- f:c$"<ESC> # find next : then change with " and go back to normal
- j # go down one line
- q # end recording
- ```bash
- 192.168.0.3:33
- 192.168.0.4:12
- 19.168.0.5:1234
- 192.168.0.6:4341
- 192.168.0.7:4444
- 192.168.0.2:1
- 200.168.0.8:1234
- 201.168.0.9:4200
- 20.168.0.10:223
- ```
- ## Plugins
- undotree new thing I won't remember
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement