Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need Add-this-word-to-dictionary command for key binding #23

Open
TimMensch opened this issue Dec 7, 2016 · 1 comment
Open

Need Add-this-word-to-dictionary command for key binding #23

TimMensch opened this issue Dec 7, 2016 · 1 comment

Comments

@TimMensch
Copy link

I'm looking at a file with 97 spelling errors, primarily names.

Going through by hand and copying and bringing up a menu and finding "add to dictionary" isn't a good solution. I'd rather be able to hit a key combo on each word.

Bonus: If I could select an entire file and say "add all unknown words to dictionary" that would be even better. I can scan this file quickly and see that all of the spelling "errors" are just words that are missing from the dictionary.

In you implement the "add all", be careful not to add known words, and be careful not to add duplicates; the same "misspelled" word shows up multiple times in many cases.

@swyphcosmo
Copy link
Owner

There is a keyboard shortcut for Quick Fix. It defaults to Ctrl + .. This will pull up the menu of fix actions if the cursor is on a misspelled word. This will let you hit the key combo + up arrow + Enter.

I'll think about changing the code actions to allow direct key binding. You can add something like this to keybindings.json:

{
	"key": "ctrl+shift+f2",
	"command": "SpellChecker.alwaysIgnoreCodeAction",
	"when": "editorHasCodeActionsProvider && editorTextFocus && !editorReadonly"
}

But this will generate an error since the command isn't setup to handle this use case.

You can also manually add all the words to your User Settings file by following the instructions here.

I don't think an "add all unknown words to dictionary" function provides that much utility. In typical use cases, you don't want this functionality. The functions are already set up to not add duplicates, so if you want to submit a pull request, I would consider merging it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants