Vi 中如何去掉行号?

发布于 2024-12-18 15:02:54 字数 86 浏览 7 评论 0原文

为了显示文件中的行号,我使用命令:

set numbers

从文件中清除行号的命令是什么?

For displaying line numbers in a file, I use command:

set numbers

What is the command to clear line numbers from the file?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

我早已燃尽 2024-12-25 15:02:54

如果您正在谈论 vi/vim 中的显示行号命令,

您可以使用

设置nu

打开并

设置诺努

将关闭行号显示或

设置nu!

关闭行号的显示

If you are talking about show line number command in vi/vim

you could use

set nu

in commandline mode to turn on and

set nonu

will turn off the line number display or

set nu!

to toggle off display of line numbers

深白境迁sunset 2024-12-25 15:02:54

显示行号:

:set nu

停止显示行号:

:set nonu

它是 :set nonumber ps 的缩写

。这些命令将在正常模式下运行。

Display line numbers:

:set nu

Stop showing the line numbers:

:set nonu

Its short for :set nonumber

ps. These commands are to be run in normal mode.

顾铮苏瑾 2024-12-25 15:02:54

要关闭行编号,请再次按照前面的说明进行操作,但这次在 : 提示符处输入以下行:

set nonumber

To turn off line numbering, again follow the preceding instructions, except this time enter the following line at the : prompt:

set nonumber
污味仙女 2024-12-25 15:02:54

要关闭行号,可以使用以下任何命令:

  1. :set nu!
  2. :set nonu
  3. :设置数字!
  4. :设置无编号

For turning off line numbers, any of these commands will work:

  1. :set nu!
  2. :set nonu
  3. :set number!
  4. :set nonumber
枯寂 2024-12-25 15:02:54

轻松显示行号:

设置数字标志(显示行号类型)

:set nu :set number

取消设置数字标志(隐藏行号类型)

:set nu!

如果每次启动 vi/vim 时都需要数字,请将以下行附加到您的 ~/.vimrc文件:

set number

在特定位置/行号打开文件

$ vi +linenumber file.rb
$ vi +300 initlib.rb 

Easily Display Line number:

set number flag (to show line number type)

:set nu or :set number

to unset the number flag (hide the line number type)

:set nu!

If you need number every time you start vi/vim, append following line to your ~/.vimrc file:

set number

Open a file at particular location/line number

$ vi +linenumber file.rb
$ vi +300 initlib.rb 
任谁 2024-12-25 15:02:54
set nonumber
set norelativenumber

如果你使用一些 vim 包。

set nonumber
set norelativenumber

If you are using some vim bundles.

我最亲爱的 2024-12-25 15:02:54

来自文档“掌握 VI 编辑器”:

number (nu)
Displays lines with line numbers on the left side.

From the Document "Mastering the VI editor":

number (nu)
Displays lines with line numbers on the left side.
感情旳空白 2024-12-25 15:02:54

设定数量
set nonumber

DO.vimrc 内工作,并确保不要在 .vimrc 中的命令前面加上

set number
set nonumber

DO work inside .vimrc and make sure you DO NOT precede commands in .vimrc with :

待"谢繁草 2024-12-25 15:02:54

在终端中写入命令:

vi ~/.vimrc

用于设置数量:
写入设置号码

为删除号码 :
设置nonumber

write command in terminal:

vi ~/.vimrc

for set the number:
write set number

for remove number:
write set nonumber

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文