summaryrefslogtreecommitdiff
path: root/vim/.vim
diff options
context:
space:
mode:
authorEkaitz Zárraga <ekaitz.zarraga@gmail.com>2016-03-10 21:37:42 +0100
committerEkaitz Zárraga <ekaitz.zarraga@gmail.com>2016-03-10 21:37:42 +0100
commit8bf91f30318f8f6747fe88fd7cf2bdaa27032dcf (patch)
tree0005bb8235f333cf2a0482e8bfd93a3c8ff42455 /vim/.vim
parentd129d85c06e5f602d069e63eb8149afb4c2f20c0 (diff)
Markdown auto-capitalisation
Diffstat (limited to 'vim/.vim')
-rw-r--r--vim/.vim/ftplugin/markdown.vim6
1 files changed, 6 insertions, 0 deletions
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