1
0
Fork 0
mirror of https://github.com/vim/vim synced 2025-03-21 17:25:11 +01:00
vim/runtime/ftplugin/html.vim

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

61 lines
1.9 KiB
VimL
Raw Normal View History

2004-06-13 20:20:40 +00:00
" Vim filetype plugin file
2022-07-25 15:42:07 +01:00
" Language: HTML
" Maintainer: Doug Kearns <dougkearns@gmail.com>
" Previous Maintainer: Dan Sharp
" Last Change: 2024 Jan 14
" 2024 May 24 by Riley Bruins <ribru17@gmail.com> ('commentstring')
2022-07-25 15:42:07 +01:00
if exists("b:did_ftplugin")
finish
endif
2004-06-13 20:20:40 +00:00
let b:did_ftplugin = 1
let s:save_cpo = &cpo
set cpo-=C
2008-06-24 20:39:31 +00:00
setlocal matchpairs+=<:>
setlocal commentstring=<!--\ %s\ -->
2008-08-06 17:06:04 +00:00
setlocal comments=s:<!--,m:\ \ \ \ ,e:-->
2022-07-25 15:42:07 +01:00
let b:undo_ftplugin = "setlocal comments< commentstring< matchpairs<"
if get(g:, "ft_html_autocomment", 0)
setlocal formatoptions-=t formatoptions+=croql
let b:undo_ftplugin ..= " | setlocal formatoptions<"
2008-08-06 17:06:04 +00:00
endif
2006-04-27 00:02:13 +00:00
if exists('&omnifunc')
2014-06-25 18:50:27 +02:00
setlocal omnifunc=htmlcomplete#CompleteTags
call htmlcomplete#DetectOmniFlavor()
2022-07-25 15:42:07 +01:00
let b:undo_ftplugin ..= " | setlocal omnifunc<"
2006-04-27 00:02:13 +00:00
endif
2006-04-23 22:40:29 +00:00
2022-07-25 15:42:07 +01:00
" HTML: thanks to Johannes Zellner and Benji Fisher.
if exists("loaded_matchit") && !exists("b:match_words")
let b:match_ignorecase = 1
let b:match_words = '<!--:-->,' ..
\ '<:>,' ..
\ '<\@<=[ou]l\>[^>]*\%(>\|$\):<\@<=li\>:<\@<=/[ou]l>,' ..
\ '<\@<=dl\>[^>]*\%(>\|$\):<\@<=d[td]\>:<\@<=/dl>,' ..
\ '<\@<=\([^/!][^ \t>]*\)[^>]*\%(>\|$\):<\@<=/\1>'
let b:html_set_match_words = 1
let b:undo_ftplugin ..= " | unlet! b:match_ignorecase b:match_words b:html_set_match_words"
2004-06-13 20:20:40 +00:00
endif
" Change the :browse e filter to primarily show HTML-related files.
2022-07-25 15:42:07 +01:00
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
let b:browsefilter = "HTML Files (*.html, *.htm)\t*.html;*.htm\n" ..
2022-07-25 15:42:07 +01:00
\ "JavaScript Files (*.js)\t*.js\n" ..
\ "Cascading StyleSheets (*.css)\t*.css\n"
if has("win32")
let b:browsefilter ..= "All Files (*.*)\t*\n"
else
let b:browsefilter ..= "All Files (*)\t*\n"
endif
2022-07-25 15:42:07 +01:00
let b:html_set_browsefilter = 1
let b:undo_ftplugin ..= " | unlet! b:browsefilter b:html_set_browsefilter"
2004-06-13 20:20:40 +00:00
endif
let &cpo = s:save_cpo
unlet s:save_cpo