获取当前行号? [英] Getting the current row number?

查看:33
本文介绍了获取当前行号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何键映射可以输出正在编辑的行的当前行号?或者,更好的是,我们可以根据键映射的输出来制定公式吗?

Is there any key mapping that outputs the current row number of the line being edited? Or, even better yet, can we do formulas based on the output of the key mapping?

我想获取行号并将 1 添加到当前正在编辑的文本中.

I want to get the row number and add 1 to the current text being edited.

推荐答案

@ZyX 在对另一个答案的评论中给出了答案:

The answer was given by @ZyX in a comment to another answer:

您有 <C-r> 处于插入模式用于此类事情:

You have <C-r> in insert mode for this kind of things:

nnoremap i=line('.')+1

这篇关于获取当前行号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆