標籤:vim real-lines
Distinguish Between Real Lines and Display Lines
Unlike many text editors, Vim makes a distinction between real lines and display lines. When the ‘wrap’ setting is enabled (and it’s on by default), each line of text that exceeds the width of the window will display as wrapped, ensuring that no text is truncated from view. As a result, a single line in the file may be represented by multiple lines on the display.
在Vim 中區分real lines和display lines。對於一個文本,如果一行文字的長度大於顯示視窗的寬度,就會自動換為下一行以免被截斷。這樣原本的單行(real lines)就變為了多行(display lines)。
The easiest way to tell the difference between real lines and display lines is by enabling the ‘number’ setting. Lines that begin with a number correspond to the real lines, which may span one or more display lines.
在vim 的normal模式下中輸入命令
:set number
就可以顯示文本的行號。以行號開頭的行就是real lines
Vim中分別提供了直接在real lines和display lines中快速上下移動以及在行首和行尾快速跳轉的快速鍵。
[Practical.Vim(2012.9)].Drew.Neil.Tip47 學習摘要