tags:

views:

63

answers:

1

I have recently set the option

set relativenumber

in my .vimrc but now when I open taglist or NerdTree these buffers have line numbers. Is there a way to disable the line numbers in the taglist and nerdtree buffers (but keep them in the others)?

+2  A: 

Filetypes that are set to the NERDTree and TagList buffers can help. You can automatically execute any command whenever the filetype of the buffer is changed (see :help autocmd). In your case, it's easy to automatically switch off relativenumber option for nerdtree and taglist filetypes.

autocmd FileType nerdtree setlocal norelativenumber
autocmd FileType taglist setlocal norelativenumber

(Note, that here setlocal is used to switch the option only for current window.)

ib
Thanks that does just what I wanted.
skeept