{"id":13898849,"url":"https://github.com/chrisbra/vim-diff-enhanced","last_synced_at":"2025-04-03T06:47:38.945Z","repository":{"id":27840642,"uuid":"31330732","full_name":"chrisbra/vim-diff-enhanced","owner":"chrisbra","description":"Better Diff options for Vim","archived":false,"fork":false,"pushed_at":"2024-09-20T21:06:06.000Z","size":309,"stargazers_count":359,"open_issues_count":0,"forks_count":17,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-02-08T20:47:23.569Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.vim.org/scripts/script.php?script_id=5121","language":"Vim Script","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chrisbra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-02-25T19:04:13.000Z","updated_at":"2025-01-15T10:48:28.000Z","dependencies_parsed_at":"2025-02-09T23:33:07.765Z","dependency_job_id":null,"html_url":"https://github.com/chrisbra/vim-diff-enhanced","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisbra%2Fvim-diff-enhanced","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisbra%2Fvim-diff-enhanced/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisbra%2Fvim-diff-enhanced/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisbra%2Fvim-diff-enhanced/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrisbra","download_url":"https://codeload.github.com/chrisbra/vim-diff-enhanced/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246952273,"owners_count":20859811,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-06T18:04:29.346Z","updated_at":"2025-04-03T06:47:38.920Z","avatar_url":"https://github.com/chrisbra.png","language":"Vim Script","funding_links":[],"categories":["Vim Script"],"sub_categories":[],"readme":"# EnhancedDiff plugin [![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/cb%40256bit.org)\n\u003e A Vim plugin for creating better diffs (sometimes)\n\nThis plugin allows you to make use of the Patience diff algorithm for\ngenerating diffs to use with Vim. This needs the git command line tool\navailable. (But see [Update below][Update])\n\nYou can also customize your setup to use any other tool to generated diffs\n(e.g. mercurial) Read the help on how to configure the plugin accordingly.\n\nHere are some screenshots that visualize how the patience/histogram algorithm\nwork.\n\nThis is the default diff generated by Vim:\n![Default diff](default_diff.png)\n\nNow change that to using the \"histogram\" algorithm by running `:EnhancedDiff histogram`\nIf Vim is in diff mode, the diff will be updated to this:\n\n![histogram diff](histogram_diff.png)\n\nNote, that the Patience algorithm might not always provide better diffs. But\nusing this plugin you can at least easily switch between different diffs.\n\n## Update \nStarting with Vim [8.1.0360][Vim_81360] Vim now comes bundled with the xdiff\nlibrary and is able to handle diff internally without falling back to\ncalling `diff` as external tool.\n\nThis means, one can now simply set diffopt:\n\n    if has(\"patch-8.1.0360\")\n        set diffopt+=internal,algorithm:patience\n    endif\n\nand Vim will use the patience diff algorithm when creating a diff.\n\nIn addition, Vim can now parse context diffs (currently with only zero\ncontext lines) from a diff tool when using diff as external tool. So a\ntranslation to an ed-like diff is not needed anymore.\n\nSo in essence, starting with that Vim version, you don't need to use this\nplugin anymore.\n\n# Ignoring parts of a file\n\nUsing the command `:EnhancedDiffIgnorePat pat` you can define patterns, that\nwill be ignored before feeding the buffer contents to the diff program.\nInternally this will be handled by substituting those matches with 'XX'\nso that the content will look like the same for the diff binary.\n\nThis is how it looks like with a pattern of `^[^;]\\+;` and `;[^;]\\+$`\n![diff_ignore](diff_ignore.png)\n\n### Installation\nUse the plugin manager of your choice:\n\n* [Pathogen][pathogen]\n  * `git clone https://github.com/chrisbra/vim-diff-enhanced.git ~/.vim/bundle/vim-enhanced-diff`\n  * `:Helptags` (only needed once after the installation to install the documentation)\n* [NeoBundle][neobundle]\n  * `NeoBundle 'chrisbra/vim-diff-enhanced'`\n* [Vundle][vundle]\n  * `Plugin 'chrisbra/vim-diff-enhanced'`\n* [Vim-Plug][vim-plug]\n  * `Plug 'chrisbra/vim-diff-enhanced'`\n\nAlternatively download the [stable][] version of the plugin, edit it with Vim (`vim EnhancedDiff-XXX.vmb`) and simply source it (`:so %`). Restart and take a look at the help (`:h EnhancedDiff.txt`)\n\n[stable]: http://www.vim.org/scripts/script.php?script_id=5121\n\n### Usage\nOnce installed, take a look at the help at `:h EnhancedDiff`\n\nHere is a short overview of the functionality provided by the plugin:\n#### Ex commands:\n`:PatienceDiff` - Use the Patience Diff algorithm for the next diff mode\n\n`:EnhancedDiff \u003calgorithm\u003e`  - Use \u0026lt;algorithm\u003e to generate the diff.\nUse any of\n* myers\t\tDefault Diff algorithm used\n* default\tAlias for myers algorithm\n* histogram     Fast version of patience algorithm\n* minimal\tDefault diff algorithm, trying harder to minimize the diff\n* patience\tPatience diff algorithm.\n\nNote: Those 2 commands use the git command line tool internally to generate the\ndiffs. Make sure you have at least git version 1.8.2 installed.\n\n`:EnhancedDiffDisable`    - Disable plugin (and use default Vim diff capabilities).\n\n### FAQ\n\n#### How can I enable the patience diff algorithm when starting as vimdiff / git difftool / ... ?\nIn that case, add this snippet to your .vimrc:\n```viml\n\" started In Diff-Mode set diffexpr (plugin not loaded yet)\nif \u0026diff\n    let \u0026diffexpr='EnhancedDiff#Diff(\"git diff\", \"--diff-algorithm=patience\")'\nendif\n```\n### License \u0026 Copyright\n\n© 2015 by Christian Brabandt. The Vim License applies. See `:h license`\n\n__NO WARRANTY, EXPRESS OR IMPLIED.  USE AT-YOUR-OWN-RISK__\n\n[pathogen]: https://github.com/tpope/vim-pathogen\n[neobundle]: https://github.com/Shougo/neobundle.vim\n[vundle]: https://github.com/gmarik/vundle\n[vim-plug]: https://github.com/junegunn/vim-plug\n[Vim_81360]: https://github.com/vim/vim/releases/tag/v8.1.0360\n[Update]: https://github.com/chrisbra/vim-diff-enhanced/blob/master/README.md#update\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisbra%2Fvim-diff-enhanced","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisbra%2Fvim-diff-enhanced","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisbra%2Fvim-diff-enhanced/lists"}