Skip to content

Commit 1eda89d

Browse files
authored
Merge pull request #215 from DanaLacoste/shell_spaces
shfmt supports spaces, so let's avoid tabs
2 parents 270c1c0 + 7b5f7ac commit 1eda89d

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

vimrc

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -578,19 +578,16 @@ function s:EnableShfmt()
578578
endif
579579
let l:git_cmd = 'git -C ' . l:git_dir . ' rev-parse --show-toplevel 2>/dev/null'
580580
let l:git_root = substitute(system(l:git_cmd), '\n\+$', '', '')
581+
augroup shells
582+
autocmd!
583+
autocmd FileType sh setlocal expandtab
584+
augroup END
581585
if v:shell_error == 0 && filereadable(l:git_root . '/.shfmt_disable')
582-
augroup shells
583-
autocmd!
584-
autocmd FileType sh setlocal expandtab
585-
augroup END
586586
if has_key(g:ale_fixers, 'sh')
587587
unlet g:ale_fixers.sh
588588
endif
589589
else
590-
augroup shells
591-
autocmd!
592-
autocmd FileType sh setlocal noexpandtab
593-
augroup END
590+
let g:ale_sh_shfmt_options = "-i 2"
594591
let g:ale_fixers.sh = ['shfmt']
595592
endif
596593
endfunction

0 commit comments

Comments
 (0)