aboutsummaryrefslogtreecommitdiff
path: root/vim/after/ftplugin/html.vim
diff options
context:
space:
mode:
Diffstat (limited to 'vim/after/ftplugin/html.vim')
-rw-r--r--vim/after/ftplugin/html.vim19
1 files changed, 10 insertions, 9 deletions
diff --git a/vim/after/ftplugin/html.vim b/vim/after/ftplugin/html.vim
index 93845a80..21a84a42 100644
--- a/vim/after/ftplugin/html.vim
+++ b/vim/after/ftplugin/html.vim
@@ -1,4 +1,10 @@
-" Spellcheck documents we're actually editing (not just viewing)
+" None of this is appropriate for other filetypes that are just sourcing this
+" filetype's scripts in, e.g. Markdown, PHP, so cut that off here
+if &filetype !=# 'html'
+ finish
+endif
+
+" Check the spelling of documents we're actually editing (not just viewing)
if &modifiable && !&readonly
setlocal spell
let b:undo_ftplugin .= '|setlocal spell<'
@@ -13,14 +19,14 @@ let b:undo_ftplugin .= '|unlet b:current_compiler'
" it; we map \= to do the former, but don't actually set 'equalprg' for the
" latter, instead falling back on the good-enough built-in Vim indentation
" behavior
-nnoremap <buffer> <Leader>= :<C-U>call html#TidyBuffer()<CR>
+nnoremap <buffer> <Leader>= :<C-U>call html#Tidy()<CR>
let b:undo_ftplugin .= '|nunmap <buffer> <Leader>='
" Set up hooks for timestamp updating
augroup html_timestamp
autocmd BufWritePre <buffer>
\ if exists('b:html_timestamp_check')
- \| call html#TimestampUpdate()
+ \| call html#timestamp#Update()
\|endif
augroup END
let b:undo_ftplugin .= '|execute ''autocmd! html_timestamp'''
@@ -33,10 +39,5 @@ endif
" Transform URLs to HTML anchors
nnoremap <buffer> <LocalLeader>r
- \ :<C-U>call html#UrlLink()<CR>
+ \ :<C-U>call html#url#Anchor()<CR>
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>r'
-
-" Switch to PHP filetype for templated PHP
-nnoremap <buffer> <LocalLeader>f
- \ :<C-U>setlocal filetype=php<CR>
-let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>f'