Giter VIP home page Giter VIP logo

vim-erlang's Introduction

vim-erlang

This plugin include the following feature:

  • customerized refactor
  • customerized indenting

The indent plugin is shipped by vim, I just do some modify on it to meet my requirement.

The refactoring plugin is refacored from oscarh/vimerl , the original repo is not maintaining and so that repo is not working for the newest wrangler.

indent style

instead of the default vi indent setting, this plugin use the following indent style:

func(a,b,c) ->
    X = maps:map(fun(K,V) ->
        case b of
            a ->
            b ->
        end
    end, maps:new())

Yes, default to indent shiftwidth spaces under all situation

If you prefer to use the shipped indent setting, just add the following setting to your .vimrc file

let g:erlang_indent_style="system"

refactor tips:

  • make sure you have set up the wrangler right
  • make sure you have erl_call under your working $PATH (if you use brew to install erlang on mac, you will have to find and add it by yourself)

feature trigger

If you don't wanna use this feature and you don't wanna wast your system resource, set up the following command in your .vimrc file

let g:erlangRefactoring=0

setting up wrangler

important , the wrangler api might change by time, my working wrangler is cloned from refactoring tool , commit hash code is 50a7a39c5df2cc1a03d9f40e8a201427b8d5ecc0. so you may wanna get it like:

git clone https://github.com/RefactoringTools/wrangler
cd wrangler
git checkout 50a7a39c5df2cc1a03d9f40e8a201427b8d5ecc0
./configure && make

just making this project is enough, set up the repo's directory in your .vimrc file like this:

let g:erlangWranglerPath='/path/to/compiled/wrangler'

setting up search path

If you follow the OTP's file struct, this refactor plugin should work fine for you , if not, you may need to add the source code search path like this:

let g:refactor_search_path = ["source/path/to/search","another/source/path/to/search"]

key binding

All of the refactoring features' key binding starts by <leader>a,

<leader>ae extra function
<leader>af rename function
<leader>av rename variable
<leader>at tuple function
<leader>am rename module
<leader>ap renmae process

vim-erlang's People

Contributors

johnzeng avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

platinumthinker

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.