neovim: only set line number for actual file buffers

This commit is contained in:
Peter Cai 2022-08-07 14:08:01 -04:00
parent ce8405840f
commit 28d1ed543a
1 changed files with 9 additions and 1 deletions

View File

@ -18,7 +18,6 @@ colorscheme gruvbox-material
" Miscellaneous boilerplate
set nocompatible " Disable vi compatibility
set ignorecase
set nu " Line numbers
set cc=80 " 80 characters
set noswapfile
set backupdir=~/.cache/nvim
@ -35,5 +34,14 @@ set autoindent
" Syntax highlighting
set syntax=on
" Show line numbers on non-toolbar buffers
fun! ShowNumberIfNecessary()
if &ft =~ 'neo-tree'
return
endif
setlocal nu
endfun
autocmd BufEnter * call ShowNumberIfNecessary()
" Startup commands
autocmd UIEnter * Neotree