Skip to content

Commit

Permalink
Move using a custom dictionary to file under 'docs'
Browse files Browse the repository at this point in the history
This is more consistent with the other dictionary examples and how-tos.

Signed-off-by: Daniel F. Dickinson <[email protected]>
  • Loading branch information
danielfdickinson committed Aug 20, 2022
1 parent 10d6425 commit bbb0664
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 32 deletions.
33 changes: 1 addition & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,41 +16,10 @@ repos:
## How-To Guides and Configuration Examples
* [Use Dictionaries from `cspell-dicts`](docs/use-dictionaries-from-cspell-dicts.md)
* [Use a Custom Dictionary](docs/use-a-custom-dictionary.md)
* [Use a Different Dictionary Based Upon the Filename](docs/file-or-folder-based-overrides.md)
* [Example `pre-commit` Setup for French](docs/pre-commit-example-setup-for-french.md)

### Setup Custom Dictionary

To use a custom dictionary with the `pre-commit` hook, create either a `cspell.config.yaml` or `cspell.json` file in your project's root directory.

`cspell.config.yaml`

```yaml
dictionaryDefinitions:
- name: myWords
path: ./path/to/cSpell_dict.txt
addWords: true
dictionaries:
- myWords
```

`cSpell.json`

```json
{
"dictionaryDefinitions": [
{
"name": "myWords",
"path": "./path/to/cSpell_dict.txt",
"addWords": true
}
],
"dictionaries": ["myWords"]
}
```

If you installed the [Code Spell Checker extension](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) for VS Code, this can be done automatically from the command palette by running "Spell: Create a CSpell configuration file".

## Install from GitHub

This repo also allows installing the `cspell-cli` directly from GitHub:
Expand Down
32 changes: 32 additions & 0 deletions docs/use-a-custom-dictionary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Setup Custom Dictionary

To use a custom dictionary with the `pre-commit` hook, create either a `cspell.config.yaml` or `cspell.json` file in your project's root directory.

`cspell.config.yaml`

```yaml
dictionaryDefinitions:
- name: myWords
path: ./path/to/cSpell_dict.txt
addWords: true
dictionaries:
- myWords
```
`cSpell.json`

```json
{
"dictionaryDefinitions": [
{
"name": "myWords",
"path": "./path/to/cSpell_dict.txt",
"addWords": true
}
],
"dictionaries": ["myWords"]
}
```

If you installed the [Code Spell Checker extension](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) for VS Code, this can be done automatically from the command palette by running "Spell: Create a CSpell configuration file".

0 comments on commit bbb0664

Please sign in to comment.