Code Monkey home page Code Monkey logo

vim-textobj-matchit's Introduction

vim-textobj-matchit

A Vim plugin that creates text objects from matchit pairs, to be used with:

  • Ruby (if…end, def…end)
  • Blade (@section…@endsection)
  • Shell (if…fi, for…done)
  • Vim script (if…endif, for…endfor)
  • 🤷‍♂️ Any other filetype that defines similar matchit pairs

📦 Installation

Depends on vim-textobj-user and matchit.

Plug 'kana/vim-textobj-user'
Plug 'adriaanzon/vim-textobj-matchit'

runtime macros/matchit.vim

It's likely that matchit is already enabled. You can check so by running :echo g:loaded_matchit. It will return 1 when it's enabled.

✨ Usage

Textobj-matchit maps 2 keystrokes: am and im. They work like any other text object: am selects the all of the matchit pair, im the inner portion of the matchit pair.

See :h textobj-matchit for more details, including instructions on how to define your own key mappings.

👨‍🏫 History

This plugin derives from vim-textobj-rubyblock and vim-textobj-blade-directive. I wanted something similar that works for every filetype, so that is why I created this plugin.

📄 License

Copyright © Adriaan Zonnenberg. Distributed under the same terms as Vim itself. See :help license.

vim-textobj-matchit's People

Contributors

adriaanzon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vim-textobj-matchit's Issues

Not working with vim 8.2

I have vim 8.2 and vim-scripts/matchit.zip. The plugin textobj-matchit isn't working, maybe I couldn't set up properly. Would be glad if you could help.

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.