aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-02-01 17:57:02 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-02-01 17:57:02 +1300
commit9ca75421a60362f5a1ebc2c42d208f832f83de16 (patch)
tree9bcf0f475c27dfebe0b5eb6c9f0c2fcd19ae54f3
parentMerge branch 'feature/vim-ftdetect' into develop (diff)
downloaddotfiles-9ca75421a60362f5a1ebc2c42d208f832f83de16.tar.gz
dotfiles-9ca75421a60362f5a1ebc2c42d208f832f83de16.zip
Adjust explanation of PHP indent skip
Include the variable guard, just for completeness' sake.
-rw-r--r--vim/indent/php.vim12
1 files 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<'