Code Monkey home page Code Monkey logo

delim-kill's Introduction

delim-kill.el --- Kill text between delimiters.

Copyright (C) 2010 Thomas Kappler

This file is not part of GNU Emacs.

Licensed under the GPL version 3 or later.

Commentary

Kill text between two delimiters, preserving structure.

delim-kill.el contains a single convenience function for editing structured data: delim-kill. Given two characters FROM and TO, it kills the text between the first occurence of FROM before point and the first occurence of TO after point. FROM and TO may be identical.

If FROM and TO are not identical, the function preserves the balance between the two characters: For each FROM that is encountered while looking for TO, one additional TO is required; and vice versa. For example, in "{ foo X{bar} baz }", with X being point and "{" and "}" as delimiters, the text "{ foo {bar} baz }" will be killed, not "{ foo {bar}".

delim-kill is useful in programming and in editing other files with structure, such as CSV or JSON. In C-style langiuages, for instance, you can use it to easily kill the {}-delimited block you are currently in. In a CSV file you might kill the current field, regardless of where point is.

delim-kill was inspired by Damian Conway's course "The productive programmer". Thanks!

Dependencies: none.

Installation

Put the file anywhere in your load path, (require 'delim-kill), and bind the function to a key.

History

  • 2010-05: First release.

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.