2

我正在尝试在 MacOS Yosemite 中创建一个自定义的 sublime-build 文件,它将在控制台上执行 ghci 并预加载我的代码。这将使我的 Haskell 学习过程更快、更愉快。但是,由于我是 Haskell 和 Sublime Text 的新手,我不知道在文件中写什么。

我知道这段代码对 gnome-terminal 是一样的:

{
    "selector": "source.haskell",
    "working_dir": "$file_path",
    "cmd": ["gnome-terminal","-x","ghci", "$file"]
}

我在这里找到了代码。

4

1 回答 1

1

check this: https://github.com/SublimeHaskell/SublimeHaskell

USAGE (From their Readme.md):

In short: Press Shift-Ctrl-P and type haskell to explore all commands.

When editing Haskell source files that are part of a Cabal project, automatic error highlighting and enhanced auto-completion are available.

Each time you save, any errors in your program will be listed at the bottom of the window and highlighted in the source code.

All source files in the project are scanned when the change. Any symbols that they export are provided in the auto-complete suggestions.

To use cabal-dev instead of cabal, set use_cabal_dev to true (or use command "Switch Cabal/Cabal-Dev") and specify cabal-dev absolute path. Completion list will be rescanned and build will use cabal-dev.

Stylish-haskell can be used to stylish file or selected text.

Use Ctrl-Shift-R to go to declaration and Ctrl-K-I to show symbol info with documentation. These command are also available through context menu with right-click.

Command 'SublimeHaskell: Browse module' is similar to ghci's browse command

To show inferred types use Show type (ctrl-k ctrl-h ctrl-t) command.

To insert inferred type use Insert type (ctrl-k ctrl-h ctrl-i).

You can jump between the errors and warnings with F4 and Shift-F4. To show hidden error output, use command Show error panel (ctrl-alt-e)

于 2014-12-19T02:07:40.990 回答