Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Neovim plugin to display git blame information in front of functions, structs and classes.

License

NotificationsYou must be signed in to change notification settings

robert-oleynik/git-blame-virt.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 

Repository files navigation

This plugin is not stable yet.

Displaygit blame information of functions, structs and classes using Neovim's virt_lines and TreeSitter.

Requirements

Supported Languages

  • Lua
  • Rust
  • C, C++
  • Python
  • Java
  • JavaScript
  • LaTeX

Installation

packer.nvim:

use {'robert-oleynik/git-blame-virt.nvim',requires= {'nvim-lua/plenary.nvim'},config=function()require'git-blame-virt'.setup {}end}

Usage

git-blame-virt can be configured using the setup function. Here is an example with the default settings:

require'git-blame-virt'.setup {allow_foreign_repos=true,display= {commit_hash=true,-- Enable/Disable latest commit hashcommit_summary=true,-- Enable/Disable latest commit summarycommit_committers=true,-- Enable/Disable committers listmax_committer=3,-- Limit Number of committers display in listcommit_time=true,-- Enable/Disable relative commit timehi='Comment',-- Change Highlight group of default highlight functionfn=function(...)-- See Custom Display Functionend},ft= {-- Enable/Disable plugin per filetypelua=true,java=true,javascript=true,latex=true,python=true,rust=true,cpp=true}}

Custom Display Function

require'git-blame-virt'.setup {-- ...display= {-- ...fn=function(info)-- Structure of info: {--     committers = { "<name>", ... },--     last = {--          hash = '000...',--          timestamp = 0,--          summary = '...',--     }-- }return {{'<text>','<higlight group>'},-- ...}end}}

Adding Support For Other Languages

Note: TreeSitter support for that language is required.

Adding A TreeSitter Query

Add to your config before callingsetup:

locallang=require'git-blame-virt.lang'lang.ts_queries['<your language>']=[[(class_definition) @node(function_definition) @node]]

Please note:@node is required at the end of each statement.

For Documentation on TreeSitter Queries: seePattern Matching With Queries

About

Neovim plugin to display git blame information in front of functions, structs and classes.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp