diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-12-19 11:45:14 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-12-19 11:45:14 +1300 |
commit | b6d06394afdf314540399c68b9540c0715ada8d6 (patch) | |
tree | 4e2a93d0ba7909060f53139912f5977616718940 | |
parent | Merge branch 'release/v3.3.0' into develop (diff) | |
download | dotfiles-b6d06394afdf314540399c68b9540c0715ada8d6.tar.gz dotfiles-b6d06394afdf314540399c68b9540c0715ada8d6.zip |
Make <LocalLeader>f to toggle HTML/PHP
I'm thinking I might make this a generic mapping for "alternate
filetype".
-rw-r--r-- | vim/after/ftplugin/html.vim | 5 | ||||
-rw-r--r-- | vim/after/ftplugin/php.vim | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/vim/after/ftplugin/html.vim b/vim/after/ftplugin/html.vim index 5f7155bc..c4f2e35e 100644 --- a/vim/after/ftplugin/html.vim +++ b/vim/after/ftplugin/html.vim @@ -33,3 +33,8 @@ 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 688166ba..ee0ce5c8 100644 --- a/vim/after/ftplugin/php.vim +++ b/vim/after/ftplugin/php.vim @@ -16,3 +16,8 @@ let b:undo_ftplugin .= '|setlocal keywordprg<' if exists('g:no_plugin_maps') || exists('g:no_php_maps') finish 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' |