From b0124dc88082f5ed8c96faa16d3b334d38f5949f Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Fri, 4 Sep 2020 19:45:47 +0200 Subject: [PATCH] Ignore files from homedir and root for indent https://github.com/tpope/vim-sleuth/pull/57 --- plugin/polyglot.vim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugin/polyglot.vim b/plugin/polyglot.vim index fad7609b9..762e4fcd5 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] == "."