A Vim script that checks capital letters and makes necessary corrections

Solution 1:

Give this a try:

%s/\(^\|[.?!] \+\)./\U&/g

Explanation:

`%` - for every line in the file
`s/` - substitute
`\( \| \)` - a group of alternatives
`^` - after a newline (beginning of paragraph)
`[.?!] \+` - after a terminal punctuation mark and one or more required spaces
`.` - any character (it's not necessary, but you could use `[[:alpha:]]` instead)
`/` - replacement
`\U` - uppercase the following string (it will only affect the `[[:alpha:]]` character
`/g` - end of command and make it apply to every match on a line