From cbb3462e46ecee94e8472404e45e344e5ad864c2 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 26 Jan 2018 12:24:45 +1300 Subject: Remove help ftdetect rules No longer applicable since pathogen.vim was removed in 3e2740f. --- vim/ftdetect/help.vim | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 vim/ftdetect/help.vim diff --git a/vim/ftdetect/help.vim b/vim/ftdetect/help.vim deleted file mode 100644 index b516ed7e..00000000 --- a/vim/ftdetect/help.vim +++ /dev/null @@ -1,4 +0,0 @@ -" Custom Vim help documentation filetype detection -autocmd BufNewFile,BufRead - \ **/vim/**/doc/*.txt,**/.vim/**/doc/*.txt - \ setlocal filetype=help -- cgit v1.2.3 From 9ca75421a60362f5a1ebc2c42d208f832f83de16 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 1 Feb 2018 17:57:02 +1300 Subject: Adjust explanation of PHP indent skip Include the variable guard, just for completeness' sake. --- vim/indent/php.vim | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/vim/indent/php.vim b/vim/indent/php.vim index d0fb1f8f..6a61f105 100644 --- a/vim/indent/php.vim +++ b/vim/indent/php.vim @@ -1,4 +1,10 @@ -" Lie to the php.vim indent file and tell it that it's already loaded itself, -" to stop it processing its ridiculous expression-based indenting that never -" seems to do what I want. Just plain autoindent is fine. +" Replace Vim's stock PHP indent rules. They're very complicated and don't +" work in a predictable way. +if exists('b:did_indent') + finish +endif let b:did_indent = 1 + +" Easier just to use 'autoindent'; not perfect, but predictable. +setlocal autoindent +let b:undo_indent = 'setlocal autoindent<' -- cgit v1.2.3 From 3234d03ed04f52fdfa00a932978a548019212365 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 1 Feb 2018 17:57:35 +1300 Subject: Replace ftplugin/php.vim with custom version Per the comment in the new file, this is to avoid loading in HTML ftplugins as well, a curiosity of the stock ftplugin/php.vim file that's probably a well-intentioned way of accommodating templated files with a mix of PHP and HTML in them. --- Makefile | 6 ++++++ vim/ftplugin/php.vim | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 vim/ftplugin/php.vim diff --git a/Makefile b/Makefile index 13a7db7a..70209907 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,7 @@ install-vim-compiler \ install-vim-config \ install-vim-ftdetect \ + install-vim-fplugin \ install-vim-gui \ install-vim-gui-config \ install-vim-indent \ @@ -503,6 +504,7 @@ install-vim: install-vim-after \ install-vim-config \ install-vim-doc \ install-vim-ftdetect \ + install-vim-ftplugin \ install-vim-indent \ install-vim-plugin @@ -554,6 +556,10 @@ install-vim-ftdetect: mkdir -p -- $(HOME)/.vim/ftdetect cp -p -- vim/ftdetect/*.vim $(HOME)/.vim/ftdetect +install-vim-ftplugin: + mkdir -p -- $(HOME)/.vim/ftplugin + cp -p -- vim/ftplugin/*.vim $(HOME)/.vim/ftplugin + install-vim-indent: mkdir -p -- $(HOME)/.vim/indent cp -p -- vim/indent/*.vim $(HOME)/.vim/indent diff --git a/vim/ftplugin/php.vim b/vim/ftplugin/php.vim new file mode 100644 index 00000000..b545e18a --- /dev/null +++ b/vim/ftplugin/php.vim @@ -0,0 +1,38 @@ +" +" Replace Vim's stock PHP filetype plugin, reimplementing only the part I +" actually need (the matchit.vim keyword pairs). +" +" This is mostly because the stock file pulls in HTML's filetype plugins too, +" without providing a variable check to stop it. That causes absurd problems +" with defining HTML checkers/linters in the rest of my files. +" +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +" Support line continuation for this file +if &compatible + let s:cpoptions_save = &cpoptions + set cpoptions-=C +endif + +" Define keywords for matchit.vim +if exists('g:loaded_matchit') + let b:match_words = '' + \ . ',\:\' + \ . ',\:\' + \ . ',\:\' + \ . ',\:\:\:\' + \ . ',\:\' + \ . ',\:\' +endif + +" Define how to undo this plugin's settings +let b:undo_ftplugin = 'unlet b:match_words' + +" Restore 'cpoptions' setting if we touched it +if exists('s:cpoptions_save') + let &cpoptions = s:cpoptions_save + unlet s:cpoptions_save +endif -- cgit v1.2.3 From dc0fbcefde773d6637653cc6042113a3753071d4 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 1 Feb 2018 18:03:22 +1300 Subject: Bump version to 0.27.0 --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 241130bb..41c18b26 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -tejr dotfiles v0.26.3 -Thu Jan 25 21:25:28 UTC 2018 +tejr dotfiles v0.27.0 +Thu Feb 1 05:03:14 UTC 2018 -- cgit v1.2.3