From 8bf91f30318f8f6747fe88fd7cf2bdaa27032dcf Mon Sep 17 00:00:00 2001 From: Ekaitz Zárraga Date: Thu, 10 Mar 2016 21:37:42 +0100 Subject: Markdown auto-capitalisation --- vim/.vim/ftplugin/markdown.vim | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'vim/.vim/ftplugin/markdown.vim') diff --git a/vim/.vim/ftplugin/markdown.vim b/vim/.vim/ftplugin/markdown.vim index 8abe28a..1767a80 100644 --- a/vim/.vim/ftplugin/markdown.vim +++ b/vim/.vim/ftplugin/markdown.vim @@ -12,3 +12,9 @@ setlocal formatoptions+=t " Highlight where the lines are more than 80 characters wide setlocal colorcolumn=80 highlight ColorColumn ctermbg=LightGreen + +" Auto-capitalize script +augroup SENTENCES + au! + autocmd InsertCharPre * if search('\v(%^|[.!?]\_s+|\_^\-\s|\_^title\:\s|\n\n)%#', 'bcnw') != 0 | let v:char = toupper(v:char) | endif +augroup END -- cgit v1.2.3