![]() ![]() The plugin can browse through the full repository history using :Agit or a single file history using :AgitFile Agit exampleĪgit example An mkaz conundrum. The Agit plugin displays repository information using a tabpage with multiple windows. vimrc: code' - git command on current file fun GitCommand(command) silent clear exec 'git '. Running :GitMessenger with a message displayed enters that message buffer allowing you to navigate back to older commits by typing o key. Answer (1 of 2): Personally I donât think you need a plug-in for that. Using vim-plug: Plug 'zivyangll/git-blame.vim' Using Vundle Plugin 'zivyangll/git-blame.vim' Please setting bindings You must push the map in your vimrc to avoid conflicts with other plugins you may have installed. Activate the plugin using the :GitMessenger function to display the last commit message that modified the line. It will display the info in a Scratch window, or pop-up window if supporteed. The git-messenger plugin provides blame information on a per-line basis. Use :GitGutterStageHunk for selective staging of hunks.Use :GitGutterPreviewHunk to see hunk changes.Diffing Recall in the previous chapter, you can run a vimdiff command to show the differences between multiple files. In this chapter, you will learn different ways to integrate Vim and git together. Here are the top ones that I use frequently: Vim and git are two great tools for two different things. The plugin also provides features beyond just visual cues. I setup the following two maps to navigate to next and previous hunks: The vim-gitgutter plugin also provides functions to navigate to changed hunks of code. View Git Changesįor viewing changes in a single-file, the gitgutter plugin adds visual cues for additions, subtractions, and modifications in the gutter left of the line numbers. Press enter on a line to view the commit where the line changed, or g to see other. However, there are still a few plugins that I use to make things easier. :Git blame uses a temporary buffer with maps for additional triage. The mapping you found attempts to show the git blame output only for the range of 5 lines before and 5 lines after where your cursor is in vim, which is actually a pretty cool idea. I prefer to do my gitting on the command-line, so I know exactly what is happening. There are a wide range of plugins and features to choose from, so your setup will depend on what you want to do. Another option might be something like the gh pr view command. Doing so will let :GBrowse work with GitHub-based remotes, so that you can quickly open those PRs. How do I specify the path to git.By default, Vim provides no integration with git, all functionality is provided by plugins. You might want fugitives :Git blame combined with tpope/vim-rhubarb. The resulting call of :Git status is C:\WINDOWS\system32\cmd.exe /c (C:\Program Files ^(x86^)\Git\cmd\git.exe status)Īnd the cmd window complains that "\Git\cmd\git.exe" could not be processed (translated from German). ![]() Running :GitMessenger with a message displayed enters that message buffer allowing. Seems like in 1, 2, 4, there's a problem with the brackets in the path. The git-messenger plugin provides blame information on a per-line basis.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |