-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lazyvim proper setup #129
Comments
Something like the following works to set the options: {
'f-person/git-blame.nvim',
opts = {
enabled = false,
message_template = "<<sha>> • <author> • <date> • <summary>",
date_format = "%Y-%m-%d",
},
keys = {
{ "<leader>Gb", "<cmd>GitBlameToggle<cr>", desc = "Toggle blame information" },
{ "<leader>GB", "<cmd>GitBlameOpenFileURL<cr>", desc = "Open blame in browser" },
}
|
@timofurrer Thank you for replying! sorry I probably didn't describe my issue clearly When I open a git file I have to manually call the command < GitBlameEnable> by using my shortcut to see the git blame, If I just use default settings return {
"f-person/git-blame.nvim",
} the git blame message will show right after opening a git file without calling the command, is there a way to see the blame message right after opening a git file by default? I read the :help gitblame and tried to set instead of using the init function, I also tried lazy opts but it didn't work either return{
"f-person/git-blame.nvim",
opts = {
-- gitblame_enabled = 1,
enabled = true,
message_template = " <summary> • <date> • <author> • <<sha>>",
date_format = "%m-%d-%Y %H:%M",
},
keys = {
......
}
} |
There have been some other issues related to lazyvim, as well. I don't know if it directly somehow configures the plugin before you do, which results in the issues, but I'm not very familiar with it. However, if there's an option to only "import" a plugin and call the init/setup function yourself, perhaps that's worth trying? |
Because of the If you want to load the plugin at startup, add something like |
Thanks everyone, I add return {
{
-- git blame plugin
"f-person/git-blame.nvim",
-- dir = "~/git-blame.nvim",
-- load the plugin at startup
event = "VeryLazy",
-- Because of the keys part, you will be lazy loading this plugin.
-- The plugin wil only load once one of the keys is used.
-- If you want to load the plugin at startup, add something like event = "VeryLazy",
-- or lazy = false. One of both options will work.
opts = {
enabled = true,
message_template = " <summary> • <date> • <author> • <<sha>>",
date_format = "%m-%d-%Y %H:%M:%S",
virtual_text_column = 1,
},
keys = {
{
"<leader>gbu",
"<cmd>GitBlameToggle<cr>",
desc = "toggle git blame",
},
{
"<leader>gbe",
"<cmd>GitBlameEnable<cr>",
desc = "enable git blame",
},
{
"<leader>gbd",
"<cmd>GitBlameDisable<cr>",
desc = "disable git blame",
},
{
"<leader>gbh",
"<cmd>GitBlameCopySHA<cr>",
desc = "copy line commit SHA",
},
{
"<leader>gbl",
"<cmd>GitBlameCopyCommitURL<cr>",
desc = "copy line commit URL",
},
{
"<leader>gbo",
"<cmd>GitBlameOpenFileURL<cr>",
desc = "opens file in default browser",
},
{
"<leader>gbc",
"<cmd>GitBlameCopyFileURL<cr>",
desc = "copy file url to clipboard",
},
},
},
{
"folke/which-key.nvim",
-- default show git blame when open git files
opts = {
defaults = {
["<leader>gb"] = { name = "git blame+" },
},
},
},
} @folke hope you have a wonderful vacation man! |
I'm going to close this issue |
Yup, that would be great, @davidgao7. Glad it's resolved now, hope you enjoy the plugin! :) @folke thanks for the help and have a great vacation :) |
@f-person Yeah, thank you and thank everyone who is maintaining this plugin I'm still learning how to contribute to opensource, feel free to tell me what are the proper ways of doing pull requests, comments etc. thanks everyone! |
Hi,
I'm trying to tweak to adapt the setting in lazy nvim, I could successfully set commands, but options like gitblame_message_template, gitblame_enabled doesn't work, and I couldn't be able to see git blames after open a committed file in a git repo.
I try to set gitblame_enabled = 0/1, none of the options work,
but if I call the command it will work
let me know if I could help/There's something I'm doing wrong!
I want to thank everyone who is maintaining this awesome plugin!
The text was updated successfully, but these errors were encountered: