Emacs does not include Haskell-mode by default. Therefore, it is not automatically highlighted or indented when writing the. HS file. You need to install Haskell-mode by yourself. The installation method is very simple.
1 download Haskell-Mode
Https://github.com/haskell/haskell-mode
2. decompress the haskell-haskell-mode-2_8_0-140-g77d0373.tar.gz file.
Tar-xzf haskell-haskell-mode-2_8_0-140-g77d0373.tar.gz-C ~ /. Emacs. d/
So ~ The/. emacs. d directory contains a file directory in the compressed package and is renamed to Haskell-mode because the original name is too ugly ..
3. Modify the Emacs configuration file
(Note: The Emacs configuration file is ~ /. Emacs; my plug-ins are all under the. emacs. d directory)
In ~ /. Add the following to the emacs file:
(Load "~ /. Emacs. d/Haskell-mode/Haskell-site-file ")
Of course, this is only the basic function of Haskell-mode. If more configurations are useless, you will not need to mention it.
After the above work is completed, the file editing. HS using Emacs will automatically enter Haskell-mode and enable highlight and indent.