vim

Is there a way to apply gruvbox color scheme for standard text files?


Like, all program files are syntax highled by this plugin for vim. But my I/O files are standard text files.

So, how to apply colour scheme for text files?


Solution

  • There is no such thing as a "standard text file". foo.c and bar.json are both "text files" but:

    If your text editor can't figure out the filetype of a given file baz, then it will have a hard time highlighting its syntax.

    So you have four scenarios…

    1. It is possible to detect the type of the file and its content follows a specific syntax.

      You need to tell Vim how to detect the filetype, see :help new-filetype, and either assign it an existing syntax, see :help 'syntax', or create your own, see :help syntax.txt.

    2. It is not possible to detect the type of the file but its content follows a specific syntax.

      You need to assign a filetype manually, see :help 'filetype', and either assign it an existing syntax, see :help 'syntax', or create your own, see :help syntax.txt.

    3. It is possible to detect the type of the file but its content doesn't follow a specific syntax.

      Well, there is no syntax to highlight so it's GAME OVER.

    4. It is not possible to detect the type of the file and its content doesn't follow a specific syntax.

      GAME OVER again.