autofill new html files with a skeleton template, like other file types

Generated by Mistral Vibe.
This commit is contained in:
hugogogo
2026-10-30 11:25:23 +01:00
parent 0b7eff9a89
commit 9b1ddd2eeb
4 changed files with 22 additions and 6 deletions
+5 -6
View File
@@ -224,6 +224,10 @@ endfunction
function! TESTSFile()
silent! 0r $HOME/.vim/templates/skeleton_tests.hpp
endfunction
" to autofill a new html file
function! HTMLFile()
silent! 0r $HOME/.vim/templates/skeleton.html
endfunction
" autofill calls
autocmd BufNewFile *.hpp call HPPFile()
@@ -231,6 +235,7 @@ autocmd BufNewFile *.cpp if @% == 'main.cpp' | call MAINCPPFile() | else | call
autocmd BufNewFile Makefile call MAKEFile()
autocmd BufNewFile colors.h call COLORFile()
autocmd BufNewFile tests.hpp call TESTSFile()
autocmd BufNewFile *.html call HTMLFile()
" ---------------------------------------------------------------------
" pour mettre en gras dans des fichiers txt
@@ -253,9 +258,3 @@ au filetype text syn match Asterisks contained "\*\*" conceal
au filetype text syn match EscapedAsterisks contained "\\" conceal
au filetype text syn match AsteriskBold "\*\*.*\*\*" contains=Asterisks,EscapedAsterisks
" ---------------------------------------------------------------------
" remplis les elements de base d'un fichier html
" ---------------------------------------------------------------------
command! Html 0s/^/<!DOCTYPE html>\r<html lang="en" dir="ltr">\r\t<head>\r\t\t<meta charset="UTF-8">\r\t\t<meta name="viewport" content="width=device-width, initial-scale=1.0">\r\t\t<title><\/title>\r\t\t<meta name="description" content="description du site web">\r\t\t<meta name="keywords" content="truc, bidule, chouette">\r\t\t<link href=".\/style.css" type="text\/css" rel="stylesheet">\r\t\t<script type="text\/javascript" src="script.js" defer><\/script>\r\t<\/head>\r\t<body>\r\r\t<\/body>\r<\/html>
+15
View File
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<meta name="description" content="description du site web">
<meta name="keywords" content="truc, bidule, chouette">
<link href="./style.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="script.js" defer></script>
</head>
<body>
</body>
</html>
+1
View File
@@ -173,6 +173,7 @@ if [ "$CONFIG_VIM" = "y" ]; then
install "$HOME/.vim/templates/skeleton.hpp"
install "$HOME/.vim/templates/skeleton_main.cpp"
install "$HOME/.vim/templates/skeleton_makefile"
install "$HOME/.vim/templates/skeleton.html"
else
echo "skip vim"
fi
+1
View File
@@ -82,3 +82,4 @@ uninstall "$HOME/.vim/templates/skeleton.cpp"
uninstall "$HOME/.vim/templates/skeleton.hpp"
uninstall "$HOME/.vim/templates/skeleton_main.cpp"
uninstall "$HOME/.vim/templates/skeleton_makefile"
uninstall "$HOME/.vim/templates/skeleton.html"