1

I like the relativenumbers, but they turn out to be slow if I move through files with very long lines. So I added

autocmd CursorMoved,CursorMovedI * if &relativenumber | set norelativenumber | endif
autocmd CursorHold,CursorHoldI * set relativenumber
set updatetime=500

to my vimrc. It disables relative numbers during cursor movement and enables them afterwards again. However, this also enables them in ctrlp. Especially since ctrlp disables number, this causes columns to jump as soon as I cursor. Is there a way to detect, if I'm currently in the curlp file browser?

iGEL
  • 16,540
  • 11
  • 60
  • 74

1 Answers1

2

The CtrlP scratch buffer probably has a distinct name (if bufname('') =~ 'ctrlp')) or filetype (if &filetype ==# 'ctrlp') that you can use in a condition on a similar autocmd BufEnter.

(Note: I don't use the plugin, so the above names are just for illustration.)

Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324