install.fairie/dotfiles/.vim/plugged/dockerfile.vim/indent/Dockerfile.vim
Git E2E Dev Test Username 76b2929ec8 git subrepo clone (merge) https://github.com/ekalinin/dockerfile.vim.git ./dotfiles/.vim/plugged/dockerfile.vim
subrepo:
  subdir:   "dotfiles/.vim/plugged/dockerfile.vim"
  merged:   "2a31e6bc"
upstream:
  origin:   "https://github.com/ekalinin/dockerfile.vim.git"
  branch:   "master"
  commit:   "2a31e6bc"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"
2022-10-18 10:36:24 -04:00

23 lines
474 B
VimL

if exists('b:did_indent') | finish | endif
let b:did_indent = 1
function! DockerfileIndent(line)
let prev_line = getline(a:line - 1)
if a:line > 1 && prev_line =~ '\\\s*$'
let i = indent(a:line - 1)
if i == 0
let i += &l:shiftwidth
if &l:expandtab && prev_line =~# '^RUN\s'
" Overindent past RUN
let i = 4 + &l:shiftwidth
endif
endif
return i
endif
return -1
endfunction
set indentexpr=DockerfileIndent(v:lnum)