Как убрать подчеркивание русских слов в pycharm
Перейти к содержимому

Как убрать подчеркивание русских слов в pycharm

  • автор:

Как убрать подчеркивание русских слов в pycharm

введите описание изображения здесь

Корректура

Удаление ошибки проверки орфографии для имени файла в PyCharm

Spellchecking

PyCharm helps you make sure that all your source code, including variable names, textual strings, comments, literals, and commit messages, is spelt correctly. For this purpose, PyCharm provides a dedicated Typo inspection which is enabled by default.

In textual strings and comments, only the spelling of this particular word at caret changes. Where the Rename refactoring is available, the inspection suggests to rename all occurrences of a symbol .

The Typo inspection detects and highlights words not included in any dictionary. You can either correct the spelling or accept the word as correct. Disable the Typo inspection if you want to ignore all spelling mistakes. For more information, see Disable spellchecking.

Correct a misspelled word

Place the caret at any word highlighted by the Typo inspection.

Click or press Alt+Enter to show the available intention actions.

Select one of the suggested fixes from the list.

To jump to the next misspelled word, press F2 .

Accept a misspelled word

Place the caret at a word highlighted by the Typo inspection.

Click or press Alt+Enter to show the available intention actions.

Select the Save to dictionary action to add the word to the user’s dictionary and skip it in the future.

If you have added the word by mistake, press Ctrl+Z to remove it from the dictionary

By default, PyCharm saves words to the global application-level dictionary. You can choose to save words to the project-level dictionary if the spelling is correct only for this particular project. For more information, see Select the default dictionary for saving words.

Configure the Typo inspection

By default, the Typo inspection checks all text including code elements, string literals, and comments in all scopes.

Press Ctrl+Alt+S to open the IDE settings and select Editor | Inspections .

Expand the Proofreading node and click Typo in the central pane.

In the right-hand pane, configure the Typo inspection:

Specify the severity level and the scope in which to apply this level.

For example, if you want typos to stand out more, select Error or Warning to highlight typos similar to syntax errors or warnings in your code.

Specify the type of content to check:

Process code : check various code elements.

Process literals : check text inside string literals.

Process comments : check text inside comments.

Disable spellchecking

Press Ctrl+Alt+S to open the IDE settings and select Editor | Inspections .

Clear the checkbox next to the Typo inspection.

Dictionaries

PyCharm includes bundled dictionaries for all configured languages. You cannot modify them directly but you can extend the spellchecker in other ways:

Save words to a built-in global or project dictionary.

Add plain-text files with the .dic extension that contain lists of words.

If you have the Hunspell plugin installed and enabled, you can add Hunspell dictionaries, which comprise of two files: the DIC file that contains a list of words with the applicable modification rules and the AFF file that lists prefixes and suffixes regulated by a specific modification rule. For example, en_GB.dic and en_GB.aff .

Configure the spellchecker dictionaries

Press Ctrl+Alt+S to open the IDE settings and select Editor | Natural Languages | Spelling .

Configure the list of custom dictionaries:

To add a new custom dictionary to the list, click or press Alt+Insert and specify the location of the required file.

To edit the contents of a custom dictionary in PyCharm, select it and click or press Enter . The corresponding file will open in a new editor tab.

To remove a custom dictionary from the list, select it and click or press Alt+Delete .

Select the default dictionary for saving words

By default, PyCharm saves words to the global application-level dictionary. You can choose to save words to the project-level dictionary if the spelling is correct only for this particular project.

Press Ctrl+Alt+S to open the IDE settings and select Editor | Natural Languages | Spelling .

Select either the built-in project-level or application-level dictionary or disable the option to prompt you every time you save a word.

Add accepted words manually

Press Ctrl+Alt+S to open the IDE settings and select Editor | Natural Languages | Spelling .

Add words to the Accepted words list. PyCharm adds manually accepted words to the project-level dictionary.

You can’t add words that are already present in one of the dictionaries and mixed-case words, such as CamelCase and snake_case .

The Accepted words list also contains words that you saved to either the built-in global or project dictionary. Although it does not contain words added to the project-level dictionary by other users and words from other custom dictionaries, the Typo inspection will not highlight them.

Spellchecking

PyCharm checks the spelling of all your source code, including variable names, text in strings, comments, literals, and commit messages. For this purpose, PyCharm provides a dedicated Typo inspection which is enabled by default.

The Typo inspection detects and highlights words that are not included in any dictionary. You can either correct the spelling or save the word to the dictionary.

Disable the Typo inspection if you want to ignore all spelling mistakes. For more information, see Disable spellchecking.

Correct a misspelled word

Place the caret at any word highlighted by the Typo inspection.

Click or press Alt+Enter to show the available intention actions.

Select one of the suggested fixes from the list.

In string literals and comments, only the spelling of this particular word at caret changes. For code elements, such as names of variables, functions, classes, and other symbols, the inspection also suggests changing all occurrences via the Rename refactoring.

Save a word to dictionary

If a dedected typo is actually a valid word, you can add it to a user-defined dictionary that extends the built-in dictionaries.

Place the caret at a word highlighted by the Typo inspection.

Click or press Alt+Enter to show the available intention actions.

Select the Save to dictionary action to add the word to the user’s dictionary and skip it in the future.

If you have added the word by mistake, press Ctrl+Z to remove it from the dictionary.

By default, PyCharm saves words to the global application-level dictionary. You can choose to save words to the project-level dictionary if the spelling is correct only for this particular project. For more information, see Select the default dictionary for saving words.

Press F2 and Shift+F2 to step through all problems in a file, including typos.

Find all spelling mistakes

The Typo inspection highlights typos in the current file. You can also run the inspection on your entire project or a set of files. For more information, see Run a single inspection.

From the main menu, select Code | Analyze Code | Run Inspection by Name… or press Ctrl+Alt+Shift+I .

In the Enter inspection name popup, find and select the Typo inspection.

In the Run ‘Typo’ dialog, select the scope in which you want to run the inspection, and other options, such as a file mask filter. Then click OK .

PyCharm will run the Typo inspection on all files in the selected scope and show all found typos in a separate tab of the Problems tool window.

Configure the Typo inspection

By default, the Typo inspection checks all text, including code elements, string literals, and comments in all scopes.

Press Ctrl+Alt+S to open the IDE settings and select Editor | Inspections .

Expand the Proofreading node and click Typo in the central pane.

In the right-hand pane, configure the Typo inspection:

Specify the severity level and the scope in which to apply this level.

For example, if you want typos to stand out more, select Error or Warning to highlight typos similar to syntax errors or warnings in your code.

Specify the type of content to check:

Process code : check various code elements.

Process literals : check text inside string literals.

Process comments : check text inside comments.

Suppress the Typo inspection

Like with any other inspection, you can suppress the Typo inspection for specific files and code elements.

Place the caret at a word highlighted by the Typo inspection.

Click or press Alt+Enter to show the available intention actions.

On one of the suggested fixes, press the right arrow key or click and select Suppress for class or another relevant suppress action.

Depending on the language and code element, this adds a special annotation or comment that tells the editor to suppress the relevant inspection in the corresponding scope. For example, in case of Python, suppressing the Typo inspection for a class adds the following annotation before the class declaration:

This suppresses all spelling checks within the class.

Disable spellchecking

Press Ctrl+Alt+S to open the IDE settings and select Editor | Inspections .

Clear the checkbox next to the Typo inspection.

Dictionaries

PyCharm includes bundled dictionaries for all configured languages. You cannot change them directly, but you can extend the spellchecker in other ways:

Save words to a built-in global or project dictionary.

Add plain-text files with the .dic extension that contain lists of words.

You can add Hunspell dictionaries, each of which consists of two files: the DIC file that contains a list of words with the applicable modification rules and the AFF file that lists prefixes and suffixes regulated by a specific modification rule. For example, en_GB.dic and en_GB.aff .

Configure the spellchecker dictionaries

Press Ctrl+Alt+S to open the IDE settings and select Editor | Natural Languages | Spelling .

Configure the list of custom dictionaries:

To add a new custom dictionary to the list, click or press Alt+Insert and specify the location of the required file.

To edit the contents of a custom dictionary in PyCharm, select it and click or press Enter . The corresponding file will open in a new editor tab.

To remove a custom dictionary from the list, select it and click or press Alt+Delete .

Select the default dictionary for saving words

By default, PyCharm saves words to the global application-level dictionary. You can choose to save words to the project-level dictionary if the spelling is correct only for this particular project.

Press Ctrl+Alt+S to open the IDE settings and select Editor | Natural Languages | Spelling .

Select either the built-in project-level or application-level dictionary or disable the option to prompt you every time you save a word.

Add accepted words manually

Press Ctrl+Alt+S to open the IDE settings and select Editor | Natural Languages | Spelling .

Add words to the Accepted words list. PyCharm adds manually accepted words to the project-level dictionary.

You can’t add words that are already present in one of the dictionaries and mixed-case words, such as CamelCase and snake_case .

The Accepted words list also contains words that you saved to either the built-in global or project dictionary. Although it does not contain words added to the project-level dictionary by other users and words from other custom dictionaries, the Typo inspection will not highlight them.

Share dictionaries

PyCharm stores the built-in project-level dictionary with other project-related files. This means that anyone working with the project has access to the words stored in this dictionary.

To share your application-level dictionary, use the bundled IDE Settings Sync plugin.

How to avoid the spell check on string in Pycharm

Where is the option to disable the spell check on the strings for the PyCharm IDE? I hate the jagged line under my comments and strings.

ntg's user avatar

9 Answers 9

Go to File -> Settings -> Editor -> Inspections . Expand the list under Spelling in the middle window and uncheck the option Typo .

enter image description here

However, practically most of the jagged line is caused by violations of the PEP 8 coding style. If you would like to disable this option too, in the same window, expand the list under Python and uncheck the option PEP 8 coding style violation .

In the latest version of PyCharm it appears as ProofReading:

ProofReading

Marc Sances's user avatar

Nicolas Lopez's user avatar

You can disable spellchecking for specific code section by commenting # noinspection SpellCheckingInspection above it.

PyCharm does not check the syntax inside strings and comments. It checks spelling.

You can find the settings of the spell-checker under the Settings. page. There is a Spelling page inside Project Settings. Inside this page, at the bottom of the Dictionaries tab you can enable/disable dictionaries. If you don’t want spell checking simply disable all of them.

Note that it is possible to add custom words in the spell checker, or, if you already have a dictionary on your computer, you can add it. This can turn out useful if you want to spell check different languages (for example Italian).

In particular if you are using a Linux system and you have installed the Italian language pack, you probably have the Italian dictionary under: /usr/share/dict/italian . You can add the /usr/share/dict directory to the directories searched for dictionaries and enable the italian dictionary.

Откуда ошибка Typo: In Word ‘слово’?

Ranwise, 5f94d5e0002d4865626748.jpeg

Ranwise, спасибо ) Я тоже сначала подумал, что дело в раскладке, переписал букву с, ничего не изменилось. А букву е проверить забыл )) Сейчас благодаря вам решил ещё раз проверить и действительно — е была написана английской буквой. Тайна раскрыта )

P.S.: как видите при перепутанной раскладке всё слово подчёркивает.
P.P.S.: а ошибку выдавал Typo: In Word ‘если’

Для ошибок «Typo: In word. » применительно к русским словам:
Через File -> Settings. -> Editor -> Natural Languages добавить Русский язык

Для ошибок «Typo: In word. » применительно к английским словам:
Пиши именно английские слова и используй «_» как разделитель.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *