Skip to content
This repository has been archived by the owner on Feb 7, 2018. It is now read-only.
/ sml.vim Public archive
forked from javier-lopez/sml.vim

Everything will be merged in the original repo

Notifications You must be signed in to change notification settings

tssm/sml.vim

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sml-coursera.vim

vim + sml for https://class.coursera.org/proglang-002/class/index

Requirements

Installation

  • Vundle way (recommended), add the following to your $HOME/.vimrc file:

      Bundle 'javier-lopez/sml-coursera.vim'
    

    And run inside of vim:

      :BundleInstall
    
  • Pathogen way:

      $ git clone https://github.com/javier-lopez/sml-coursera.vim.git ~/.vim/bundle/sml-coursera.vim
    
  • Manual (simplest if you've never heard of vundle or pathogen), download the zip file generated from github and extract it to $HOME/.vim

      mv sml-coursera.vim*.zip $HOME/.vim
      cd $HOME/.vim && unzip sml-coursera.vim*.zip
    

    Update the help tags from vim:

      :helpt ~/.vim/doc/
    

Usage

On .sml files you can execute :make to run your current buffer on SML, it also indent and shows SML sintaxis. See :help sml-coursera.txt for detailed information

Indentation & highlighting features

There are some differences (features) from standard Vim 7.4 files.

  • No line wrapping (textwidth = 0).

  • Indent case as follows:

      case x of
        NONE => "none"
      | SOME of str => str
    
  • Indent handle as follows:

      call_smth_dangerous
        handle Err1 => 41
             | Err2 => 42
    
  • Indent functional pattern matching:

      fun length [] = 0
        | length _::xs = 1 + length xs
    
  • Indent let after fun:

      fun double_sum (x, y) =
        let val sum = x + y
        in 2*sum end
    
  • Fix indentation of if/then/else when using =.

  • Fix highlighting of =>, :=.

  • Highlight record fields in type declaration, record creation and record patterns.

These features are also available as an independent plugin.

Releases

No releases published

Packages

No packages published

Languages

  • Vim Script 100.0%