Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Unable to disable relative line numbers #164

Closed
niftybit opened this Issue · 27 comments
@niftybit

Cannot find an easy way to disable relative line numbers caused by the numbers plug-in (myusuf3 /numbers.vim).

Preferably a simple command that can be added to .vimrc.local

@jphustman

To map F3 add to your .vimrc.local:
nnoremap <F3> :NumbersToggle<CR>

@spf13
Owner
@jphustman

Isn't this plugin a little overkill? How hard would it be just to set a toggle for :set relativenumber and :set number?

@niftybit

@spf13 A config param to disable this plugin would do it. Much appreciated!

@elclanrs

I tried just commenting the bundle in .vimrc.bundles and it seemed to work with my js files but html files still have this IMO annoying plugin activated and with the bundle line commented I no longer have access to :NumbersToggle. I activated the plugin again and tried with the F3 shortcut suggested above, but html files trigger the plugin randomly even when it's turned off. Any ideas why this is happening? How to disable the plugin completely?

@jphustman

cant this just be as simple as adding this to the .vimrc as is noted http://jeffkreeftmeijer.com/2012/relative-line-numbers-in-vim-for-super-fast-movement/

function! NumberToggle()
  if(&relativenumber == 1)
    set number
  else
    set relativenumber
  endif
endfunc

nnoremap <C-n> :call NumberToggle()<cr>
@utkarsh2012

@elclanrs I have the same problem, but I am not able to disable it.

@cocreature

I would really love to see an option for this in the main code.

@wwalker

I don't want ANY line numbers. The only solution I found was to remove the numbers.vim file under bundles, and comment it out in .vimrc.bundles so it didn't get reinstalled.

@jphustman

Yay! This latest update you can UnBundle 'myusuf3/numbers.vim' in your .vimrc.local

@spf13 spf13 closed this
@elclanrs

It works, nice.

@jmouradi

In the version I just downloaded, the NumbersToggle() function was already included in the numbers bundle; simply type :NumbersToggle and hit enter and it will switch between modes. It looks like it writes to file so you don't even need to edit your config to make the change persistent :D

@qiuwei

@jphustman Are you sure it works in the latest version? I tried it but it's still there.
@jmouradi but it's only for the file you were editing. The default option is still on.

This plug-in is really annoying since there is no simple way to disable it in the config file.
Could you remove it? People who like it can easily install it by themselves.

@spf13
Owner
@user454322

First of all, thanks for spf13-vim. Then I have to say that I agree with all the people saying that this plugin is overkill and annoying.
Even tho, it is possible to type ':NumbersToggle' or map it to F3, I really don't feel like typing or pressing F3 everytime I use vim.
Seriously isn't a config paramter to permanent disable it?

I wish I knew enough about vim to send a pull request...

@ghost

you may try this between line 5 to line 16
https://github.com/wych42/spf13-vim/blob/3.0/.vimrc.local

@elclanrs

This works for me #164 (comment)

@qiuwei

@user454322

UnBundle 'myusuf3/numbers.vim'

actually works.

I forgot to run Bundle clean afterwards.

@user454322

@elclanrs @qiuwei

I have seen the UnBundle thing here https://github.com/spf13/spf13-vim#removing-disabling-an-included-plugin, tried and only works in insert mode. While in normal mode I still get the annoying relative numbers.

Anyway thanks.

@wych42
Thanks but did't work for me.

Perhaps there is something wrong with my environment, the strange thing is that I get the same result in Ubuntu and Mac.

@qiuwei

@user454322
It works for me.
I think numbers.vim uses vim's relative number underline, and the setting of relative number is somehow remembered.

So try it on a new file to see if it works.
If it works, then you can run:

:set number

on edited files to get normal settings back.

@spf13
Owner
@ghost

@user454322 It's a funtion let you switch between relative number,number and don't show the number,you may change key binding 'wn' to other if it conflicts.

@pjump

Hi, I also wanted to disable the default relativenumber line numbering, and UnBundling 'myusuf3/numbers.vim' in my .vimrc.local did solve it partially, however whenever I'm editing a file whose ft=vim (such as ~/.vimrc), the line numbering is relative again. Any ideas why?

@spf13
Owner
@reem

I'm having a similar problem (I UnBundled the plugin, and did BundleClean etc. so I get regular line numbers for new files but not old files.), how do I clear my views?

@jcbwlkr

Delete all of the files under $HOME/.vimviews

@reem

That worked. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.