From c2638d3719cbaafd7eb3546b1c8ab597d9522837 Mon Sep 17 00:00:00 2001 From: surtur Date: Fri, 12 Aug 2022 20:59:51 +0200 Subject: [PATCH] vimrc: conditionally add include dirs for c/cpp --- .vim/vimrc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.vim/vimrc b/.vim/vimrc index ad2261b..168ae44 100644 --- a/.vim/vimrc +++ b/.vim/vimrc @@ -1011,6 +1011,17 @@ endif endfunction nnoremap hh :call HeaderToggle() +if(&filetype ==# 'c') || (&filetype ==# 'cpp') + if isdirectory('include') + set path+=include + elseif isdirectory('inc') + set path+=inc + elseif isdirectory('src/include') + set path+=src/include + endif +endif + + silent function! LINUX() return has('unix') && !has('macunix') && !has('win32unix') endfunction