aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile9
-rw-r--r--VERSION4
-rw-r--r--vim/ftplugin/markdown.vim43
-rw-r--r--vim/ftplugin/markdown/autoformat.vim (renamed from vim/after/ftplugin/markdown/autoformat.vim)6
-rw-r--r--vim/ftplugin/markdown/spell.vim (renamed from vim/after/ftplugin/markdown/spell.vim)0
-rw-r--r--vim/ftplugin/php.vim2
-rw-r--r--vim/ftplugin/php/check.vim (renamed from vim/after/ftplugin/php/check.vim)0
7 files changed, 56 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index fd08950d..134935ae 100644
--- a/Makefile
+++ b/Makefile
@@ -546,8 +546,13 @@ install-vim-ftdetect:
cp -p -- vim/ftdetect/*.vim $(VIMDIR)/ftdetect
install-vim-ftplugin:
- mkdir -p -- $(VIMDIR)/ftplugin
- cp -p -- vim/ftplugin/*.vim $(VIMDIR)/ftplugin
+ mkdir -p $(VIMDIR)/ftplugin
+ find vim/ftplugin \
+ -type d -exec sh -c \
+ 'mkdir -p -- $(VIMDIR)/"$${1#vim/}"' _ {} \; \
+ -o \
+ -type f -exec sh -c \
+ 'cp -p -- "$$1" $(VIMDIR)/"$${1#vim/}"' _ {} \;
install-vim-indent:
mkdir -p -- $(VIMDIR)/indent
diff --git a/VERSION b/VERSION
index abe82ea1..15dfadf5 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-tejr dotfiles v0.45.0
-Mon Jun 4 10:06:44 UTC 2018
+tejr dotfiles v0.46.0
+Mon Jun 4 10:44:39 UTC 2018
diff --git a/vim/ftplugin/markdown.vim b/vim/ftplugin/markdown.vim
new file mode 100644
index 00000000..2bd27d14
--- /dev/null
+++ b/vim/ftplugin/markdown.vim
@@ -0,0 +1,43 @@
+"
+" Replace Vim's stock Markdown filetype plugin, reimplementing only the part I
+" actually need: the options settings. I don't use the folding, anyway.
+"
+" 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
+
+" Set comment/quote patterns
+setlocal comments=fb:*,fb:-,fb:+,n:>
+setlocal commentstring=>\ %s
+
+" Set format options
+setlocal formatoptions+=tcqln
+setlocal formatoptions-=ro
+
+" Set list format patterns
+let &l:formatlistpat = '^\s*\d\+\.\s\+\'
+ \ .'\|^[-*+]\s\+\'
+ \ .'\|^\[^\ze[^\]]\+\]:'
+
+" Define how to undo this plugin's settings
+let b:undo_ftplugin = 'setlocal comments<'
+ \ . '|setlocal commentstring<'
+ \ . '|setlocal formatoptions<'
+ \ . '|setlocal formatlistpat<'
+
+" Restore 'cpoptions' setting if we touched it
+if exists('s:cpoptions_save')
+ let &cpoptions = s:cpoptions_save
+ unlet s:cpoptions_save
+endif
diff --git a/vim/after/ftplugin/markdown/autoformat.vim b/vim/ftplugin/markdown/autoformat.vim
index 3f620691..80bd034c 100644
--- a/vim/after/ftplugin/markdown/autoformat.vim
+++ b/vim/ftplugin/markdown/autoformat.vim
@@ -18,7 +18,7 @@ endif
" * Longer than 'textwidth'
" * Contains at least one space (not an unsplittable line)
" * Not a code block (indented with at least four spaces)
-if !has('*s:Load')
+if !exists('*s:Load')
function! s:Load() abort
let l:width = &textwidth ? &textwidth : 79
let l:count = 0
@@ -41,7 +41,7 @@ endif
call s:Load()
" Suspend auto-formatting when in a code block (four-space indent)
-if !has('*s:Line')
+if !exists('*s:Line')
function! s:Line() abort
if getline('.') =~# '\m^ '
if &formatoptions =~# '\ma'
@@ -62,7 +62,7 @@ augroup ftplugin_markdown_autoformat
augroup END
" Suspend auto-format when pasting anything with a linebreak
-if !has('*s:Put')
+if !exists('*s:Put')
function! s:Put(above) abort
let l:suspended = 0
if &formatoptions =~# '\ma' && getreg() =~# '\m\n'
diff --git a/vim/after/ftplugin/markdown/spell.vim b/vim/ftplugin/markdown/spell.vim
index 05fc7c00..05fc7c00 100644
--- a/vim/after/ftplugin/markdown/spell.vim
+++ b/vim/ftplugin/markdown/spell.vim
diff --git a/vim/ftplugin/php.vim b/vim/ftplugin/php.vim
index b545e18a..39cec4b1 100644
--- a/vim/ftplugin/php.vim
+++ b/vim/ftplugin/php.vim
@@ -1,6 +1,6 @@
"
" Replace Vim's stock PHP filetype plugin, reimplementing only the part I
-" actually need (the matchit.vim keyword pairs).
+" 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
diff --git a/vim/after/ftplugin/php/check.vim b/vim/ftplugin/php/check.vim
index 33077a72..33077a72 100644
--- a/vim/after/ftplugin/php/check.vim
+++ b/vim/ftplugin/php/check.vim