3

Vim 相对行号

 2 years ago
source link: https://www.linuxzen.com/vim-xiang-dui-xing-hao.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Home Menu

Vim 相对行号

Gray King | Wed 09 October 2013

在使用用Vim时时常会遇到像复制多行或者想快速向下/向上移动多行时而不知道行数的情况, 今天发现一个Vim对此有帮助的特性: 相对行号. 相对行号将会在每行前显示相对于光标所在行的行号, 相对行号你给出某些垂直移动命令时需要的计数值

在 Vim 7.4 之前的版本, 启用相对行号当前行号将变为0, 无法显示正常的行号, 在 Vim 7.4 中则可以正常的显示当前行号的同时来显示相对行号, 下面有两张图可以对比

Vim 7.3

Vim 7.3

Vim 7.4

Vim 7.3

从上面的图片看来, 启用相对行号后可以很直观的看到当前行距离上面/下面某行的行数

可以使用以下指令启用这个特性

set relativenumber

启用相对行号后再也不用为了复制多行费力气的去数了, so easy!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK