Giter Club home page Giter Club logo

braceless.vim's Introduction

Braceless Build Status

Text objects, folding, and more for Python and other indented languages. CoffeeScript support is already baked in, but mainly as an incomplete proof of concept.

Usage

Use your favorite plugin plugin of choice to install tweekmonster/braceless.vim, then add a line like this to your vimrc file:

autocmd FileType python BracelessEnable +indent

The command arguments are:

Option Description
+indent Enable indent handling
+fold Enable folding
+fold-slow Enable indentexpr folding, which is depreciated and slow
+highlight Enable indent guide
+highlight-cc Enable indent guide, but use colorcolumn
+highlight-cc2 Enable indent guide and use colorcolumn

The default motion of interest is P. It can be used for things like vaP, ciP, >iP, etc. :h braceless Covers the details of this plugin.

Text objects

Braceless doesn't give you similarly indented blocks as text objects. You get actual code blocks using iP and aP.

braceless-motions

Object motions

Moving to recognized blocks is done with [[ and ]]. In Python, [m and ]m moves to def and class blocks, while [M and ]M moves to the end of those blocks.

braceless-movement

Folding

Get useful code folding by adding +fold. Unfortunately, this can be a little slow on large scripts. Folding is now much faster! Read the boring exciting details in :h braceless-folds!

braceless-fold

Indent guide

See what indent level you're operating on with +highlight. You can also enable colorcolumn so the guide can span the height of the window. If you would like this kind of indent highlighting in other files that don't need Braceless, take a look at local-indent.vim

braceless-highlight

Somewhat intelligent auto-indent

Ever wished for autoindent that didn't make you fix the indent? Wish no more, pal. Just add +indent. It's not perfect, but it's definitely better. There is even PEP 8 indentation built in, and if you use delimitMate with the expand_cr option enabled, Braceless will disable it temporarily when you're messing with block arguments.

braceless-autoindent

(The backspace key was never used in the image above)

EasyMotion

Built-in support for EasyMotion.

braceless-easymotion

Not just Python!

Braceless can simply recognize indentation.

braceless-others

The above GIF was using:

autocmd FileType haml,yaml,coffee BracelessEnable +indent +fold +highlight

You can extend Braceless to give full support to other indented languages. See :h braceless-custom

License

MIT

braceless.vim's People

Contributors

sgur avatar tweekmonster avatar zhuangya avatar

Watchers

 avatar  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.