1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-07 00:58:02 +00:00

Add Quickly Fix A Misspelled Word as a Vim til

This commit is contained in:
jbranchaud
2021-02-28 14:15:51 -06:00
parent 59e1c71724
commit d01f57b100
2 changed files with 28 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
# Quickly Fix A Misspelled Word
In [Fix The Spelling Of A Word](fix-the-spelling-of-a-word.md), I describe how
to use Vim's built-in spell files to fix a misspelling. After turning on
`:spell` and navigating the cursor to a typo, you can open a prompt with dozens
of spelling replacement options.
You generally don't need dozens of options to choose from. If you were remotely
close in the spelling of the word, you will likely end up choosing the first
option.
Instead of the multi-step open and choose, you can tell Vim to replace the
misspelled word with its top suggestion.
Navigate the cursor over the misspelled word and hit:
```
1z=
```
This skips the prompt and tells Vim to grab the first spelling suggestion.
If it's not what you were looking for, you can always hit `u` (to undo) and
then `z=` to open the full prompt.
See `:h z=` for more details.