elm
所属分类:编程语言基础
开发工具:Vim Script
文件大小:0KB
下载次数:0
上传日期:2017-09-24 19:31:05
上 传 者:
sh-1993
说明: Elm编程语言的Vim插件
(Vim plugin for the Elm programming language)
文件列表:
LICENSE (1086, 2016-08-15)
autoload/ (0, 2016-08-15)
autoload/elm/ (0, 2016-08-15)
autoload/elm/io.vim (213, 2016-08-15)
doc/ (0, 2016-08-15)
doc/elm-vim.txt (4144, 2016-08-15)
doc/tags (0, 2016-08-15)
ftdetect/ (0, 2016-08-15)
ftdetect/elm.vim (46, 2016-08-15)
ftplugin/ (0, 2016-08-15)
ftplugin/elm.vim (1865, 2016-08-15)
indent/ (0, 2016-08-15)
indent/elm.vim (3470, 2016-08-15)
syntax/ (0, 2016-08-15)
syntax/elm.vim (2223, 2016-08-15)
# elm.vim
Vim plugin for the [Elm programming language](http://elm-lang.org/).
## Installation
Just like any other plugin, clone this repository into the `~/.vim/bundle` directory
cd ~/.vim/bundle && \
git clone https://github.com/lambdatoast/elm.vim.git
If you are unfamiliar with this process, please refer to the [Pathogen](https://github.com/tpope/vim-pathogen) project.
## System Requirements
Nothing other than vim is needed for the syntax highlighting.
For the special commands and aliases (for compilation, etc), the plugin expects the following programs to be available:
* `elm-make`: The Elm build tool.
* `elm-repl`: The Elm REPL. The plugin sends it bits of code for evaluation.
## Usage
These are the available commands. To get the most out of them,
you should create mappings according to your needs.
### Compilation
* `:ElmMakeCurrentFile` compiles the current file.
* `:ElmMakeMain` compiles an assumed `Main.elm` file.
* `:ElmMakeFile ` compiles `filename`.
### Evaluation
* `:ElmEvalLine` evaluates the current line and puts the result as a
comment in a new line below it.
* `:ElmEvalSelection` evaluates a visual mode selection.
### REPL
* `:ElmRepl` switches to `elm-repl`, when closing the REPL you'll get back to vim.
### Example mappings
I use the following mappings in my .vimrc at the moment:
nnoremap el :ElmEvalLine
vnoremap es :ElmEvalSelection
nnoremap em :ElmMakeCurrentFile
### Example autocommands
Vim autocommands can make your life a lot easier.
These are just some examples of what I use sometimes:
* Compiling the current file on write:
+ `:au BufWritePost *.elm ElmMakeCurrentFile`
* Usually more useful: Compiling a specific file, e.g. "Main.elm", on file write to any file in the project:
+ `:au BufWritePost *.elm ElmMakeFile("Main.elm")`
Remember you can clear all these afterwards, with e.g. `:au! BufWritePost *.elm`
## TODO
* Integration with Elm docs.
近期下载者:
相关文件:
收藏者: