- Cleans up required or imported Sanctuary functions when using destructing assignment.
- Reads functions from local Sanctuary instance based on the current working directory.
npm install -g sanctuary-destruct
Prints the modified file contents to stdout.
sanctuary-destruct path/to/file.js
cat path/to/file.js | sanctuary-destruct
%!sanctuary-destruct
Or use Preserve function that restores cursor position after:
:call Preserve("%!sanctuary-destruct")
Install the FilterPipes plugin and add a key binding like
{ "keys": ["alt+shift+d"], "command": "filter_pipes_process", "args": {"command": "sanctuary-destruct"}}
Big thanks to Raine Virta whose ramda-destruct package was the inspiration for this.