spf13 / spf13-vim

The ultimate vim distribution
http://vim.spf13.com
Apache License 2.0
15.56k stars 3.63k forks source link

can't auto enable "relativenumber" when open a C file #1082

Closed allanlibra closed 6 years ago

allanlibra commented 6 years ago

I add a command set relativenumber at the tail of .vimrc it works, except in C file. is some plugin may affect this ? My environment is: VIM 7.4, Ubuntu 16.04 I'm not very familiar with VIM, and I only changed .vimrc as above. thanks for any help

wsdjeg commented 6 years ago

you can use an autocmd, of cause it should be surounded by augroup, for example:

augroup my_vimrc
  autocmd!
  autocmd FileType c setlocal relativenumber
augroup END
allanlibra commented 6 years ago

Finally I follow the README and add

set relativenumber
colorscheme 0x7A69_dark

to ~/.vimrc.local, and it works. And also thanks for @wsdjeg 's answer, I learned new about vim.