Share to EffectHub.com

You can earn money or coins from your share:)

Tips: you can use Sparticle for uploading away3D effects.

Tips: you can download Sparticle for uploading effects.

Tips: The ActionScript editor is supporting Away3D, Starling, Dragonbones and Flex frameworks.

Tips: paste the web page URL then click button:)

EffectHub.com: Your Best Source for Gaming
Login    or

Learn Vim Progressively (2)

3rd Level – Better. Stronger. Faster.

Congratulation for reaching this far! Now we can start with the interesting stuff. At level 3, we’ll only talk about commands which are compatible with the old vi editor.

Better

Let’s look at how vim could help you to repeat yourself:

  1. . → (dot) will repeat the last command,

  2. N→ will repeat the command N times.

Some examples, open a file and type:

  • 2dd → will delete 2 lines

  • 3p → will paste the text 3 times

  • 100idesu [ESC] → will write “desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu desu”

  • . → Just after the last command will write again the 100 “desu”.

  • 3. → Will write 3 “desu” (and not 300, how clever).

Stronger

Knowing how to move efficiently with vim is very important. Don’t skip this section.

  1. NG → Go to line N

  2. gg → shortcut for 1G - go to the start of the file

  3. G → Go to last line

  4. Word moves:

    By default, words are composed of letters and the underscore character. Let’s call a WORD a group of letter separated by blank characters. If you want to consider WORDS, then just use uppercase characters:

    Word moves example

    1. W → go to the start of the following WORD,

    2. E → go to the end of this WORD.

    3. w → go to the start of the following word,

    4. e → go to the end of this word.

Now let’s talk about very efficient moves:

  • % : Go to the corresponding ({[.

  • * (resp. #) : go to next (resp. previous) occurrence of the word under the cursor

Believe me, the last three commands are gold.

Faster

Remember about the importance of vi moves? Here is the reason. Most commands can be used using the following general format:

For example : 0y$ means

  • 0 → go to the beginning of this line

  • y → yank from here

  • $ → up to the end of this line

We also can do things like ye, yank from here to the end of the word. But also y2/foo yank up to the second occurrence of “foo”.

But what was true for y (yank), is also true for d (delete), v (visual select), gU (uppercase), gu (lowercase), etc…

Source: http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/

...

You must Sign up as a member of Effecthub to view the content.

1655 views    5 comments

You must Sign up as a member of Effecthub to join the conversation.

Chenzhi Wu

A PHP Error was encountered

Severity: Notice

Message: Undefined index: HTTP_ACCEPT_LANGUAGE

Filename: helpers/time_helper.php

Line Number: 22

2013-09-05
>>Back to TextEditor group


Latest Posts


Sponsor


They are waiting for your help



Share

Join Effecthub.com


Or Login with Your Email Address:

Or Sign Up with Your Email Address:
This field must contain a valid email
Password should be at least 1 character

A PHP Error was encountered

Severity: Notice

Message: Undefined index: HTTP_ACCEPT_LANGUAGE

Filename: views/footer.php

Line Number: 6

A PHP Error was encountered

Severity: Notice

Message: Undefined index: HTTP_ACCEPT_LANGUAGE

Filename: controllers/topic.php

Line Number: 21

A PHP Error was encountered

Severity: Notice

Message: Undefined index: HTTP_ACCEPT_LANGUAGE

Filename: controllers/topic.php

Line Number: 85