I suspect that it doesn't. I don't see anything about it in the documentation(
:h spell), but I'd love to be proven wrong.
Not in the command line that I know of since I'm pretty sure the command line prompt doesn't highlight text. But, you can enable spell checking in the command window.
ctrl-f on the command line or press
q: in normal mode. This brings up the command window which can be treated almost like any other buffer. From here you can run
:set spell to enable spell checking. However, the command window uses
filetype=vim which doesn't show spelling errors for some reason. Running
set filetype= to disable the syntax highlighting allows the spell check highlight to show.
You can use an
autocmd to set up the command window when it opens:
autocmd CmdwinEnter * if &ft =~# 'vim' | setlocal spell ft= | endif
This is a better solution based on your comment below about using
autocmd CmdwinEnter * if getcmdwintype() == '@' | setlocal spell | endif
This will enable spellcheck for the
input() history window.
The character used for the pattern indicates the type of command-line: : normal Ex command > debug mode command debug-mode / forward search string ? backward search string = expression for "= expr-register @ string for input() - text for :insert or :append
If your version of Vim does not have
getcmdwintype(), you could use a expression map since
getcmdtype() is only available when editing the command line or an expression mapping:
cnoremap <silent><expr> <c-f> getcmdtype() == '@' ? "\<c-f>:setlocal spell\<cr>" : "\<c-f>"