apzelos / blamer.nvim Goto Github PK
View Code? Open in Web Editor NEWA git blame plugin for neovim inspired by VS Code's GitLens plugin
License: MIT License
A git blame plugin for neovim inspired by VS Code's GitLens plugin
License: MIT License
It would be really nice to have an option to only show the git blame in the current active split. This is for the scenario when editing the same file in two seperate splits.
Steps to reproduce:
let g:blamer_enabled = 0
in your .vimrc
or init.vim
:BlamerShow
or :BlamerToggle
Blamer not working on remote ubuntu server. It's throwing
[blamer.nvim] Needs popup feature.
while opening vim
If the current directory is not a git repository the blamer will be automatically disabled.
This is not suitable for the project organized using repo like Android. for example:
project root (open vim from here)
|-- git repository A
|-- git repository B
|-- ...
Detecting git root from current file is more compatible.
Assume that there is a git repo at the path: /home/user/project
Do the following steps:
Expected result: the git repo is recognized and blamming is working
Actual result: A message says: "[blamer.nvim] Not a git repository"
Thanks for an awesome plugin!
I use https://github.com/lukas-reineke/indent-blankline.nvim
It draws indentation lines and does this by drawing virtual text in empty lines.
Blamer positions itself on the left, so is expects to use the same position as the other plug-in. They overlap and the other win gets rendered.
Is there any way I can make blamer draw aligned with respect to existing virtual text?
Or should indentlines be doing something different?
Love it, could you please port it to vim ? This plugin will be more popular if it supports vim.
Love this plugin, but I have a hopefully small feature request.
In VS Code GitLense, the format is something like You, 8 minutes ago ยท Uncommitted changes
, which has a relative time format. I would love to see this feature included!
Thank you for making this plugin. You have made an excellent start. This is a low-priority request to expose date formatting in user configuration.
I put let g:blamer_enabled = 1
in my init.vim
and the it doesn't show until I call :BlamerShow
.
The only setting addition to this is let g:blamer_delay = 250
.
Using nvim v0.4.4 and Plug
Currently, highlight command in blamer.nvim do not use default
to avoid overriding custom highlight. This require custom highlight to be set after blamer.nvim is loaded.
Commit ab4dc40 breaks blamer, cannot find the correct function which locks navigation between files, rolling back to the previous function fixed it temporarily
Error detected while processing function <lambda>41[1]..blamer#Show[31]..blamer#SetVirtualText:
line 3:
E117: Unknown function: nvim_buf_set_extmark
Error in
blamer.nvim/autoload/blamer.vim
Line 198 in ab4dc40
Thank you for the great plugins
When I set let g:blamer_enabled = 1
, It will behave strangely.
:BlamerToggle
seems to work correctly.
It might be my setting issue though ๐
when using blamer.nvim I found an issue that I cannot see full text of commit messages because codes length were always too long in a line, and there's not enough space for virtual text
cound it be shown in next line when text overflow happens, by adding a new prop virt_text_pos
and set to eol
in the opts
param of nvim_buf_set_extmark
call?
It would be nice to at least allow to deactivate the display when on visual line / visual block modes.
I have noticed a significant loading time increase after installing this plugin. Also, have noticed Nerd Tree takes a significant amount of time to open as well after installing this plugin. I have yet to jump into the vim scripting language, but if anyone has any ideas as to how to improve the overall plugin's speed (maybe by making it async if it is not already), please let me know and I may be able to make a PR to support this awesome plugin ๐
Side note: This plugin rocks!
When entering visual mode, as I select more lines nvim slows down a lot. With 10-20 lines there's almost a second of lag, but with ~100 lines selected, nvim grinds to a halt taking several seconds to respond to any movement.
My impression is that the problem is because each line is fetched from git
individually, and this just piles up hundreds of calls to git
.
I'm no expert here, but I do think that some of these approaches might help:
blame
data for the entire file at once and parse that internally.n
lines (n
can be either hardcoded or configurable?).Hello @APZelos and thanks for this awesome plugin! ๐ฅณ
I get an error while installing. ๐ฑ๐ฑ๐ฑ
Error detected while processing function 8[1]..blamer#Show[8]..blamer#GetMessage: line 48:
E716: Key not present in Dictionary: committer
Press ENTER or type command to continue
๐
Cheers for the great plugin, it offers all the options i'd expect from a Git blamer plugin and is a great replacement for gitsigns
, as that plugin is not working as stable as i'd hoped for.
I do have a feature request, however i'm not sure how much work it entails. I'd prefer to see the blamer line show that the current line has been changed and therefore have blamer
report Uncommited changes
instead of the previous pre-change blame.
This behaviour does already work with blamer
, however I have to save the buffer first before it triggers a blame line change, which i'm not always interested in doing as it could happen that I ditch my changes in a buffer alltogether by just closing it without saving it.
Currently, virtual text replaces the highlight mode of the text that the virtual text sits above. Generally, this isn't an issue, but it means that there's a break in the background color when cursorline
is set.
Currently, Comment
highlight group is linked, but unlike comments, the background color of the cursorline
is not used
Expected, just like a Comment
, the cursorline
background highlights the full selected line
I was able to make a very small tweak to hardcode this change. Of course, you may prefer the original formatting, in which case, the ability to expose the "hl_mode"
as a global option would be very helpful.
- call nvim_buf_set_virtual_text(a:buffer_number, s:blamer_namespace, l:line_index, [[s:blamer_prefix . a:message, 'Blamer']], {})
+ call nvim_buf_set_extmark(a:buffer_number, s:blamer_namespace, l:line_index, 0, {"hl_mode": "combine", "virt_text": [[s:blamer_prefix . a:message, 'Blamer']]})
nvim_buf_set_virtual_text
nvim_buf_set_virtual_text
looks like it's been deprecated, so this might be a good change of function even if you prefer not to use the default formatting change.
neovim/neovim src/nvim/api/deprecated.c#L86-87
(looks like this was just deprecated 10 days ago)
/// @deprecated use nvim_buf_set_extmark to use full virtual text
/// functionality.
Hello.
Thanks for this extension, it brings neovim a step closer to modern editors.
There is a couple of problems however:
keep up the good work!
A workaround
autocmd InsertEnter * :BlamerHide
autocmd InsertLeave * :BlamerShow
but I think it should store the status before InsertEnter and load previous status after InsertLeave.
And I suggest
autocmd BufLeave,InsertEnter * :BlamerHide
autocmd BufEnter,InsertLeave * :BlamerShow
I'm using tpope/vim-fugitive & rhysd/git-messenger.vim, when I add blamer.nvim
and type the commands like :GitMessage
or :Git log
, the vim(8.2) throw out an error: E315: ml_get: invalid lnum
.
This error occurred when I installed blamer.nvim and enabled it.
Error detected while processing function <lambda>26[1]..blamer#Show[31]..blamer#SetVirtualText:
line 3:
E5555: API call: unexpected key: hl_mode
My environment is below.
vim version: NVIM v0.5.0-dev+nightly
node version: v16.10.0
coc.nvim version: 0.0.80-6e5a2aaeb5
term: iTerm.app
platform: darwin
None of the commit-short or commit-long works in the template anymore.
E716: Key not present in Dictionary: "commit-long"
E716: Key not present in Dictionary: "commit-short"
The command ls
supports the environment variable $TIME_STYLE
https://www.man7.org/linux/man-pages/man1/ls.1.html
It would be nice if g:blamer_date_format
could detect if the variable is set and use it. Right now I am resorting to let g:blamer_date_format = trim($TIME_STYLE, '+')
which works fine for what I need, but is not ideal or complete.
When using <committer-mail>
it would be nice if there was an option to omit the value when you are the committer. That way for example if you have vim.g.blamer_template = '<committer> <committer-mail>
you will would see
You <>
, You ...
, or something similar versus You <[email protected]>
.
Another possibility so that spacing could be ensured could have a <committer-with-mail>
option that way both would simply return You
.
First off, love the plugin. It does exactly what I want it to (replicate git blame per line like Vscode). Great job!
I am curious if this runs synchronously or asynchronously. I didn't know if it works like ALE and runs in the background.
Thanks
When I am trying to run vim inside ubuntu server VPS. It showing this error.
Can anybody have a solution?
vim main.go
[blamer.nvim] Needs popup feature.
Press ENTER or type command to continue
I'm not sure how easy this would be but opening up the current commit that added the currently selected line would be really useful.
This is my first issue ever written so please correct me if I'm formatting something wrong.
I am a Windows 10 user with Neovim 0.5.0. Everything was working great with blamer.nvim, until I added the line set shell=powershell.exe
in my vimrc. Seems like there are some differences between cmd.exe
and powershell.exe
, which made blamer stop working and return this:
[blamer.nvim] An unknown element "" was received. This can happen if the remote process closed or ended abnormally.
This line is printed in the command line with Press ENTER or type command to continue
below, so I'm basically unable to do any more operations before pressing ENTER and that makes Neovim unusable. Currently I deleted the line of setting the shell to powershell.
I also found this issue from vim-gitgutter that seems to have fixed the exact same problem by somehow forcing use of cmd.exe
in the plugin. Maybe it would be simply a few more lines of code for the developer to add in? I know pretty much nothing about Vimscript so I don't know which part of the commit to add and where to add.
The error keeps echoing from time to time.
The plugin is working perfectly, I just wanted to notify you if it is something that needs to be solved or not.
The check for file that exist in git folder is not accurable (s:IsFileInPath
).
The following step will cause blamer.nvim to mess up setting:
/home/mars/test
.cd
to /home/mars/test
.nvim term:///home/mars/test//8888:/bin/bash
will open a terminal buffer in /home/mars/test
.s:IsFileInPath
should check if file is actually inside path, not only match path.
Perhaps consider an option to wrap the text, if it is technically feasible.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.