*gitblame.txt* Plugin for working with git Author: Michael Moser (https://github.com/MoserMichael) License: Same terms as Vim itself (see |license|) repository: http://github.com/MoserMichael/gitblame CONTENTS *gitblame-contents* Introduction |gitblame-introduction| Command |gitblame-command| Changelog |gitblame-changelog| ============================================================================== INTRODUCTION *gitblame-introduction* The *gitblame* ( *gitblame.vim* ) provides a minimal command set for working with git; It started with commands for git blame and git grep, then added other commands as well. ------------------------------------------------------------------------------ COMMAND *gitblame-command* Blame - runs git blame on the file path of the current buffer and puts the output into a named scratch buffer, the scratch buffer has the name of the git blame command. The cursor position in that buffer is the same as in the source buffer. While in the blame buffer, press Enter or run Blame to open another buffer with the commit that changed the current line. GitGrep - enter a search string that is searched in the current git repository. The word under the cursor is suggested as the default search term. Assumes that the current working directory is part of a git repository Gitls - list all files under git from current directory downward; files are listed in the quickfix buffer, so that you can enter it to open a buffer with the file. Graph - runs git log --graph to produce a text graph of the commits, and puts the output into a named scratch buffer, the scratch buffer has the name of the command. While in the same buffer, press Enter to open another buffer with the commit described by the current line in the graph. GitLog - runs git log --name-status --find-renames to produce a log of commits, and puts the output into a named scratch buffer, While in the same buffer, press Enter to open another buffer with the commit nearest to the cursor position. GitLogF - gets an additional file name argument, show log only for changes on this file. BranchLocal - list all local branch names in a buffer, if you press enter on a line in that buffer then it switches the local branch to that in the line. BranchRemote - list all remote branch names in a buffer, if you press enter on a line in that buffer, then it checks out that branch and switches to it. GitDiff - run git diff --name-only to get the list of the files that differed from the top of the branch and open the list in another buffer. while in the same buffer, press Enter to open another buffer in vimdiff mode that shows the difference. GitDiffNoSpace - run git diff --name-only to get the list of the files that differed from the top of the branch and open the list in another buffer. while in the same buffer, press Enter to open another buffer in vimdiff mode that shows the difference, while ignoring white space changes. GitDiff - run diff between two hashes, similar to previous invocation. GitStatus - show the result of running git status in a buffer. Press Enter on a line of that window to open the file or directory mentioned, for tracked files a git diff is opened as vimdiff, the file is opened as is for untracked files. Stage - while in git status buffer: this command will stage the file mentioned in the current line of the git status buffer. Unstage - while in git status buffer: this command will unstage the file mentioned in the current line of the git status buffer. StageAll - while in git status buffer: this command will stage all files (git add -u) UnstageAll - while in git status buffer: this command will unstage all files (git reset) Redir - run any command and put the output in a scratch buffer. For example to list all remote branches: Redir !git branch -r To make a commit with given commit message: Redir !git commit -m 'my commit message here' To push local commits to upstream branch: Redir !git push list all files not under git: Redir !git ls-files --other ShowGitBranchInStatusLine - show a status line that includes the current git branch in the current directory. CdTopDir - if in a git repository; change current directory to the top directory of the repository ACKNOWLEDGEMENT This plugin uses Redir by Romain Lafourcade https://gist.github.com/romainl/eae0a260ab9c135390c30cd370c20cd7 ============================================================================== CHANGELOG *gitblame-changelog* 0.0 2021-6-20 - Initial commit 0.1 2021-8-28 - add GitDiff, also now you can press enter to open the next buffer. 0.2 2021-9-5 - fix GitDiff, didn't work in the previous release. 0.3 2021-9-10 - add GitLog 0.4 2021-9-23 - add ShowGitBranchInStatusLine 0.5 2021-9-23 - add BranchLocal and BranchRemote, fix status line. 0.6 2021-10-2 - add GitStatus command. 0.8 2021-10-5 - Add Stage and Unstage commands. Various bug fixes. 0.8.2 2021-10-10 - fix bug. always use new, not edit. 0.8.3 2021-27-10 - add GitDiffNoSpace, show status with GitDiff 0.8.5 2021-07-11 - fix buffer names win git diff.