Giter VIP home page Giter VIP logo

vim-flog's Introduction

Vim Flog Plugin

(Forked from Ruby Cyclomatic Complexity Plugin created by @skammer)

Indicates the Flog number in front of the action in your Ruby code to indicate the complexity.

Screen shot

Requirements

  • ruby
  • flog rubygem
  • vim 7.3+, compiled with:
    • +ruby
    • +signs

Installation

First of all make sure you have a Vim installed with Ruby support. If you use MacVim than you can build your own version of Vim like this.

Here is an example of my configuration during the build:

./configure --with-features=huge --enable-rubyinterp --enable-pythoninterp --enable-perlinterp --enable-cscope

Install the Flog gem like this: gem install flog.

To install the plugin just run this command in your Terminal:

curl https://raw.github.com/fousa/vim-flog/master/plugin/flog.vim -o ~/.vim/plugin/flog.vim

When this is done add :silent exe "g:flog_enable" to your .vimrc file.

Configuration

To change colors of sings, use the higlight command. The used groups are

  • SignLowComplexity
  • SignMediumComplexity
  • SignHighComplexity

You can set the limits for the complexity indication with the following commands in your .vimrc:

  • Set the limit to switch to a medium complexity:
    :silent exe "let g:flog_medium_limit=10"

  • Set the limit to switch to a high complexity:
    :silent exe "let g:flog_high_limit=20"

You can hide some levels of complexity:

  • Hide low complexity:
    :silent exe "let g:flog_hide_low=1"

  • Hide medium complexity:
    :silent exe "let g:flog_hide_medium=1"

You can also turn flog off and on:

  • Turn on flog :call FlogEnable()

  • Turn off flog :call FlogDisable()

  • Toggle flog :call FlogToggle()

Additionally, you can map this in your .vimrc: :map ,f :call FlogToggle()<cr>

Credits

@garybernhardt's pycomplexity.vim.

@topfunky's rubycomplexity.el

@skammer's Ruby Cyclomatic Complexity Plugin

vim-flog's People

Contributors

skammer avatar fousa avatar malept avatar akarzim avatar vrybas avatar sentientmonkey avatar onemanstartup avatar lparry avatar mando avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

akarzim

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.