Search code examples
neovimaspell

How to use aspell with neovim?


I would prefer to use aspell rather than neovim's built in spell checker. I can use aspell from the zsh command line, and also with 'regular' vim, but when I use

:!aspell check %

inside neovim, it gives the error message: Error: stdin is not a terminal. (Instead of displaying a standard aspell correction environment).

I'm at a loss as to what else to try. The error message actually has a lot of garbage characters before it. Things like: '^[[?1049h^[[1;24r^[(B^[[' and also ends with 'shell returned 255'.


Solution

  • The solution is this:

     :term set modifiable ; aspell check %
    

    When the new screen opens, you need to do an 'i' for insert mode, then the aspell correction environment is correct and usable. When it exits, pressing 'Enter' is required to get back to the original file.

    I (Leonard) rewrote Freeman's reply completely. His initial reply didn't work, but dialog in the comments led to this solution, and I want to award him the bonus, but have it associated with the right info. Thx @Freeman