{"id":13442228,"url":"https://github.com/ZSaberLv0/ZFVimDirDiff","last_synced_at":"2025-03-20T13:33:04.272Z","repository":{"id":44463608,"uuid":"174705324","full_name":"ZSaberLv0/ZFVimDirDiff","owner":"ZSaberLv0","description":"directory diff plugin with split treeview, similar to BeyondCompare, fully async and low dependency","archived":false,"fork":false,"pushed_at":"2024-05-11T15:40:41.000Z","size":294,"stargazers_count":59,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-01T03:39:15.573Z","etag":null,"topics":["diff","treeview","vim","vim-scripts"],"latest_commit_sha":null,"homepage":"","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/ZSaberLv0.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},"funding":{"patreon":"ZSaberLv0","issuehunt":"ZSaberLv0","custom":["https://github.com/ZSaberLv0/ZSaberLv0"]}},"created_at":"2019-03-09T14:36:55.000Z","updated_at":"2024-07-09T13:35:45.000Z","dependencies_parsed_at":"2024-04-26T03:25:17.822Z","dependency_job_id":"6071767b-046f-4156-906e-6dce77ce51e8","html_url":"https://github.com/ZSaberLv0/ZFVimDirDiff","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZSaberLv0%2FZFVimDirDiff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZSaberLv0%2FZFVimDirDiff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZSaberLv0%2FZFVimDirDiff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZSaberLv0%2FZFVimDirDiff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZSaberLv0","download_url":"https://codeload.github.com/ZSaberLv0/ZFVimDirDiff/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221768501,"owners_count":16877650,"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":["diff","treeview","vim","vim-scripts"],"created_at":"2024-07-31T03:01:43.243Z","updated_at":"2025-03-20T13:33:04.266Z","avatar_url":"https://github.com/ZSaberLv0.png","language":"Vim Script","funding_links":["https://patreon.com/ZSaberLv0","https://issuehunt.io/r/ZSaberLv0","https://github.com/ZSaberLv0/ZSaberLv0"],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"\n# Intro\n\nvim plugin to diff two directories like BeyondCompare by using `diff`\n\ninspired by [will133/vim-dirdiff](https://github.com/will133/vim-dirdiff)\n\n* why another directory diff plugin?\n\n    * fully async and queued, works well with tons of files, even for vim 7.3!\n        (by [ZFVimJob](https://github.com/ZSaberLv0/ZFVimJob))\n    * works well on Windows without `sh` or `diff` env\n    * format the diff result as vertical split file tree view,\n        which should be more human-readable\n    * more friendly file sync operation using the same mappings as builtin `vimdiff`\n    * automatically backup before destructive actions\n        (by [ZFVimBackup](https://github.com/ZSaberLv0/ZFVimBackup))\n    * better file or directory exclude logic\n        (by [ZFVimIgnore](https://github.com/ZSaberLv0/ZFVimIgnore))\n\n![](https://raw.githubusercontent.com/ZSaberLv0/ZFVimDirDiff/master/preview.png)\n\nif you like my work, [check here](https://github.com/ZSaberLv0?utf8=%E2%9C%93\u0026tab=repositories\u0026q=ZFVim) for a list of my vim plugins,\nor [buy me a coffee](https://github.com/ZSaberLv0/ZSaberLv0)\n\n\n# How to use\n\n1. requirement\n\n    * vim 8.0 or neovim : recommend, fully async\n    * vim 7.3 or above : all features work as expected, with some lag due to lack of `job`\n\n1. install by [vim-plug](https://github.com/junegunn/vim-plug) or any other plugin manager:\n\n    ```\n    Plug 'ZSaberLv0/ZFVimDirDiff'\n    Plug 'ZSaberLv0/ZFVimJob' \" required\n    Plug 'ZSaberLv0/ZFVimIgnore' \" optional, but recommended for auto ignore setup\n    Plug 'ZSaberLv0/ZFVimBackup' \" optional, but recommended for auto backup\n    ```\n\n1. start diff by one of these methods\n\n    * use `:ZFDirDiff` command to start diff\n\n        ```\n        :ZFDirDiff pathA pathB\n        ```\n\n        if path contains spaces:\n\n        ```\n        :ZFDirDiff path\\ A path\\ B\n        :call ZFDirDiff(\"path A\", \"path B\")\n        ```\n\n    * use `:ZFDirDiffMark` to mark two directories to start diff\n\n        Open a file and `:ZFDirDiffMark` and the containing directory will be stored as\n        a diff candidate. Then repeat with another file and you'll be asked to\n        diff the two.\n\n        ```\n        :edit pathA/file.vim\n        :ZFDirDiffMark\n        :edit pathB/file.vim\n        :ZFDirDiffMark\n        ```\n\n        Or integrate with your file manager. For vim-dirvish, add\n        ~/.vim/ftplugin/dirvish.vim:\n\n            nnoremap \u003cbuffer\u003e X :\u003cC-u\u003eZFDirDiffMark \u003cC-r\u003e\u003cC-l\u003e\u003cCR\u003e\n\n        Or for netrw, add ~/.vim/ftplugin/netrw.vim:\n\n            nnoremap \u003cbuffer\u003e X :\u003cC-u\u003eZFDirDiffMark \u003cC-r\u003e=b:netrw_curdir\u003cCR\u003e/\u003cC-r\u003e\u003cC-l\u003e\u003cCR\u003e\n\n        Then X on two directories.\n\n    * you can also start diff from [scrooloose/nerdtree](https://github.com/scrooloose/nerdtree):\n        inside nerdtree window, press `m` to popup menu,\n        press `z` to choose `mark to diff`,\n        and mark another node again to start diff\n\n    * you may also use it as command line diff tool\n\n        ```\n        vim -c 'call ZFDirDiff(\"path A\", \"path B\")'\n        sh ZFDirDiff.sh \"path A\" \"path B\"\n        ```\n\n1. within the diff window:\n\n    * use `DD` to update the diff result under cursor\n    * use `o` or `\u003ccr\u003e` to diff current file, or fold/unfold current dir\n    * use `O` to unfold all contents under current dir,\n        `x` to fold to parent, `X` to fold to root\n    * use `cd` to make current dir as diff root dir,\n        `u` to go up for current side,\n        and `U` to go up for both side\n    * use `DM` to mark current file,\n        and `DM` again on another file to diff these two files\n    * use `]c` or `DJ` to move to next diff, `[c` or `DK` to prev diff,\n        use `Dj` / `Dk` to move to next / prev diff file\n    * use `do` or `DH` to sync from another side to current side,\n        `dp` or `DL` to sync from current side to another side\n    * use `a` to add new file or dir\n    * use `dd` to delete node under cursor\n    * use `DN` to mark mutiple files,\n        when done, use `do/DH/dp/DL/dd` to sync or delete marked files\n    * use `p` to copy the node's path, and `P` for the node's full path\n    * use `q` to exit diff\n    * you may also want to use [ZSaberLv0/ZFVimIndentMove](https://github.com/ZSaberLv0/ZFVimIndentMove)\n        or [easymotion/vim-easymotion](https://github.com/easymotion/vim-easymotion)\n        to quickly move between file tree node\n\n1. within the file diff window:\n\n    * it's vim's builtin diff, see `:h diff` for more info\n    * use `q` to quick file diff and back to owner diff window\n\n\n# Configs\n\nthis plugin should work well without any extra config\n\nfor experienced user, here's some configs you may interest\n\n\n## Diff logic\n\n* `let g:ZFDirDiff_autoBackup = 1` : whether perform auto backup, see https://github.com/ZSaberLv0/ZFVimBackup\n* `let g:ZFDirDiff_ignoreEmptyDir = 1` : whether ignore empty dir\n* `let g:ZFDirDiff_ignoreSpace = 0` : whether ignore empty lines and spaces (not supported for python backend)\n* `let g:ZFIgnoreOption_ZFDirDiff = {...}` : ignore options, see https://github.com/ZSaberLv0/ZFVimIgnore\n\n    ```\n    let g:ZFIgnoreOption_ZFDirDiff = {\n                \\   'bin' : 0,\n                \\   'media' : 0,\n                \\   'ZFDirDiff' : 1,\n                \\ }\n    ```\n\n\n## Keymap (inside diff window)\n\n* `let g:ZFDirDiffKeymap_update = []` : update entire diff window\n* `let g:ZFDirDiffKeymap_updateParent = ['DD']` : update diff under cursor\n* `let g:ZFDirDiffKeymap_open = ['\u003ccr\u003e', 'o']` : toggle dir open or open file diff\n* `let g:ZFDirDiffKeymap_foldOpenAll = []` : open all node under cursor, including same files\n* `let g:ZFDirDiffKeymap_foldOpenAllDiff = ['O']` : open all diff node under cursor\n* `let g:ZFDirDiffKeymap_foldClose = ['x']` : close node\n* `let g:ZFDirDiffKeymap_foldCloseAll = ['X']` : close all node\n* `let g:ZFDirDiffKeymap_goParent = ['U']` : make both left and right diff window go to parent dir\n* `let g:ZFDirDiffKeymap_diffThisDir = ['cd']` : change current side's root to node under cursor\n* `let g:ZFDirDiffKeymap_diffParentDir = ['u']` : change current side's root to parent\n* `let g:ZFDirDiffKeymap_markToDiff = ['DM']` : mark node under cursor, mark again to diff with two marked node\n* `let g:ZFDirDiffKeymap_markToSync = ['DN']` : mark one or more nodes, to sync mutiple nodes at once\n* `let g:ZFDirDiffKeymap_quit = ['q']` : quit diff\n* `let g:ZFDirDiffKeymap_diffNext = [']c', 'DJ']` : jump to next visible diff\n* `let g:ZFDirDiffKeymap_diffPrev = ['[c', 'DK']` : jump to prev visible diff\n* `let g:ZFDirDiffKeymap_diffNextFile = ['Dj']` : jump to next diff file, auto open closed dir\n* `let g:ZFDirDiffKeymap_diffPrevFile = ['Dk']` : jump to prev diff file, auto open closed dir\n* `let g:ZFDirDiffKeymap_syncToHere = ['do', 'DH']` : sync nodes from there to here\n* `let g:ZFDirDiffKeymap_syncToThere = ['dp', 'DL']` : sync nodes from here to there\n* `let g:ZFDirDiffKeymap_add = ['a']` : add new node, end with `/` to add dir\n* `let g:ZFDirDiffKeymap_delete = ['dd']` : delete selected nodes\n* `let g:ZFDirDiffKeymap_getPath = ['p']` : get relative path of node under cursor\n* `let g:ZFDirDiffKeymap_getFullPath = ['P']` : get absolute path of node under cursor\n\n\n## Keymap (inside file diff window)\n\n* `let g:ZFDirDiffKeymap_quitFileDiff = ['q']` : quit file diff, and go back to its owner diff window\n\n\n## UI spec\n\n* `let g:ZFDirDiffUIChar_dir_prefix_closed = '+ '`\n* `let g:ZFDirDiffUIChar_dir_prefix_opened = '~ '`\n* `let g:ZFDirDiffUIChar_dir_postfix = '/'`\n* `let g:ZFDirDiffUIChar_file_prefix = '  '`\n* `let g:ZFDirDiffUIChar_file_postfix = ''`\n* `let g:ZFDirDiffUI_tabstop = 2`\n* `let g:ZFDirDiffUI_autoOpenSingleChildDir = 1`\n* `let g:ZFDirDiffUI_showSameDir = 1`\n* `let g:ZFDirDiffUI_showSameFile = 1`\n\n\n### Highlight\n\n```\nhighlight default link ZFDirDiffHL_Header Title\nhighlight default link ZFDirDiffHL_Tail Title\nhighlight default link ZFDirDiffHL_DirChecking SpecialKey\nhighlight default link ZFDirDiffHL_DirSame Folded\nhighlight default link ZFDirDiffHL_DirDiff DiffAdd\nhighlight default link ZFDirDiffHL_FileChecking SpecialKey\nhighlight default link ZFDirDiffHL_FileSame Folded\nhighlight default link ZFDirDiffHL_FileDiff DiffText\nhighlight default link ZFDirDiffHL_DirOnlyHere DiffAdd\nhighlight default link ZFDirDiffHL_FileOnlyHere DiffAdd\nhighlight default link ZFDirDiffHL_ConflictDirHere ErrorMsg\nhighlight default link ZFDirDiffHL_ConflictDirThere WarningMsg\nhighlight default link ZFDirDiffHL_MarkToDiff Cursor\nhighlight default link ZFDirDiffHL_MarkToSync Cursor\n```\n\n\n# FAQ\n\n* Q: screen keeps blink when diff updating in background\n\n    A: unfortunately, I have no idea for how to solve this issue,\n        mainly because of `matchadd()` must inside proper window,\n        causing frequent window switching\n\n* Q: use as `git difftool --dir-diff`\n\n    A: https://github.com/ZSaberLv0/ZFVimDirDiff/issues/45\n\n    add these to your `.gitconfig`\n\n    ```\n    [alias]\n    dirdiff = difftool --ignore-submodules --dir-diff --symlinks --tool=vimdirdiff\n    [difftool \"vimdirdiff\"]\n    cmd = vim -f '+next' '+execute \"ZFDirDiff\" argv(0) argv(1)' $LOCAL $REMOTE\n    ```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FZSaberLv0%2FZFVimDirDiff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FZSaberLv0%2FZFVimDirDiff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FZSaberLv0%2FZFVimDirDiff/lists"}