Giter VIP home page Giter VIP logo

vim-indent-object's Introduction

vim-indent-object

Intro

Vim text objects provide a convenient way to select and operate on various types of objects. These objects include regions surrounded by various types of brackets and various parts of language (ie sentences, paragraphs, etc).

This plugin defines a new text object, based on indentation levels. This is very useful in languages such as Python, in which the syntax defines scope in terms of indentation. Using the objects defined in this plugin, an entire if structure can be quickly selected, for example.

Install

  • vim-plug
Plug 'michaeljsmith/vim-indent-object'

Usage

This plugin defines two new text objects. These are very similar - they differ only in whether they include the line below the block or not.

Key bindings Description
<count>ai An Indentation level and line above.
<count>ii Inner Indentation level (no line above).
<count>aI An Indentation level and lines above/below.
<count>iI Inner Indentation level (no lines above/below).

Note: the iI mapping is mostly included simply for completeness, it is effectively a synonym for ii.

Just like regular text objects, these mappings can be used either with operators expecting a motion, such as d or c, as well as in visual mode.

In visual mode the mapping can be repeated, which has the effect of iteratively increasing the scope of indentation block selected. Specifying a count can be used to achieve the same effect.

FeedBack

vim-indent-object was written by Michael Smith [email protected]. The project repository is kept at:

http://github.com/michaeljsmith/vim-indent-object

Any feedback or criticism is welcome, and can be mailed to the author at the above email address. Alternatively issues can be raised on the project website.

vim-indent-object's People

Contributors

juanghurtado avatar michaeljsmith avatar pbyrne avatar schlichtanders avatar wsdjeg avatar

Watchers

 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.