From c92b0b0bdab2bf4a284d1631c3f8d33cc4979aa0 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 3 Jun 2018 15:19:19 +1200 Subject: Remove accidentally committed ";" file --- vim/ftdetect/; | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 vim/ftdetect/; diff --git a/vim/ftdetect/; b/vim/ftdetect/; deleted file mode 100644 index f57ba0e6..00000000 --- a/vim/ftdetect/; +++ /dev/null @@ -1,12 +0,0 @@ -" PHP files -autocmd BufNewFile,BufRead - \ *.php - \ setfiletype php -autocmd BufNewFile,BufRead - \ * - \ if getline(1) =~# '\m^#!.\' - \ | setfiletype php - \ | endif - \ | if getline(1) =~? '\m^' - \ | setfiletype php - \ | endif -- cgit v1.2.3 From 306eaf37ef79df27a61c01bd1f18fcffed12a682 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 3 Jun 2018 16:07:52 +1200 Subject: Vim ftplugin: hold autoformat in *.md code blocks --- vim/after/ftplugin/markdown/suspend_autoformat.vim | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 vim/after/ftplugin/markdown/suspend_autoformat.vim diff --git a/vim/after/ftplugin/markdown/suspend_autoformat.vim b/vim/after/ftplugin/markdown/suspend_autoformat.vim new file mode 100644 index 00000000..b2de7828 --- /dev/null +++ b/vim/after/ftplugin/markdown/suspend_autoformat.vim @@ -0,0 +1,34 @@ +" Only do this when not done yet for this buffer +" Also do nothing if 'compatible' enabled, or if no autocmd feature, or if Vim +" is too old to support the needed autocmd events +if exists('b:did_ftplugin_markdown_suspend_autoformat') || &compatible + finish +endif +if !has('autocmd') || v:version < 700 + finish +endif +let b:did_ftplugin_markdown_suspend_autoformat = 1 +if exists('b:undo_ftplugin') + let b:undo_ftplugin = b:undo_ftplugin + \ . '|unlet b:did_ftplugin_markdown_suspend_autoformat' +endif + +" When editing a code block, quietly remove auto 'a' from 'formatoptions' if +" present, flagging that we've done so; restore it once we move away. +autocmd BufWinEnter,CursorMoved,CursorMovedI,WinEnter + \ + \ if getline('.') =~# '\m^ ' + \ | if &formatoptions =~# '\ma' + \ | setlocal formatoptions-=a + \ | let b:markdown_suspend_autoformat_suspended = 1 + \ | endif + \ | elseif exists('b:markdown_suspend_autoformat_suspended') + \ | setlocal formatoptions+=a + \ | unlet b:markdown_suspend_autoformat_suspended + \ | endif + +" Undo all the above +if exists('b:undo_ftplugin') + let b:undo_ftplugin = b:undo_ftplugin + \ . '|setlocal formatoptions<' +endif -- cgit v1.2.3 From 34adfe6c10277c2c4f499a0bb113190120076900 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 3 Jun 2018 16:18:54 +1200 Subject: Correct logic of Markdown/text spell checking --- vim/after/ftplugin/markdown/spell.vim | 16 +++++++++------- vim/after/ftplugin/text/spell.vim | 16 +++++++++------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/vim/after/ftplugin/markdown/spell.vim b/vim/after/ftplugin/markdown/spell.vim index bb344374..05fc7c00 100644 --- a/vim/after/ftplugin/markdown/spell.vim +++ b/vim/after/ftplugin/markdown/spell.vim @@ -1,8 +1,12 @@ " Only do this when not done yet for this buffer -" Also do nothing if 'compatible' enabled +" Also do nothing if 'compatible' enabled, or if the 'spell' feature isn't +" available if exists('b:did_ftplugin_markdown_spell') || &compatible finish endif +if !has('spell') + finish +endif let b:did_ftplugin_markdown_spell = 1 if exists('b:undo_ftplugin') let b:undo_ftplugin = b:undo_ftplugin @@ -10,10 +14,8 @@ if exists('b:undo_ftplugin') endif " Spellcheck documents by default -if has('syntax') - setlocal spell - if exists('b:undo_ftplugin') - let b:undo_ftplugin = b:undo_ftplugin - \ . '|setlocal spell<' - endif +setlocal spell +if exists('b:undo_ftplugin') + let b:undo_ftplugin = b:undo_ftplugin + \ . '|setlocal spell<' endif diff --git a/vim/after/ftplugin/text/spell.vim b/vim/after/ftplugin/text/spell.vim index 322090ca..73ca5486 100644 --- a/vim/after/ftplugin/text/spell.vim +++ b/vim/after/ftplugin/text/spell.vim @@ -1,8 +1,12 @@ " Only do this when not done yet for this buffer -" Also do nothing if 'compatible' enabled +" Also do nothing if 'compatible' enabled, or if the 'spell' feature isn't +" available if exists('b:did_ftplugin_text_spell') || &compatible finish endif +if !has('spell') + finish +endif let b:did_ftplugin_text_spell = 1 if exists('b:undo_ftplugin') let b:undo_ftplugin = b:undo_ftplugin @@ -10,10 +14,8 @@ if exists('b:undo_ftplugin') endif " Spellcheck documents by default -if has('syntax') - setlocal spell - if exists('b:undo_ftplugin') - let b:undo_ftplugin = b:undo_ftplugin - \ . '|setlocal spell<' - endif +setlocal spell +if exists('b:undo_ftplugin') + let b:undo_ftplugin = b:undo_ftplugin + \ . '|setlocal spell<' endif -- cgit v1.2.3 From 987354de38aaece47689b71bf3e23c20409d453c Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 3 Jun 2018 16:28:30 +1200 Subject: Bump VERSION --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index dcd68db6..ac11890d 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -tejr dotfiles v0.43.0 -Sun Jun 3 00:51:04 UTC 2018 +tejr dotfiles v0.44.0 +Sun Jun 3 04:28:13 UTC 2018 -- cgit v1.2.3