From a4ef118f32bcb71e6f114ab80ad07af3fcc0bebc Mon Sep 17 00:00:00 2001 From: Dheepak Krishnamurthy Date: Sun, 5 Apr 2020 13:54:34 -0600 Subject: [PATCH] Add neovim-remote section to the README.md --- README.md | 19 ++++++++++++++----- lua/lazygit.lua | 2 +- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 76757ed..b75c6a7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# lazygit.nvim +# lazygit.vim -Plugin for calling lazygit from within nvim. +Plugin for calling lazygit from within neovim. ### Install @@ -9,19 +9,19 @@ Use any plugin manager: **[vim-plug](https://github.com/junegunn/vim-plug)** ```vim -Plug 'kdheepak/lazygit.nvim' +Plug 'kdheepak/lazygit.vim' ``` **[dein.vim](https://github.com/Shougo/dein.vim)** ```vim -call dein#add('kdheepak/lazygit.nvim') +call dein#add('kdheepak/lazygit.vim') ``` **[Vundle.vim](https://github.com/junegunn/vim-plug)** ```vim -Plugin 'kdheepak/lazygit.nvim' +Plugin 'kdheepak/lazygit.vim' ``` ### Usage @@ -30,3 +30,12 @@ Plugin 'kdheepak/lazygit.nvim' " lazygit nnoremap lg :LazyGit ``` + +### Using neovim-remote + +Add the following to your `.gitconfig` to use your current neovim instance at the commit editor for git. + +``` +[core] + editor = nvr --remote-wait-silent +``` diff --git a/lua/lazygit.lua b/lua/lazygit.lua index 5cb032e..699d445 100644 --- a/lua/lazygit.lua +++ b/lua/lazygit.lua @@ -65,7 +65,7 @@ function open_floating_window() end local function project_root_dir() - return fn.finddir('.git/..', fn.expand('%:p:h') .. ';') + return fn.system('cd ' .. fn.expand('%:p:h') .. ' && git rev-parse --show-toplevel 2> /dev/null') end local function execute(cmd, ...)