diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-22 16:59:28 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-22 17:06:36 +1200 |
commit | 9929ca9ec20867cc910bf6b17839ee20dcd35f46 (patch) | |
tree | 9d0803f2fb8401832589d378fbf16cf5567fb63e /vim/after/ftplugin | |
parent | Beginnings of new alternate_filetypes.vim plugin (diff) | |
download | dotfiles-9929ca9ec20867cc910bf6b17839ee20dcd35f46.tar.gz dotfiles-9929ca9ec20867cc910bf6b17839ee20dcd35f46.zip |
Round out and apply alternate filetypes plugin
This is a good one.
Diffstat (limited to 'vim/after/ftplugin')
-rw-r--r-- | vim/after/ftplugin/html.vim | 5 | ||||
-rw-r--r-- | vim/after/ftplugin/php.vim | 11 |
2 files changed, 3 insertions, 13 deletions
diff --git a/vim/after/ftplugin/html.vim b/vim/after/ftplugin/html.vim index 027fed1f..7866f31b 100644 --- a/vim/after/ftplugin/html.vim +++ b/vim/after/ftplugin/html.vim @@ -41,8 +41,3 @@ endif nnoremap <buffer> <LocalLeader>r \ :<C-U>call html#UrlLink()<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' diff --git a/vim/after/ftplugin/php.vim b/vim/after/ftplugin/php.vim index 3b023f9e..c7f77ece 100644 --- a/vim/after/ftplugin/php.vim +++ b/vim/after/ftplugin/php.vim @@ -21,12 +21,7 @@ let b:undo_ftplugin .= '|setlocal keywordprg<' let b:regex_escape_flavor = 'ere' let b:undo_ftplugin .= '|unlet b:regex_escape_flavor' -" Stop here if the user doesn't want ftplugin mappings -if exists('no_plugin_maps') || exists('no_php_maps') - finish +" Set HTML as an alternative filetype +if !exists('b:alternate_filetypes') + let b:alternate_filetypes = [&filetype, 'html'] endif - -" Switch to HTML filetype for templated PHP -nnoremap <buffer> <LocalLeader>f - \ :<C-U>setlocal filetype=html<CR> -let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>f' |