# parinfer_rust

> Rust (WebAssembly) port of Parinfer.

Latest version **0.2.0** (published 2018-06-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install parinfer_rust
pnpm add parinfer_rust
yarn add parinfer_rust
bun add parinfer_rust
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2018-06-29 |
| First published | 2018-06-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.9 |
| Dependencies | 0 |
| Unpacked size | 982.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 628 |
| Author | Jason Felice |
| Maintainers | eraserhd |

## Links

- npm: https://www.npmjs.com/package/parinfer_rust
- Repository: https://github.com/eraserhd/parinfer-rust
- Issues: https://github.com/eraserhd/parinfer-rust/issues
- npm.io page: https://npm.io/package/parinfer_rust

## Recent versions

- 0.2.0 (latest) — 2018-06-29

## README

# parinfer-rust

https://github.com/eraserhd/parinfer-rust

A full-featured, super snappy port of [Shaun Lebron's parinfer] to Rust.  This
repo comes with Vim plugin files that work with Vim8 and Neovim.  The Rust
library can be called from other editors that can load dynamic libraries.

This plugin, unlike others available for Vim, implements "smart" mode.  Rather
than switching between "paren" mode and "indent" mode, parinfer uses
information about how the user is changing the file to decide what to do.

[Shaun Lebron's parinfer]: https://shaunlebron.github.io/parinfer/

## Installing

You need to have [rust installed](https://www.rust-lang.org/en-US/install.html).

### `pathogen`

If you are using Tim Pope's `pathogen`:

    $ cd ~/.vim/bundle
    $ git clone git@github.com:eraserhd/parinfer-rust
    $ cd ~/.vim/bundle/parinfer-rust
    $ cargo build --release

### `vim-plug`

```viml
Plug 'eraserhd/parinfer-rust'
```

Then, build project using cargo:

    $ cd /path/to/parinfer-rust
    $ cargo build --release

Or, with optional automatic recompilation on update:

```viml
Plug 'eraserhd/parinfer-rust', {'do':
        \  'cargo build --release'}
```

## Building WebAssembly

WebAssembly currently needs the "nigthly" toolchain:

    $ rustup update
    $ rustup install nightly
    $ rustup target add wasm32-unknown-unknown --toolchain nightly
    $ cargo +nightly install cargo-web

It can then be built with:

    $ cargo +nightly web build --release

## Tests

You can run tests like so:

    $ cargo test                   # Run the native tests
    $ cargo +nightly web test      # Test the WebAssembly version
    $ vim --clean -u tests/run.vim # Integration tests

Tests are in a nice, readable format in `tests/test_*.vim`.  Please add tests
for any new features (or even old ones!).  You can set the `VIM_TO_TEST`
environment variable to Vim's path to test weird or different builds.

## Contributors

This wouldn't be possible without the work of others:

* Shaun Lebron - Inventing parinfer and doing the math.
* Case Nelson - Writing the nvim-parinfer, from which VimL code and some
  inspiration  was stolen.

## License

[ISC License](LICENSE.md)

---
_Source: https://npm.io/package/parinfer_rust · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
