Git Product home page Git Product logo

lazygit.nvim's Introduction

lazygit.nvim

Plugin for calling lazygit from within neovim.

See akinsho/nvim-toggleterm as an alternative to this package.

Install

Install using vim-plug:

" nvim v0.5.0
Plug 'kdheepak/lazygit.nvim'

Feel free to use any plugin manager. Just remember that if you are not using the latest neovim release, you will need to use the nvim-v0.4.3 branch. Integration with nvr works better on the main branch.

You can check what version of neovim you have:

nvim --version

Usage

The following are configuration options and their defaults.

let g:lazygit_floating_window_winblend = 0 " transparency of floating window
let g:lazygit_floating_window_scaling_factor = 0.9 " scaling factor for floating window
let g:lazygit_floating_window_corner_chars = ['', '', '', ''] " customize lazygit popup window corner characters
let g:lazygit_floating_window_use_plenary = 0 " use plenary.nvim to manage floating window if available
let g:lazygit_use_neovim_remote = 1 " fallback to 0 if neovim-remote is not installed

Call :LazyGit to start a floating window with lazygit. And set up a mapping to call :LazyGit:

" setup mapping to call :LazyGit
nnoremap <silent> <leader>gg :LazyGit<CR>

Open the configuration file for lazygit directly from vim.

:LazyGitConfig<CR>

If the file does not exist it'll load the defaults for you.

Using neovim-remote

If you have neovim-remote and have configured to use it in neovim, it'll launch the commit editor inside your neovim instance when you use C inside lazygit.

  1. pip install neovim-remote

  2. Add the following to your ~/.bashrc:

if [ -n "$NVIM_LISTEN_ADDRESS" ]; then
    alias nvim=nvr -cc split --remote-wait +'set bufhidden=wipe'
fi
  1. Set EDITOR environment variable in ~/.bashrc:
if [ -n "$NVIM_LISTEN_ADDRESS" ]; then
    export VISUAL="nvr -cc split --remote-wait +'set bufhidden=wipe'"
    export EDITOR="nvr -cc split --remote-wait +'set bufhidden=wipe'"
else
    export VISUAL="nvim"
    export EDITOR="nvim"
fi
  1. Add the following to ~/.vimrc:
if has('nvim') && executable('nvr')
  let $GIT_EDITOR = "nvr -cc split --remote-wait +'set bufhidden=wipe'"
endif

If you have neovim-remote and don't want lazygit.nvim to use it, you can disable it using the following configuration option:

let g:lazygit_use_neovim_remote = 0

lazygit.nvim's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.