Skip to content

Integration with neovim

Brandon Conway edited this page Dec 24, 2021 · 3 revisions

kdheepak/lazygit.nvim

This plugin lets you use lazygit in a floating window inside neovim.


If you use git worktrees, the plugin may not work for you. You can use floaterm to open lazygit yourself (giving you most, if not all, of what the plugin gives you) with this config:

let g:floaterm_borderchars = "─│─│╭╮╯╰"
let s:width = "1.0"
let s:height = "1.0"
let s:autoclose = "1"
let s:command = 'lazygit'

function! s:open_lazygit_popup() 
  execute "FloatermNew --height=" . s:height . " --width=" . s:width . " --autoclose=" . s:autoclose . " " . s:command
endfunction

nnoremap <silent> <leader>lg :call <SID>open_lazygit_popup()<CR>

You may want to change the height and width to a lower percentage of your window size.

Clone this wiki locally