From f1e6f08360498dfd5460d4e9a9f7e75d5f99e40c Mon Sep 17 00:00:00 2001 From: Emil Miler Date: Wed, 18 Jan 2023 15:11:36 +0100 Subject: [PATCH] Show 'git blame' in lualine --- lua/plugins.lua | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/lua/plugins.lua b/lua/plugins.lua index 8279610..075d634 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -14,16 +14,17 @@ return require('packer').startup(function() 'nvim-lualine/lualine.nvim', requires = { 'kyazdani42/nvim-web-devicons', opt = true }, config = function() - require('lualine').setup() + local git_blame = require('gitblame') + require('lualine').setup({ + sections = { + lualine_c = { + { git_blame.get_current_blame_text, cond = git_blame.is_blame_text_available } + } + } + }) vim.o.showmode = false end } - use { - 'lewis6991/gitsigns.nvim', - config = function() - require('gitsigns').setup() - end - } use { 'junegunn/goyo.vim', config = function() @@ -31,6 +32,22 @@ return require('packer').startup(function() end } + -- Git + use { + 'f-person/git-blame.nvim', + config = function() + vim.g.gitblame_date_format = '%r' + vim.g.gitblame_message_when_not_committed = '' + vim.g.gitblame_display_virtual_text = 0 + end + } + use { + 'lewis6991/gitsigns.nvim', + config = function() + require('gitsigns').setup() + end + } + -- completion use 'hrsh7th/nvim-cmp' use 'hrsh7th/cmp-buffer'