Spellchecking in CamelCase?

623 views
Skip to first unread message

Timothy Knox

unread,
Jul 19, 2007, 2:35:16 PM7/19/07
to Vim List
I love the spellchecker in Vim7. Really and truly. Thanks to all those whose
efforts made it happen. :-)

However, I'd like to know if there is a way to spellcheck CamelCase words
better? Specifically, when a word turns up in CamelCase, spell check each word
individually (i.e. spellcheck camel and case in my email). I use vim to write
emails for code reviews, and documentation about my code, and in both cases, I'd
love for vim to be smart enough to realise that a variable I am referring to
named, for example, TargetTime, is not a misspelling, but to still flag things
like TgtTime. With vim's autocompletion, there is no excuse for names like
TgtTime any more, and having spellcheck flag them (and only them) would be a
convenience. Anyone?

--
Timothy Knox <mailto:t...@thelbane.com>
I have always wished that my computer would be as easy to use as my telephone.
My wish has come true. I no longer know how to use my telephone.
-- Bjarne Stroustrup, creator of the C++ programming language

Cyril Slobin

unread,
Jul 23, 2007, 12:00:25 PM7/23/07
to vim...@googlegroups.com, Vim List
On 7/19/07, Timothy Knox <t...@thelbane.com> wrote:

> However, I'd like to know if there is a way to spellcheck CamelCase words
> better?

I have a less demanding idea: to add an option to disable case-sensitivity
during spell checking totally. I do often use words with strange capitalization
(CamelCase, proper names w/o capitalization, and so on), and I believe that
It Would Be Nice to be able to pass such words silently (or mark them as
invalid case, not as spelling errors (blue curly line instead of red)).

--
Cyril Slobin <slo...@ice.ru> `When I use a word,' Humpty Dumpty said,
http://wagner.pp.ru/~slobin/ `it means just what I choose it to mean'

Ben Tucker

unread,
Dec 2, 2016, 7:42:17 AM12/2/16
to vim_use, v...@vim.org
I have written a patch adds an option to vim "spellcamelcase" which caters for CamelCase words as in your "TargetTime" example by considering each word in the identifier separately for the purposes of spell checking. So with the "spellcamelcase" option turned on, "Target" and "Time" are spell checked separately. You will need to apply the patch to the vim source and rebuild it for this functionality.
https://github.com/btucker-MPCData/vim/commit/04948bb206ae211b83ef850248c8fd5c9bb5a612

Christian Brabandt

unread,
Dec 2, 2016, 8:14:30 AM12/2/16
to vim_use, vim-dev
Forwarding to vim-dev


Mit freundlichen Grüßen
Christian
--
Auch wenn ich wüßte, daß morgen die Welt zugrunde geht, würde ich
heute noch einen Apfelbaum pflanzen.
-- Martin Luther

Tim Chase

unread,
Dec 2, 2016, 1:53:22 PM12/2/16
to vim...@googlegroups.com
On 2016-12-02 14:14, Christian Brabandt wrote:
> On Fr, 02 Dez 2016, Ben Tucker wrote:
>> "TargetTime" example by considering each word in the identifier
>> separately for the purposes of spell checking. So with the
>> "spellcamelcase" option turned on, "Target" and "Time" are spell
>> checked separately.
>
> Forwarding to vim-dev

I've occasionally thought "camel-case spell-checking would be a nice
feature, but who else would want it, let alone code it". Guess this
answers that question. Thanks! :-)

-tim



Reply all
Reply to author
Forward
0 new messages