-
Is there a way to speed up git log? I've noticed that recently it's been rather slow to launch (regardless of the rendering type - ascii, kitty, unicode). See clip below. Screen.Recording.2025-07-16.at.19.11.34.movMy plugin setup below Currently on commit ❯ nvim --version
NVIM v0.11.3
Build type: Release
LuaJIT 2.1.1748459687 return {
'NeogitOrg/neogit',
dependencies = {
'nvim-lua/plenary.nvim', -- required
'sindrets/diffview.nvim', -- optional - Diff integration
-- Only one of these is needed, not both.
'nvim-telescope/telescope.nvim', -- optional
},
event = 'VeryLazy',
cmd = { 'Neogit' },
branch = 'master',
config = function()
local neogit = require 'neogit'
neogit.setup {
-- disable_line_numbers = false,
disable_relative_line_numbers = false,
graph_style = 'kitty',
}
-- Neogit viewer
nmap('<leader>ge', neogit.open, 'neogit buffer')
nmap('<leader>gh', function()
neogit.open { kind = 'split' }
end, 'neogit horizontal split')
nmap('<leader>gs', function()
neogit.open { kind = 'vsplit' }
end, 'neogit vertical split')
-- Neogit commands
nmap('<leader>gc', function()
neogit.open { 'commit' }
end, 'commit')
nmap('<leader>gf', function()
neogit.open { 'fetch' }
end, 'fetch')
nmap('<leader>gl', function()
neogit.action('log', 'log_all_branches', { '--max-count=256', '--graph', '--decorate', '--topo-order', '--color' })()
end, 'log all branches')
nmap('<leader>gL', function()
neogit.action('log', 'log_current', { '--max-count=256', '--graph', '--decorate', '--topo-order', '--color' })()
end, 'log current branch')
nmap('<leader>gp', function()
neogit.open { 'pull' }
end, 'pull')
nmap('<leader>gP', function()
neogit.open { 'push' }
end, 'push')
local head_color = '#7AA2F8'
local local_branch_color = '#A6E3A1'
local remote_branch_color = '#F38BA8'
vim.api.nvim_set_hl(0, 'NeogitBranch', { fg = local_branch_color, bold = true })
vim.api.nvim_set_hl(0, 'NeogitBranchHead', { fg = head_color, bold = true, underline = true })
vim.api.nvim_set_hl(0, 'NeogitRemote', { fg = remote_branch_color, bold = true, italic = true })
end,
} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Oh good find. Turns out that I've reverted the usage of the new API. Let me know if that helps :) |
Beta Was this translation helpful? Give feedback.
-
Thanks very much @CKolkey - the update seems to have resolved the speed issue! |
Beta Was this translation helpful? Give feedback.
Oh good find. Turns out that
vim.hl.range()
is substantially slower thanvim.api.nvim_buf_add_highlight()
.I've reverted the usage of the new API. Let me know if that helps :)