[英]Toggling line numbers in vimrc doesn't work
I'm new to vim. 我是vim的新手。 I'm using MacVim. 我正在使用MacVim。
I use 我用
:set number
which shows line numbers. 显示行号。
I've added 我已经添加
set number
to my vimrc, to make show line numbers by default. 到我的vimrc,默认显示行号。
My vimrc: 我的vimrc:
no <down> <Nop>
no <left> <Nop>
no <right> <Nop>
no <up> <Nop>
ino <down> <Nop>
ino <left> <Nop>
ino <right> <Nop>
ino <up> <Nop>
set number
But line numbers don't show up. 但是没有显示行号。
Everything in vimrc except set number
works fine. vimrc中除set number
以外的所有内容都可以正常工作。 What am I doing wrong? 我究竟做错了什么?
Problem was that I had one .vimrc
in the ~/
and one in the ~/.vim/.vimrc
. 问题是我在~/
有一个.vimrc
,在~/.vim/.vimrc
。 The one that was in the ~/
was overriding the one in in ~/.vim/.vimrc
. ~/
中的一个将覆盖~/.vim/.vimrc
。
I'd comment but I'm not allowed :( 我会发表评论,但我不被允许:(
I usually have had that problem when either the file or the line is corrupted or has Ctrl characters or in someversions of Unix if there was a space in the wrong place 当文件或行损坏或具有Ctrl字符时,或者在Unix的某些版本中,如果在错误的位置有空格,我通常会遇到该问题
try :set list and make sure there isn't a Tab, missing Line Feed or something 尝试:set list并确保没有选项卡,缺少换行或其他内容
There's a way of viewing the Control Characters that don't display in :set list but can't remember it. 有一种方法可以查看不在:set列表中但无法记住的控制字符。
Shove comes to push delete the line and the one above and below. 推来推删除行以及上下一行。 Save and retype it andsee if it fixes it. 保存并重新输入它,看看它是否可以解决。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.