Is there a way to make sublime 3 spell check to check words with CAPITAL LETTERS? - sublimetext3

Is there a way to make sublime 3 spell check to check words with CAPITAL LETTERS? I'm typing here and the spell check just ignore words with 2 or more capital letters. Anyone?

I found a very bad palliative solution for the problem, but it works. It is using OpenOffice writer editor. There you can go to tools, spelling and Grammar, click options, and, then, set verify capitalized, and, also, words with numbers. This can give me a hand on seeing bad typed words in my code. But it is a bad solution, c'os I'm using Sublime, so I have to open it in open office Writer just to use the spell checker. Also, I have to "feed" the dic with the right words in Writer. Hope this could give a hand to those with the same problem, but the ideal solution was to have these spell checker options inside Sublime.

By default, no. You could potentially add a dictionary that has words in all caps and then it'll work. I looked for a couple minutes and didn't see one but you might get lucky.

Sublime text uses Hunspell as the spell-checking engine:
Sublime Text uses Hunspell for its spell checking support. Additional
dictionaries can be obtained from the OpenOffice.org Extension List.
Dictionaries in a format ready to be used by Sublime Text are available at https://github.com/titoBouzout/Dictionaries.
https://www.sublimetext.com/docs/3/spell_checking.html
Hunspell does not allow case insensitive spell-checking
How to check spelling in Hunspell with case insensitive
I am a little lost as how the suggestion by #Giollia is expected to work. Adding a new dictionary will supply a new list of valid spellings, how is that going to help highlight misspellings?

Related

How to ignore accented letters when using the search function of Sublime Text?

When searching for text in Sublime Text, the search is sensitive to accented letters. This is not very practical when I want to find all matches regardless of the accents. Is there a setting for the search function that makes it ignore the accents?
Unfortunately Sublime Text's Find feature does not support Character Equivalence, so there is no way to get it to ignore the accents.
I explored this before in the context of snippets and replacements, but for this use case, you could write a Python plugin to build the character equivalence for you and populate the Find panel appropriately.
You may find it is enough to just temporarily replace the whole file with it's unidecoded representation and search that.

How to force vim spellchecker to ignore lowercase/uppercase errors

I found here and here how to force Vim spell checker to ignore words with capital letters from being check. But my case is quite opposite. I want to ignore words that in corrected form include capital letters.
So in sentence:
europe was chozen best
only word chozen is the wrong one.
How to achieve that?
Thanks for any hint.
This answer was posted first by Rich on vi&vim stackexchange:
I don't think that Vim has a setting for this. One workaround is to
create a new spellfile that contains everything in your current spell
file(s) but with lowercase letters only:
Create a new buffer containing everything from the spell file(s) currently in use:
:spelldump
Delete lines that don't contain any upper-case characters. This isn't strictly necessary, but there's no point keeping duplicate
entries for lower-case words:
:v/\u/d
Convert the entire file to lower-case, ignoring lines that contain the locations of the spell files:
:v/^#/norm gu$
Save the file:
:w ~/.vim/spell/lowercase.utf-8.add
Start using this file in addition to the standard files in Vim's $VIMRUNTIME directory. Note that Vim uses a default 'spellfile'
value internally if the setting is empty, so if you already have any
existing spell files, you will need to ensure that they are included
in this setting (which accepts a comma-delimited list):
:set spellfile=~/.vim/spell/lowercase.utf-8.add
Note that if you set this option in a running instance of Vim, it
doesn't seem to take effect for spell-checking until you interact with
it (by, e.g. using the zg command.)
The above doesn't affect the way that Vim detects lower-case words at
the start of a sentence as spelled incorrectly. You can disable this
with the 'spellcapcheck' option:
:set spellcapcheck=

How to correct spelling in entire file?

Spelling mistakes can be fixed by pointing the cursor on the misspelled word and pressing z= (a list appears and you can select correct word). But this will fix the mistake only once (on current word). This is not that much of us will want, most will be happy to do replacement in entire file. How can I do so?
Unsuccessful Attempt:
I got an idea of substitute that mistake with correct one (i.e. :%s/badspell/goodspell/g). But the bad part of this is, it is painful. First I need to (atleast) correct a word, then store bad spelling and corrected spelling in my buffer (brain), then write the command for substitution (chances are I will do mistake in writing bad spelling and good one.). Though its time taking too.
There's a similar question on StackOverflow which says I can solve my problem with doing :spellrepall after the correction. The only problem is I don't want to all this typing. I want to automate this everytime there is a spelling correction.
And don't suggest me about plugins.
you can set the spell on in .vimrc
set spell
or if u execute this on vim directly do in vim command mode.
:set spell
Once the spell is on, you need to know following command:
]s — move to the next mispelled word
[s — move to the previous mispelled word
zg — add a word to the dictionary
zug — undo the addition of a word to the dictionary
z= — view spelling suggestions for a mispelled word
If most of the time you're selecting the first fix from the query you can use a remap for 1z= as such:
nnoremap 1z= 1z=:spellrepall<cr>
Although I would recommend binding :spellrepall to a seperate key as many people already suggested. I highly doubt you have run out of keybindings with all those <leader> and <localleader> combos. (something like <leader>z would be a perfect candidate for this)
I don't think this can go any easier without you loosening your expectations.

Preprocessing a word before spell checking in Vim

I use Vim's spell checking to validate texts in Russian. We have letter ё in our alphabet which is often replaced with simple е. So, for example, word ёжик из written as ежик. It is a bad tone actually. Its like using - (hyphen) where — (em-dash) is required, like using "computer" quotes forgetting about existence of „typographic” «quotes», etc.
The bad thing is that spell dictionary for Vim composed out of simplified words with all ёs, replaced with еs. So I always get an error in a word with ё.
So the question, is there any hook I can use that will allow me to normalize a word just before it will be spell checked? Or maybe someone has a better idea? Thanks.
UPDATE
With the hint from #sarnold, I found the solution. One should use ru_yo locale instead of ru_ru if he wants ёёёёё
My first thought when reading your post was to suggest using zg to add the word to the spellfile; after a few weeks you'll have a lot of them. Not ideal, but simple.
:help spell-russian lists several different spelling variations, would one of these help?
I also notice in :help spell.txt that there are options for downloading your own spellfiles from OpenOffice or http://www.a-a-p.org to automate building spellfiles.
I would recommend you to use your own spell checking for vim. Use a method #2 explained here

Vim Spell option to ignore source code identifiers containint underscore, numbers, etc

Is there any option in vim spell checker to ignore words containing underscore, multiple uppercase letters, minus, numbers in a plain text file. I could not find anything in the manuals (7.2) or Google search.
You can use the syntax command with the #NoSpell cluster:
syn match myExCapitalWords +\<\w*[_0-9A-Z-]\w*\>+ contains=#NoSpell
You may want to look at :help iskeyword variable which defines what 'word' is.
You can try using zg when on the bad word - this will add the word to the allowed word list, which should then stop it being highlight in the future.
Otherwise, I'm not sure whether this is possible using the standard functionality - syntax files can specify regions that should or should not be spell checked but this will not help you, as you are including 'bad words' in comments, which would be spell checked in most cases.

Resources