Giter Club home page Giter Club logo

diffurcate.vim's Introduction

Build Status

Usage

The plugin comes with only one command, :Diffurcate. Open a git diff and execute the command, and it'll open a new tab in a temporary directory that contains separate diffs per file, mirroring the original directory structure. If you happen to have the NERDTree plugin installed, it'll open it as well (happy to add similar functionality for other navigation plugins, just open a github issue).

Demo

You can do this with a file on the filesystem, or just redirect the output from a git command, for example:

git diff | vim - -R +Diffurcate

At the moment, this only works on git diffs, but if you'd like to get support for other VCS diffs, it shouldn't be too hard to implement.

Internals

The plugin uses Vim's tempname() function to create a temporary directory that will be deleted when Vim exits. That's where it creates each individual file. It uses regexes to figure out where the individual diffs start and end, so if it messes something up, it might be the pattern doesn't cover all the right cases -- please open a github issue and we'll figure it out.

Naming

Picked the name from Doug's suggestion here: https://twitter.com/douglasfshearer/status/1447145443884994568

Very grateful for all the ideas from the replies to both of these tweets:

Contributing

Pull requests are welcome, but take a look at CONTRIBUTING.md first for some guidelines. Be sure to abide by the CODE_OF_CONDUCT.md as well.

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.