nvim-treesitter/after/ftdetect/foam.vim

14 lines
326 B
VimL
Raw Normal View History

2021-12-14 13:45:56 +01:00
" Last Change: 2021 Dec 13
function! s:foamFile(path)
let l:lines = getline(1, 10)
for line in lines
if match(line, 'FoamFile') >= 0
set filetype=foam
endif
endfor
endfunction
autocmd BufNewFile,BufRead * call s:foamFile(expand("%"))
autocmd FileType cpp call s:foamFile(expand("%"))