Display ruler
Recall the last lesson
- Define tag a
ma
- Delete tag a
:delm a
-
Jump to tag a
'a
- `A jumps to the row and column corresponding to a
- ‘a jumps to the row corresponding to’ a ‘
- View all tags
:marks
-
Various marking types
''
Is the position of the cursor of the last jump operation'"
Is the location where the current file was last exited'[
Is the starting position of the last edit (delete, modify, etc.)']
Is the end position of the last edit (delete, modify, etc.)- a lowercase letter
a-z
You can mark the location coordinates inside this document - Capitalize
A-Z
You can mark location coordinates across files - number
0-9
In the configuration file~/.viminfo
In, you can keep the tag
- Every timectrl + gDisplay coordinates
- Can I always display coordinates?
Displays the current location
#First, let VI edit / etc / passwd in modeless mode
vi -u NONE /etc/passwd
- ctrl + g
- perhaps
:f[ile]
-
It can be on the bottom line
- See the currently edited file
- And the location of the file
Display ruler
-
If you want to display the cursor position all the time
- You need a ruler
Ruler
It’s aSwitch option
-
What is a switch?
- It’s where you can turn it on or off
-
Ruler
The name of the switch isruler
ruler- You can turn on the ruler
- You can also turn off the ruler
- How does this switch open and close?
Make settings
-
ruler
The label can be used:set
Set in this way:se[t] ru[ler]
You can set the ruler to be visible:se[t] noru[ler]
You can set the ruler invisible
-
number
Labels can also be used:set
Set in this way:se[t] nu[mber]
You can set the line number:se[t] nonu[mber]
You can set the line number invisible
-
It can also be opened together
:se nu ru
-
Or both close together
:se noru nonu
- It’s all some blue cotton curtain
About switch
-
The switch is
options
- You can set whether the ruler is displayed in the current document
- You can also set whether the current document wraps automatically
- The switch is not directly related to the document we edit
- But it determines the current display status
-
have access to
:options
- open
options.txt
seeAll
Switch of /ruler
Find in current fileruler
This switch
- open
- How do I know
Ruler switch
Current status?
View switch
- View switch status?
-
Can I pass? To view the switch status
:set number?
:set ruler?
- You can try
- If I want to reset the switch to the initial state
- What should I do?
Reset switch&
- Reset switch status&
-
Directly reset the switch to the default value
:set number&
:set ruler&
Ruler details
:options
You can get a simple explanation in one line- If you want more detailed information
- You can also pass
:h 'ruler'
Find the details of this option switch
Ruler details
- You can see the ruler in the lower right corner
- The ruler places the cursor at
80*24
Clearly marked on the screen - Separate with commas
Line number
andColumn number
Line number
The display switch is:se nu
Column number
Is the sequence number of the column where the current cursor is located
Jump
-
Jump to line
- 2 9 GThe command jumps to line 29
:33
Quick jump to line 33
-
Jump to column
- 19 |
- Jump to column 19 with command
Ruler details
-
There are some words written on the right side of the ruler
- Sometimes in
Top
, line 1 of the file is at the top of the screen - Sometimes in
bottom
, the last line of the file is at the bottom of the screen - Sometimes in
whole
, the file is very short, and the whole screen is displayed
- Sometimes in
Display command
-
use
:set showcmd
You can see the command used on the left side of the rulershow
displaycmd
command
- 1 9 GCommand jump line number
- Press character by character
- observe variances
- In this way, we can see the command input
Jump in percentage
- There is a percentage after the row and column number
- Sometimes it is a percentage. The scale is the cursor line number divided by the total line number of the file
- have access to29 %Skip to entire file
29%
Location of
Set the number of history records
:set history=100
- In this way, you can find the commands that have been executed up and down the keyboard
:h 'history'
summary
- We studied the ruler this time
-
Ruler
- open
se ru
- close
se noru
- open
-
Line number
- open
se nu
- close
se nonu
- open
-
Command location
- open
se showcmd
- close
se noshowcmd
- open
-
Jump
- use29 GJump line number
- use19 |Jump column number
- use29 %Skip to 29% of the entire file
- Is there anything else interesting?
- Next time