Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 plugin
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
README.md

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://github.com/fousa/vim-flog/raw/master/plugin/flog.vim -o ~/.vim/plugin/flog.vim

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

Configuration

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

  • Set the color of for low complexity:
    :silent exe "let g:flog_low_color=#a5c261"

  • Set the color of for medium complexity:
    :silent exe "let g:flog_medium_color=#ffc66d"

  • Set the color of for high complexity:
    :silent exe "let g:flog_high_color=#cc7833"

  • Set the background color:
    :silent exe "let g:flog_background_color=#323232"

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"

Credits

@garybernhardt's pycomplexity.vim.

@topfunky's rubycomplexity.el

@skammer's Ruby Cyclomatic Complexity Plugin

Something went wrong with that request. Please try again.