pipe_converter

A vim plugin that convert your nested functions into pipe operators

MIT License

Stars
7

PipeConverter

note: It is early release. It has some bugs and lack of use cases.

Demo

Config

Vim

" Add this line to your .vimrc file
" Vundle
Plugin 'marocchino/pipe_converter'

" Plug
Plug 'marocchino/pipe_converter', { 'do': 'mix escript.build' }

let g:pipe_converter_command = "~/.vim/plugged/pipe_converter/pipe_converter"

" minpac
call minpac#add('marocchino/pipe_converter', { 'do': '!mix escript.build' })

let g:pipe_converter_command = "~/.vim/pack/minpac/start/pipe_converter/pipe_converter"



" Change it your own keymap.
nnoremap ec :call PipeConvert()<CR>
nnoremap er :call PipeRevert()<CR>

Usage in shell

$ cd pipe_converter
$ ./pipe_converter "a(b, c, d)"
b |> a(c, d)
$ ./pipe_converter --revert "b |> a |> c(d)"
c(a(b), d)

Escript Build

$ mix escript.build

Test

$ mix test