Re: Setting speller from a shell script
Find Marbles <[email protected]> Sun, 6 Nov 2022 15:04:18 +0100
| Newsgroups | gmane.editors.nano.general |
|---|---|
| Message-ID | <CAK+dMbpCVnW9+2WOUzJgvT+idjHd3szy5wrJjE4bao-XL5GQ_A@mail.gmail.com> |
Thank you very much. It works perfectly now. I'm trilingual, english being my 3rd language, so I need to change the spellers constantly depending on the text. For anyone wondering, here is my tiny script for spellchecker.sh: #!/usr/bin/env bash sel=$(printf 'el\nde\nen' | fzf) aspell -x -c --lang="$sel" $1 Am So., 6. Nov. 2022 um 09:34 Uhr schrieb Benno Schulenberg < [email protected]>: > > Op 05-11-2022 om 14:13 schreef Find Marbles: > > I know that a speller can be set in the nanorc as set speller "aspell -x > -c" > > > > However is it possible to set it from a shell script? I did a set > speller > > "home/findmarbles/spellchecker.sh" in the nanorc. > > You will want to have a leading slash too: "/home...". > > > spellchecker.sh is a simple: > > > > #!/usr/bin/env bash > > aspell -x -c > > Aspell needs an argument. Pass it on with $1: > > aspell -x -c $1 > > (Also, make sure spellchecker.sh is executable.) > > > It is also possible to use the SPELL environment variable. In that case, > make sure that _no_ nanorc file sets the speller command -- SPELL is a > fallback, it does not override a nanorc setting. You can then simply do: > > export SPELL="aspell -x -c" > > > (Personally I always add the -l option plus a language code, to make sure > aspell checks the spelling for the correct language.) > > Benno > >