nvim -v output:

NVIM 0.2.0-dev
Build type: RelWithDebInfo
Compilation: /usr/bin/x86_64-linux-gnu-gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -DHAVE_CONFIG_H -D_GNU_SOURCE -I/build/neovim-gNtBZg/neovim-0.1.7ubuntu1+git201702111847+3127+23~ubuntu16.04.1/build/config -I/build/neovim-gNtBZg/neovim-0.1.7ubuntu1+git201702111847+3127+23~ubuntu16.04.1/src -I/build/neovim-gNtBZg/neovim-0.1.7ubuntu1+git201702111847+3127+23~ubuntu16.04.1/.deps/usr/include -I/build/neovim-gNtBZg/neovim-0.1.7ubuntu1+git201702111847+3127+23~ubuntu16.04.1/.deps/usr/include -I/build/neovim-gNtBZg/neovim-0.1.7ubuntu1+git201702111847+3127+23~ubuntu16.04.1/.deps/usr/include -I/build/neovim-gNtBZg/neovim-0.1.7ubuntu1+git201702111847+3127+23~ubuntu16.04.1/.deps/usr/include -I/build/neovim-gNtBZg/neovim-0.1.7ubuntu1+git201702111847+3127+23~ubuntu16.04.1/.deps/usr/include -I/build/neovim-gNtBZg/neovim-0.1.7ubuntu1+git201702111847+3127+23~ubuntu16.04.1/.deps/usr/include -I/usr/include -I/build/neovim-gNtBZg/neovim-0.1.7ubuntu1+git201702111847+3127+23~ubuntu16.04.1/build/src/nvim/auto -I/build/neovim-gNtBZg/neovim-0.1.7ubuntu1+git201702111847+3127+23~ubuntu16.04.1/build/include
Compiled by root@lgw01-10

Optional features included (+) or not (-): +acl   +iconv    +jemalloc +tui      
For differences from Vim, see :help vim-differences

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"
  • System: Ubuntu 16.04
  • Terminal: GNOME Terminal 3.18.3
  • $TERM: screen-256color

When syntax is off and spell is on only misspelled and rare words should be highlighted. Some keywords highlight but in different way than misspelled words.

I did not test it Vim.

Steps to reproduce using nvim -u NORC (without configuration file):

:syntax off
:set spell


wrong highlight

Why is function, let higlighted blue? Can I turn it off so only misspelled words will be highlighted (no matter what type)?


It's because syntax is required to recognize syntax-specific keywords. Without syntax enabled, Vim has no idea if the text has special meaning or if you're just bad at spelling.

From :h spell-syntax

Files that use syntax highlighting can specify where spell checking should be

1.  everywhere             default
2.  in specific items          use "contains=@Spell"
3.  everywhere but specific items  use "contains=@NoSpell"

For the second method adding the @NoSpell cluster will disable spell checking
again.  This can be used, for example, to add @Spell to the comments of a
program, and add @NoSpell for items that shouldn't be checked.
Also see |:syn-spell| for text that is not in a syntax item.

From :h :syn-spell

:sy[ntax] spell [toplevel | notoplevel | default]
  This defines where spell checking is to be done for text that is not
  in a syntax item:

  toplevel: Text is spell checked.
  notoplevel:   Text is not spell checked.
  default:  When there is a @Spell cluster no spell checking.

  For text in syntax items use the @Spell and @NoSpell clusters
  |spell-syntax|.  When there is no @Spell and no @NoSpell cluster then
  spell checking is done for "default" and "toplevel".

  To activate spell checking the 'spell' option must be set.

For the vim filetype, you can see strings and comments explicitly have contains=@Spell in $VIMRUNTIME/syntax/vim.vim.

  • Is it possible to turn red (or whatever color) highlight off? I just want nvim to be stupid and check for misspelled words (even if they are keywords). Feb 13 '17 at 6:10
  • How would you know if the word is misspelled without the highlight? If you're talking about changing the colors, see :h :highlight and :h hl-SpellBad.
    – Tommy A
    Feb 13 '17 at 16:49
  • The word function is not misspelled, yet it highlights. Feb 13 '17 at 17:37
  • Then you're talking about the blue highlight, which is SpellRare. Read :h hl-SpellRare, :h spell-RARE, and :h spell-affix-flags. This is all spelled out in :h spell. You should read it since further responses from me will just be citing the docs.
    – Tommy A
    Feb 13 '17 at 20:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.