https://github.com/willothy/blam.nvim
A simple plugin for viewing git blame info, inspired by GitLens
https://github.com/willothy/blam.nvim
Last synced: about 1 year ago
JSON representation
A simple plugin for viewing git blame info, inspired by GitLens
- Host: GitHub
- URL: https://github.com/willothy/blam.nvim
- Owner: willothy
- License: mit
- Created: 2023-02-25T05:16:09.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-01T21:03:18.000Z (over 3 years ago)
- Last Synced: 2025-03-30T22:25:06.209Z (over 1 year ago)
- Language: Rust
- Homepage:
- Size: 19.5 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Blam
Inspired by VSCode and GitLens, this plugin simply adds blame info as virtual text to the end of your current line. Written in Rust using `git2` and `nvim-utils`.
https://user-images.githubusercontent.com/38540736/221464520-057099bb-e6d5-47d9-98bc-b177021b5e42.mp4
## Installation
Install using your favorite package manager
### Lazy.nvim
```lua
{
'willothy/blam.nvim',
build = 'make',
opts = {
-- options
},
config = true
}
```
### Packer.nvim
```lua
use('willothy/blam.nvim', {
run = 'make',
config = function()
require("blam").setup({
-- options
})
end
})
```
## Usage
Blam includes no mappings, just a few functions:
```lua
-- Toggles line blame (will update as you move the cursor)
require("blam").toggle()
-- Peeks the blame for the current line (will disappear when cursor is moved or after a timeout)
require("blam").peek()
```
Here's my setup:
```lua
{
'willothy/blam.nvim',
build = 'make',
config = true,
init = function()
vim.keymap.set("n", "b", require("blam").peek)
end
}
```
## Configuration
Blam comes with the following defaults:
```lua
{
-- Can be a hex color
-- or a table with fg and bg colors
-- or a highlight group
hl = "Comment",
-- Timeout before peek blame disappears
-- Set to 0 to disable and only hide peek blame on cursor move
peek_timeout = 0,
-- Whether line blame will be enabled on startup
-- Disabled by defauly as it can be a bit intrusive (I prefer using peek)
enabled = false,
}
```