mirror of
https://github.com/zoriya/vim-helm.git
synced 2025-12-06 06:46:11 +00:00
14 lines
497 B
VimL
14 lines
497 B
VimL
function! s:isHelm()
|
|
let filepath = expand("%:p")
|
|
let filename = expand("%:t")
|
|
if filepath =~ '\v/(templates|charts)/.*\.(ya?ml|gotmpl|tpl|txt)$' | return 1 | en
|
|
if filename =~ '\v(helmfile).ya?ml' | return 1 | en
|
|
if filepath !~ '\v^\w+://' && !empty(findfile("Chart.yaml", expand('%:p:h').';')) | return 1 | en
|
|
return 0
|
|
endfunction
|
|
|
|
autocmd BufRead,BufNewFile * if s:isHelm() | set ft=helm | en
|
|
|
|
" Use {{/* */}} as comments
|
|
autocmd FileType helm setlocal commentstring={{/*\ %s\ */}}
|