![]() For example, suppose you look at git blame 's output. Since Git 1.8.4, git log has -L to view the evolution of a range of lines. Sadly I don't have sufficient of any of those personally. 12 Answers Sorted by: 809 See also Git: discover which commits ever touched a range of lines. Locking the scrolling of a vc-annotate buffer with the editing buffer, and moving the coloring to the commit info, seems like it would be reasonably doable for someone with a little Elisp skill, time and inclination. To do this, input the range of lines you wish to see along with the filename: git blame -L 40,60 .I can see that the shadow buffer option as you're showing could work well, but AFAIK it doesn't currently exist, and digging into vc-annotate is well worth your time, even if it has a different flavor. Instead of viewing the Git blame output for every line in a particular commit, you can precisely specify which lines you want to see. If the file was renamed at some point, you can add -follow-parent. This will give you all of the commits that affected that text in that file. Much as I love magit in general, I find magit-blame very hard to parse and use compared to vc-annotate. git log -Sthe line from your file - path/to/your/file.txt. sodapopcan/vim-twiggy rhysd/committia.vim skanehira/gh.vim f-person/git-blame.nvim junegunn/gv.vim sindrets/diffview.nvim rhysd/git-messenger.vim pwntester/octo. Some dont do stage, commit, push, but still are related to 'git integration'. It would be nice to combine all these features into something richer. For reference, here are several other integrations i came across over time. :git :git stash :git diff :git log In vim, means current file. If git is installed in your system, you can use vim's bang ( :) to execute any shell command. However, getting them to integrate with each other without plugins can be difficult, but not impossible. ![]() Git blame has the A mapping to resize to end of author column. Vim and git are two equally great tools for two different things. But it's an old VC-agnostic feature that isn't the most polished or as git-aware as it could be. The place for questions and conversation on the Vim editor. The mode has a bunch of other features like jumping to the commit before/at the line under the cursor etc., so is quite a rich and useful mode for actually navigating and understanding the history. The coloring of it is a very useful visual indication of the age of the commits by lines redder for 'hotter' new changes through to blue for old ones. vim-fugitive has a :Git blame command that solves the same use case, but I prefer the virtual text. It's something I dip into for forensic purposes, and not really something I want visible the rest of the time. In fact, itâs a little overwhelming, but if youâre familiar with Git, then you will find vim-fugitive is pretty intuitive:' view status of current branch: Git status ' view available branches. ![]() I guess I just need to figure out how to map the keystrokes to shift one pane to the left, and to run that command, so thanks for the directions. It's definitely to be viewed in its own right, not alongside the editing buffer, but that workflow works well in my experience. I already have cnorea blam :Gblame in my vimrc just to save three keystrokes, but Im not competent enough to know how to select and resize that window in the same command. Installation vim-plug Add the following line to your init.vim: call plugbegin ('/.local/share/nvim/plugged'). Note: For Vim, a popup feature is required. ![]() Lua vc-annotate ( C-x v g) your cursor will be on the same line you summoned it from which helps a lot with the cognitive reconciliation. A git blame plugin for (neo)vim inspired by VS Code's GitLens plugin. nvim_buf_clear_namespace ( 0, 2, 0, - 1 ) end return M " in init.vim clearBlameVirtText () - important for clearing out the text when our cursor moves api. ![]() in a local M = ) - set virtual text for namespace 2 with the content from git and assign it to the higlight group 'GitLens' end function M. With git-log itâs easy to quickly skim history in the form of patches, but itâs a bit harder to have a quick look at different revisions of a file or to see the difference between two arbitrary provides tools to do just that. IanDess Perhaps its just semantics, but git blame sounds as if it would have some persisted effect, similar to git commit, where in fact it just informs you to of what changes were made by who. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |