Giter VIP home page Giter VIP logo

vim-blockle's Introduction

vim-blockle

This plugin allows rapid toggling between the two different styles of ruby blocks, namely do/end and brackets {}. To use, simply move the cursor to the beginning or end of a block, and type b. As a mnemonic, remember 'b' for 'block'.

Note: This plugin works best if you have your cursor on a do, end, {, or }. An attempt is made for it to work if you are inside a block as well, in which case the most immediate parent will be toggled.

When moving from a do/end to a bracket-style block, the plugin will attempt to move to a one-liner if appropriate.

For example, if you have the following ruby code (* indicates cursor position):

['one', 'two'].each d*o |number|
  puts number + "!"
end

After invoking b, the resulting code would be:

['one', 'two'].each *{ |number| puts number + "!" }

Installation

If you don't have a preferred installation method, I recommend installing pathogen.vim, and then simply copy and paste:

cd ~/.vim/bundle
git clone git://github.com/dwaller/vim-blockle.git

Once help tags have been generated, you can view the manual with :help blockle.

This plugin is only available if 'compatible' is not set, and will only work correctly if matchit.vim is available.

License

Copyright (c) Joshua Davey. Distributed under the same terms as Vim itself. See :help license.

vim-blockle's People

Contributors

cutalion avatar dwaller avatar jgdavey avatar

Watchers

 avatar  avatar

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.