Oeasy teaches you to play VIM – 4 – # in-depth help

Time:2022-5-25

In depth help

Recall the last lesson

  • It was made last timeoeasy.txt
  • usevim oeasy.txtFile opened
  • :f[ile]Queried the information of the current file
  • fromNormal mode or command modeSwitch toCommand line modeTo use:
  • fromCommand line modePressenterExecute the order and come back after execution

Oeasy teaches you to play VIM - 4 - # in-depth help

  • We can already work in two modes(Command modelast line node Switch between modes
  • We want to know more help information this time

Run help

stayvimMedium operation:help

Oeasy teaches you to play VIM - 4 - # in-depth help

  • We can usehjklMove
  • The direction is shown in the figure above
  • At this timehjklInstead of entering characters, it is a command to move the direction
  • Not just these four characters
  • All keyboard characters correspond to commands
  • This is why the default normal mode(Normal mode)Also known as command mode

Command mode

  • In command mode, you can press the key directly to execute the command
  • Such as mobile
  • There are many orders

Oeasy teaches you to play VIM - 4 - # in-depth help

  • Command mode(Normal mode)And command line mode(Command-Line mode)Different

    • Command mode(Normal mode)Direct key execution
    • Command line mode(Command-Line mode)Enter the command at the bottom line and pressenterimplement
  • Different modes correspond to different operations
  • This toovimThe most difficult reason to get started

learning curve

Oeasy teaches you to play VIM - 4 - # in-depth help

  • VIM is recognized as a very steep learning curve
  • However, after the breakthrough, the efficiency is quite high
  • No matter how easy it is, no matter how difficult it is
  • Things that seem easy at first, such as ides
  • Everything is ready for you, but you completely lose understanding and control over the bottom. In the end, it is the most difficult
  • We climbed the steep mountain little by little and conquered vim

But whyhjklWhat about the corresponding direction?

origin

  • vimcome ofvi
  • viIt was Bill joy in the early daysadm3AMade and used on
  • adm3AIt’s a terminal
  • adm3AYour keyboard has no direction keys
  • So this habit continues to this day ⚠ ️

Oeasy teaches you to play VIM - 4 - # in-depth help

  • We can see on the keyboard abovehjklThe corresponding direction above the key

I still need it nowhjklPress the key to control the cursor?

Keyboard core area

yes! It can still be used nowhjklPress the key to control the cursor.

  • When using VIM, we can put our hands on the core area of the keyboard, which helps to improve efficiency

    • Place the index finger of your left hand on thefupper
    • Place the index finger of your right hand on thejupper

Oeasy teaches you to play VIM - 4 - # in-depth help

The modern 101 keyboard shown in the above picture has added direction keys:

  • The non core area below the right hand
  • Notebook keyboard direction keys also need to physically move the position of the hand
  • So this movement will reduce efficiency. Can we use the mouse to locate it?

Using the mouse

To use mouse control in VIM, we need to make basic configuration first:

  • First, we search for help in vim and enter:h mouse, you can see the interface shown in the following figure:

Oeasy teaches you to play VIM - 4 - # in-depth help

  • Now let’s set the theme
  • As we can see from the above figure, VIM prompts us to execute:set mouse=a, you can use the mouse!!!

    • We can use the mouse to move the cursor
    • Use the scroll wheel to turn pages
    • You can also click the relevant topic links with the mouse

These modern technologies are really good. The operation is more convenient after using the mouse, but the mouse will actually be more convenientAffect efficiency, because the mouse will take our hands off the keyboard.

howeverviThe purpose is to enable users to complete all editing work without leaving the core area of the keyboard:

  • Directional movement is the most common operation
  • He wants your relatively flexible right hand position to be completely stationary in the core area of the keyboard
  • Just press the finger to complete the corresponding movement operation
  • And faster than the mouse

Positional memory

  • It’s hard to remember the right side with L
  • What shall I do? Some users thought of this

Oeasy teaches you to play VIM - 4 - # in-depth help

  • East Los Angeles
  • South Java
  • West Yellow River
  • North Gongqing City

Oeasy teaches you to play VIM - 4 - # in-depth help

  • It’s actually very simple when you’re familiar with it
  • Gradually turn operation into muscle memory instead of brain

Now we have a new question. How did bill joy jump to the hyperlink theme when there was no mouse?

Keyboard jump

Oeasy teaches you to play VIM - 4 - # in-depth help

  • function:helpBack to the beginning of the topic
  • We can seebarsSuch links
  • usehjklMove Cursor
  • Move the cursor over the link
  • yesctrl+]CanJump in link
  • ctrl+osureJump out link, return to the original positionolder position
  • We can try jumping repeatedly ♀️

Two sets of manuals

  • When reading VIM’s Manual
  • We found that VIM has two sets of manual

Oeasy teaches you to play VIM - 4 - # in-depth help

user ‘s manual

Oeasy teaches you to play VIM - 4 - # in-depth help

  • One set is the user manual

    • Like a Book
    • Read from beginning to end
    • From simple to complex
    • Suitable for beginners

Reference manual

Oeasy teaches you to play VIM - 4 - # in-depth help

  • Another set of manuals is cited

    • Describe each topic accurately
    • And how the subject matter works
    • Suitable for query

summary

  • We saw it this time

    • Normal mode
    • Command line mode
    • And how they switch
  • Learned the correct way to open the help file
  • hjklHistorical sources of commands
  • Use the mouse in the document (not recommended)
  • Use full keyboard to jump in and out hyperlinks
  • Two manuals for help files
  • But at this point, we still haven’t changed the document!
  • A good meal is not afraid of late?
  • We’ll talk about it next time!

Recommended Today

Desktop shortcut creation tool for batch CMD

The core code is as follows @echo off Title developeppaer desktop shortcut creation tool! >nul 2>&1 REG.exe query “HKU\S-1-5-19” || ( ECHO SET UAC = CreateObject^(“Shell.Application”^) > “%TEMP%\Getadmin.vbs” ECHO UAC.ShellExecute “%~f0”, “%1”, “”, “runas”, 1 >> “%TEMP%\Getadmin.vbs” “%TEMP%\Getadmin.vbs” DEL /f /q “%TEMP%\Getadmin.vbs” 2>nul Exit /b ) set jb51name=Ditto3.lnk set jb51path=%~dp0 set jb51exec=%~dp0Ditto.exe mshta VBScript:Execute(“Set a=CreateObject(“”WScript.Shell””):Set […]