summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugin/polyglot.vim4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugin/polyglot.vim b/plugin/polyglot.vim
index fad7609b..762e4fcd 100644
--- a/plugin/polyglot.vim
+++ b/plugin/polyglot.vim
@@ -138,6 +138,10 @@ function! s:detect_indent() abort
let dir = expand('%:p:h')
let level = 3
while isdirectory(dir) && dir !=# fnamemodify(dir, ':h') && level > 0
+ " Ignore files from homedir and root
+ if dir == expand('~') || dir == '/'
+ return
+ endif
for neighbor in glob(dir . '/' . pattern, 0, 1)[0:level]
" Do not consider directories above .git, .svn or .hg
if fnamemodify(neighbor, ":h:t")[0] == "."