Giter VIP home page Giter VIP logo

sublime-text-block-nav's Introduction

Block Nav plugin for Sublime Text 2.
Copyright 2012 Jesse McCarthy <http://jessemccarthy.net/>.

The Software may be used under the MIT (aka X11) license or Simplified
BSD (aka FreeBSD) license.  See LICENSE

Adds functionality to assist with navigating block structures in
"braceless" languages like Ruby and Python where brace matching can
not be used.

Adds a command that can be called from key bindings to navigate to the
start / end of block structures such as classes, methods, functions,
and blocks.

The operation of the plugin is based on indentation, so it will only
work for well-indented code, that does not mix tabs and spaces.


USAGE:

See the keymap for bindings.  It includes commands to navigate:

* Up and out (northwest), to find the beginning of the block
structure that the current line is nested in.

* Up (north), for example to find the beginning of IF / ELSEIF blocks
that correspond to ELSEIF / ELSE blocks.  Or, when on a line of Ruby
code containing an 'end' keyword for something like a method, to find
the line where it started.  When on the 'end' line for something like
and IF expression with ELSIF / ELSE clauses, will navigate to start
lines for intervening ELSIF / ELSE clauses on the way to the start
line for the IF expression.

* Down (south), for example to find the beginning of ELSEIF / ELSE
blocks that correspeond to IF / ELSEIF blocks.

* Down and in (southeast), to find the end of the block structure that
begins on the current line.


Does not currently do anything when the cursor is on a line that
contains only whitespace.  Start with the cursor on a line that
contains non-whitespace and that is nested within the block you want
to find the start of.

With the currently included key bindings it's unfortunately easy to
accidentally screw up the key combo and accidentally invoke the
built-in key binding to shift the current line up / down, so be
careful.


TO DO:

* Figure out better key bindings?

* Handle starting on a line containing only whitespace?

sublime-text-block-nav's People

Contributors

jmm avatar

Watchers

Pavel Savchenko avatar James Cloos 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.