GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - bootleq/vim-gitdiffall: View git diff in Vim tabs.

BranchesTags
Open more actions menu

Latest commit

 

History

139 Commits
139 Commits

Folders and files

NameName
Last commit message
Last commit date
autoload
autoload
 
 
bin
bin
 
 
config
config
 
 
doc
doc
 
 
plugin
plugin
 
 
syntax
syntax
 
 
.gitignore
.gitignore
 
 
CHANGES.md
CHANGES.md
 
 
README.md
README.md
 
 
install.zsh
install.zsh
 
 

Repository files navigation

gitdiffall

View git diff in Vim tabs.

  • gitdiffall function for zsh (requires ruby for running gitdiffall.rb).
  • GitDiff, GitDiffInfo, GitDiffOff commands for Vim.

Install

Install like general Vim plugins.

Install Zsh Helper Function

  • With zcomet

    zcomet trigger gitdiffall bootleq/vim-gitdiffall bin
  • or zplug

    zplug "bootleq/vim-gitdiffall", use:"bin/*.zsh"
  • or Manual install

    1. Execute install.zsh (will ask you for copying scripts to path).
    2. Source path/to/gitdiffall.zsh in your .zshrc.
    if [ -e ~/some_dir/gitdiffall.zsh ]; then
      source ~/some_dir/gitdiffall.zsh
    fi

Zsh Function Usage

In zsh, use gitdiffall to open git diff in Vim tabs, examples:

  • gitdiffall diff current unstaged/staged changes, like git diff.
  • gitdiffall --cached diff staged changes with HEAD.
  • gitdiffall dae86e see all changes since commit "dae86e".
  • gitdiffall HEAD..HEAD~2 works like git diff HEAD..HEAD~2.

For convenience, some special notations are available:

  • gitdiffall @dae86e expands to dae86e^..dae86e,
    this is a shortcut for checking changes at specific commit.
    Examples: @@~2 (HEAD~2), @stash@{0} (stashed entry), @master (last commit at master branch).

  • gitdiffall 1 is similar to @<rev>, where <rev> is the 1st previous commit from HEAD.
    You can increase the digit for older commits.

  • gitdiffall j and gitdiffall k shortcut to next/previous commit from last evaluated gitdiffall <n>.
    (this uses environment variable $_GITDIFFALL_LAST_SHORTCUT to remember last eval)

During merge conflicts, gitdiffall will open a 3-way diff in Vim.

Zsh Function Configuration

gitdiffall.rb takes configure file from one of the following:

  • $XDG_CONFIG_HOME/gitdiffall/config.rb
  • $XDG_CONFIG_HOME/gitdiffall-config.rb
  • ~/gitdiffall/config.rb
  • ~/gitdiffall-config.rb
  • {dir_contains_gitdiffall.rb}/gitdiffall/config.rb
  • {dir_contains_gitdiffall.rb}/gitdiffall-config.rb

Supported config items:

  • editor_cmd (default: respect $EDITOR, or "vim")
    Command to execute Vim.
  • max_files (default: 14)
    Wait for confirmation before open such many files.
  • min_hash_abbr (default: 5)
    When performing gitdiffall <n>, <n> must have this many digits to indicate a hash, otherwise it's a number.
  • ignore_pattern (default: /\.(png|jpg)\Z/i)
    Files match this pattern will not be sent to Vim.

Example config.rb:

CONFIG = {
  :editor_cmd     => "vim -u /some/other/vimrc",
  :max_files      => 14,
  :min_hash_abbr  => 5,
  :ignore_pattern => /(\.(png|jpg)|-compressed\.js)\Z/i
}

Tips

In tmux copy mode, select some commit hash and press > to do gitdiffall in new tmux window, see tmux-in.rb gist.

bind -t vi-copy > copy-pipe "~/.tmux-in.rb gitdiffall"

About

View git diff in Vim tabs.

Resources

Readme
Activity

Stars

5 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.