• Stars
    star
    108
  • Rank 321,259 (Top 7 %)
  • Language
    Vim Script
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

esy + vim + reason +the latest Merlin

vim-reasonml:

Native Reason development with esy and Merlin

vim-reasonml provides vim IDE features for native Reason projects that use esy and merlin.

Features:

  • Automatically loads Merlin plugin from your esy devDependencies.
  • Merlin autocomplete, goto-location, type-at-cursor features (provided by merlin)
  • Airline integration for esy projects and compilation errors.
  • :ReasonPrettyPrint with enhanced syntax error locations.
  • Reason syntax highlighting and Dune build config syntax highlighting.
  • Highlighting of esy #{build variables} in .json files.
  • Preliminary Windows support with esy Windows.

See The vim-reasonml Plugin Documentation.

Install

  • npm install -g esy
  • Install vim-reasonml with your vim plugin manager. If using vim-plug add Plug 'jordwalke/vim-reasonml' to your ~/.vimrc)
  • Create a project with @opam/merlin as a devDependency. You can fork hello-reason to get started.
  • esy install && esy build as you normally would.
  • Open a .re file from the project in Vim.

Formatting

The command :ReasonPrettyPrint invokes the binary refmt which must be available on your PATH. Add a keyboard mapping shortcut like this:

autocmd FileType reason map <buffer> <D-C> :ReasonPrettyPrint<Cr>

Error/Warning Highlighting:

  • To enable syntastic support, add the following to your ~/.vimrc:
" If using vim-plug, install syntastic:
Plug 'scrooloose/syntastic'
  • Neomake support can be enabled by setting let g:neomake_reason_enabled_makers = ['merlin'].

Merlin

Merlin is supported out of the box by pulling merlin from your devDependencies. You will need to install an autocomplete plugin to get natural complete-as-you-type behavior. For example to install mucomplete, using vim-plug, add the following config:

" If using vim-plug, install mucomplete:
Plug 'lifepillar/vim-mucomplete'
let g:mucomplete#can_complete = {}
let g:mucomplete#enable_auto_at_startup = 1
let g:mucomplete#chains = {'default': ['omni']}

Airline Integration

vim-reasonml includes an airline extension which show the project name of the current file (and project status) in an airline segment. Another included extension shows the current number of syntastic errors and warnings.

" Airline: Enable the airline extensions for esy project status and reason
" syntastic plugin.
let g:airline_extensions = ['esy', 'reason']
let g:reasonml_project_airline=1
let g:reasonml_syntastic_airline=1
let g:reasonml_clean_project_airline=1
let g:airline#extensions#whitespace#enabled = 0
let g:airline_powerline_fonts = 1
let g:airline_skip_empty_sections = 1

LICENSE

Some files from vim-reasonml are based on the Rust vim plugin and so we are including that license.

More Repositories

1

VimBox

Simple, Modern MacVim Configuration
Vim Script
915
star
2

flex

Reason CSS Flexbox implementation
Reason
389
star
3

FaxJs

Fax Javascript Ui Framework
JavaScript
375
star
4

one-click.js

One Click, Offline, CommonJS Modules in the browser
JavaScript
332
star
5

rehp

ReHp
OCaml
222
star
6

paradoc

One Click Docs
JavaScript
179
star
7

pesy

Builds simple esy native packages with minimal configuration.
Shell
114
star
8

flatlandia

Vim colorscheme based on flatland with Airline integration.
Vim Script
113
star
9

CommonML

Simple OCaml Development Workflow on CommonJS
CSS
96
star
10

reason-project-ideas

ReasonML Projects That People Have Expressed Demand For.
86
star
11

navigating-reason

Overview of Reason tooling options for the curious.
70
star
12

reactapp

Starter App For React and CommonJS
JavaScript
51
star
13

esy-issues

Easy ISSUES
JavaScript
49
star
14

vim-taste

Colors based on elementaryOS
Vim Script
34
star
15

reasonml-manual

ReasonML Manual
HTML
33
star
16

native-reason-react-roadmap

Public design discussion about various approaches to building Native Reason React.
24
star
17

PackageJsonForCompilers

Proposal for allowing compiled languages to use the package.json sandbox model
24
star
18

VimCompleteLikeAModernEditor

Make Vim complete like a modern editor - does the right thing. Works with Ultisnips and neocomplete.
Vim Script
23
star
19

reason-wall-demo

Wall (NanoVG port) demo converted to Reason.
OCaml
15
star
20

VimSplitBalancer

Vim Script
14
star
21

common-native-reason-issues

Common Issues When Developing Native Reason Projects
13
star
22

effective-esy-packaging

Effective Esy Packaging Guide
12
star
23

VimCleanColors

Collection of Clean Vim ColorSchemes With Airline Themes
Vim Script
11
star
24

moodules

OO style Libraries for Dune
Reason
8
star
25

file-driven-development

Utilities for a stateless, serverless development environment.
8
star
26

VimJSXHint

Inline JSHint error highlighting with support for JSX
JavaScript
7
star
27

moodules-demo

Demo of virtual libraries implemented in user space.
JavaScript
5
star
28

esy-pesy-starter

Starter example using pesy
C++
3
star
29

refmt-as-ocp-indent

A quick workaround for Nuclide LSP bridge
Shell
3
star
30

VimAutoMakeDirectory

Asks to create directories in Vim when needed
Vim Script
3
star
31

VimJSDocSnippets

Automatically create JSDoc comments for functions using UltiSnips for Vim
Vim Script
3
star
32

create-reason

Esy template for Reason Projects.
3
star
33

VimCloser

Make Vim close tabs the way every other editor does - by switching to the next tab to the left.
Vim Script
2
star
34

atom-reason

CoffeeScript
2
star
35

npm-react-core

NPM build of Facebook's React JavaScript framework.
JavaScript
2
star
36

crayon

Vim Colorscheme Generator
1
star
37

CommonMLAnotherExampleDependency

Another example dependency for https://github.com/jordwalke/CommonML
OCaml
1
star
38

MacVimSmartGUITabs

Shows GUI tabs only when not in fullscreen mode.
Vim Script
1
star
39

VimLastTab

Switch to the most recently used Tab
Vim Script
1
star
40

EditorsWithVimMode

List and summaries of editors that support vim mode. Brief evaluations of completeness.
1
star
41

CommonMLExampleDependency

Example dependency for https://github.com/jordwalke/CommonML
OCaml
1
star