From 3bff9be48a3c6edc3b4bffe7123a8e8072831271 Mon Sep 17 00:00:00 2001 From: Michael Campagnaro Date: Wed, 3 Jul 2024 14:20:48 -0400 Subject: [PATCH] Don't run ctags in vim if in home directory --- .vimrc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.vimrc b/.vimrc index 8d07aef..f6c08ec 100644 --- a/.vimrc +++ b/.vimrc @@ -686,16 +686,19 @@ fu! CreateCtags() return endif - " Abort if we're editing a text file. This won't be an exhaustive - " filter. We can restrict what goes into the tag file - " First determine if we're in a root drive directory. If we are then - " we bail because we don't want to recurse across the entire drive! + " Abort if the file is in a root drive directory because we don't want to recurse across the entire drive! let l:path = expand('%:p:h') if IsRootDrive(l:path) call PrintError("Not going to run ctags because the file is in a root drive directory") return endif + " Abort if the file is in the home directory for the same reason as above. + if l:path == expand('$HOME') + call PrintError("Not going to run ctags because the file is in the home directory") + return + endif + " Always ignore .git and node_modules let g:campo_ctags_exclude = g:campo_ctags_exclude + ['.git', 'node_modules'] let l:exclude_list = ""