{"id":17442554,"url":"https://github.com/jez/vim-better-sml","last_synced_at":"2025-07-10T10:41:21.393Z","repository":{"id":73799041,"uuid":"53469584","full_name":"jez/vim-better-sml","owner":"jez","description":":tada: Enjoy writing SML within Vim","archived":false,"fork":false,"pushed_at":"2024-09-25T05:07:21.000Z","size":1424,"stargazers_count":107,"open_issues_count":10,"forks_count":10,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-22T19:49:38.965Z","etag":null,"topics":["sml","vim"],"latest_commit_sha":null,"homepage":"https://blog.jez.io/sml-dev-setup/","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":"support/call-main.sml","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-09T05:02:19.000Z","updated_at":"2025-02-21T14:05:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"77c4ef45-89b7-4bd2-9c54-86f19f76daca","html_url":"https://github.com/jez/vim-better-sml","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jez%2Fvim-better-sml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jez%2Fvim-better-sml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jez%2Fvim-better-sml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jez%2Fvim-better-sml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jez","download_url":"https://codeload.github.com/jez/vim-better-sml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jez%2Fvim-better-sml/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259112201,"owners_count":22807042,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["sml","vim"],"created_at":"2024-10-17T16:17:31.314Z","updated_at":"2025-06-10T16:36:00.181Z","avatar_url":"https://github.com/jez.png","language":"Vim Script","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vim-better-sml\n\n\u003e A complete interactive development environment for Standard ML\n\n`vim-better-sml` makes working with Standard ML in Vim delightful. Compared the\nSML support built-in to Vim, `vim-better-sml` has better syntax highlighting,\nbetter indenting, and better interop with external plugins. It also has features\nthat set it apart, like go to definition, get type of idenifier, a built-in\nREPL, and more.\n\nHere's a quick screencast to show off some of it's best features:\n\n[![thumbnail](sample/thumbnail.png)](https://youtu.be/Z5FsPZ5cm8Y)\n\n- - -\n\nThe main features are:\n\n- **Built-in REPL** (requires SML/NJ)\n\n  Launch and control an SML/NJ REPL process from Vim. Use it to reload a file,\n  rebuild your with `CM.make`, and more. Supports creating a new REPL with\n  either [Neovim] terminal buffers or [Vimux] tmux panes. When using terminal\n  buffers, the output is syntax highlighted!\n\n- **Type lookup** (requires MLton)\n\n  Reveal the type of any variable under your cursor, even those in the Basis\n  Library. This works using MLton's support for [def-use] files, which are\n  indices of type information about your project.\n\n- **Jump to Definition** (requires MLton)\n\n  Reveal the type of any variable under your cursor, even those in the Basis\n  Library. This works using MLton's support for [def-use] files, which are\n  indices of type information about your project.\n\n- **Automatic Setup**\n\n  MLton's [def-use] files are built in the background for you and kept up to\n  date. You just worry about editing--if something needs to be built, we'll\n  handle building it.\n\n- **Expansive syntax highlighting**\n\n  Corrects syntax highlighting in `*.sml` files, and adds optional concealing\n  (for example, `'a` becomes `α`, and `fn` becomes `λ.`).\n\n  Adds syntax highlighting support for many SML-related files types, including\n  `*.sig`, `*.fun`, `*.cm`, `*.mlb`, `*.lex`, `*.grm`, and `*.smackspec` files.\n\nThere are also a whole host of other features to round off sharp edges in Vim's\ndefault SML filetype support, including tweaks to how indentation works and\nsetting the `'iskeyword'` and `'commentstring'` settings. The best part is that\nit's always improving!\n\n\n## Install\n\n1.  Install this plugin using your preferred plugin manager. For example, to\n    install using [vim-plug]:\n\n    ```vim\n    Plug 'jez/vim-better-sml'\n    ```\n\n    If you're unfamiliar using Vim plugins, check out [Vim as an IDE][vim-ide]\n    which will get you up to speed.\n\n2.  Check if you're missing any dependencies:\n\n    ```shell\n    vim +SMLCheckHealth\n    ```\n\n3.  Follow the instructions in the output you see. If you see that all health\n    checks are `OK`, you're all set!\n\n4.  Otherwise, you might need to install or upgrade some tools on your system.\n    In total, `vim-better-sml` depends on:\n\n    - For the embedded REPL:\n        - [Neovim], or [Vimux] with tmux\n        - SML/NJ (`brew install smlnj`)\n    - For language-aware features like type information and go to def:\n        - MLton (`brew install mlton`)\n        - (optional) [Neovim] or Vim 8 for automatically rebuilding indices\n    - For showing errors alongside your code:\n        - [ALE]\n        - (in fact, `vim-better-sml` is not required for ALE to show SML errors)\n\n\n## Quickstart\n\n- To guide you through the setup process:\n  - `:SMLCheckHealth`\n\n\u003c!----\u003e\n\n- To ask for the type of a variable:\n  - `:SMLTypeQuery`\n- To jump to a definition:\n  - `:SMLJumpToDef`\n\n\u003c!----\u003e\n\n- To open a REPL for the current project:\n  - `:SMLReplStart`\n- To load (or reload) the current file or CM project:\n  - `:SMLReplBuild`\n- To `open` the current `structure` into the REPL top-level:\n  - `:SMLReplOpen`\n- To clear the screen on the REPL:\n  - `:SMLReplClear`\n- To set the print depth to 100 (or custom `\u003cdepth\u003e`):\n  - `:SMLReplPrintDepth [\u003cdepth\u003e]`\n\n\n## Configuration\n\nComplete usage and configuration can be found in the help:\n\n\u003e [**`:help vim-better-sml`**](doc/vim-better-sml.txt).\n\nThis plugin sets up no keybindings by default. We suggest that you add these\nsettings to your vimrc, but feel free to change them:\n\n```vim\naugroup vimbettersml\n  au!\n\n  \" ----- Keybindings -----\n\n  au FileType sml nnoremap \u003csilent\u003e \u003cbuffer\u003e \u003cleader\u003et :SMLTypeQuery\u003cCR\u003e\n  au FileType sml nnoremap \u003csilent\u003e \u003cbuffer\u003e gd :SMLJumpToDef\u003cCR\u003e\n\n  \" open the REPL terminal buffer\n  au FileType sml nnoremap \u003csilent\u003e \u003cbuffer\u003e \u003cleader\u003eis :SMLReplStart\u003cCR\u003e\n  \" close the REPL (mnemonic: k -\u003e kill)\n  au FileType sml nnoremap \u003csilent\u003e \u003cbuffer\u003e \u003cleader\u003eik :SMLReplStop\u003cCR\u003e\n  \" build the project (using CM if possible)\n  au FileType sml nnoremap \u003csilent\u003e \u003cbuffer\u003e \u003cleader\u003eib :SMLReplBuild\u003cCR\u003e\n  \" for opening a structure, not a file\n  au FileType sml nnoremap \u003csilent\u003e \u003cbuffer\u003e \u003cleader\u003eio :SMLReplOpen\u003cCR\u003e\n  \" use the current file into the REPL (even if using CM)\n  au FileType sml nnoremap \u003csilent\u003e \u003cbuffer\u003e \u003cleader\u003eiu :SMLReplUse\u003cCR\u003e\n  \" clear the REPL screen\n  au FileType sml nnoremap \u003csilent\u003e \u003cbuffer\u003e \u003cleader\u003eic :SMLReplClear\u003cCR\u003e\n  \" set the print depth to 100\n  au FileType sml nnoremap \u003csilent\u003e \u003cbuffer\u003e \u003cleader\u003eip :SMLReplPrintDepth\u003cCR\u003e\n\n  \" ----- Other settings -----\n\n  \" Uncomment to try out conceal characters\n  \"au FileType sml setlocal conceallevel=2\n\n  \" Uncomment to try out same-width conceal characters\n  \"let g:sml_greek_tyvar_show_tick = 1\naugroup END\n```\n\n## Future Features\n\n\u003e None of these are currently in progress. If you're interested in seeing these\n\u003e worked on, let me know!\n\n- [ ] Support Vim 8 terminal buffer for the REPL\n- [ ] Make an ALE unused variable linter using def-use information\n- [ ] Highlight all uses for a definition\n  - Can probably do this with a quickfix window (think: vim-grepper)\n- [ ] Refactoring tool\n  - Rename variable under cursor, and all uses of that variable\n- [ ] Support sending a visual selection to the REPL\n- [ ] Refactor most functionality into a standalone language server executable\n  - type of ident / go-to-def / etc.\n- [ ] Make it easier to get started porting CM to MLBasis\n- [ ] Generate a tags file from the def-use files\n\n## License\n\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://jez.io/MIT-LICENSE.txt)\n\n\u003c!-- References --\u003e\n\n[def-use]: http://mlton.org/EmacsDefUseMode#_usage\n[vim-plug]: https://github.com/junegunn/vim-plug\n[vim-ide]: https://github.com/jez/vim-as-an-ide\n[Neovim]: https://neovim.io\n[Vimux]: https://github.com/benmills/vimux\n[ALE]: https://github.com/w0rp/ale\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjez%2Fvim-better-sml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjez%2Fvim-better-sml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjez%2Fvim-better-sml/lists"}