Add g:lazygit_use_neovim_remote option and update README.md
This commit is contained in:
49
README.md
49
README.md
@@ -2,14 +2,13 @@
|
||||
|
||||
Plugin for calling [lazygit](https://github.com/jesseduffield/lazygit) from within neovim.
|
||||
|
||||

|
||||
|
||||
If you are not using neovim nightly, use [this branch](https://github.com/kdheepak/lazygit.vim/tree/nvim-v0.4.3).
|
||||
You can install it using the following:
|
||||

|
||||
|
||||
### Install
|
||||
|
||||
**[`vim-plug`](https://github.com/junegunn/vim-plug)**
|
||||
If you are not using neovim nightly, use [this branch](https://github.com/kdheepak/lazygit.vim/tree/nvim-v0.4.3).
|
||||
|
||||
Install using **[`vim-plug`](https://github.com/junegunn/vim-plug)**:
|
||||
|
||||
```vim
|
||||
" nvim v0.4.3
|
||||
@@ -44,3 +43,43 @@ Open the configuration file for `lazygit` directly from vim.
|
||||
If the file does not exist it'll load the defaults for you.
|
||||
|
||||

|
||||
|
||||
**Using neovim-remote**
|
||||
|
||||
If you have [neovim-remote](https://github.com/mhinz/neovim-remote) and have configured to use it in neovim, it'll launch the commit message inside your neovim instance.
|
||||
|
||||
1) `pip install neovim-remote`
|
||||
|
||||
2) Add the following to your `~/.bashrc`:
|
||||
|
||||
```bash
|
||||
if [ -n "$NVIM_LISTEN_ADDRESS" ]; then
|
||||
alias nvim=nvr -cc split --remote-wait +'set bufhidden=wipe'
|
||||
fi
|
||||
```
|
||||
|
||||
3) Set `EDITOR` environment variable in `~/.bashrc`:
|
||||
|
||||
```bash
|
||||
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
|
||||
```
|
||||
|
||||
4) Add the following to `~/.vimrc`:
|
||||
|
||||
```vim
|
||||
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:
|
||||
|
||||
```vim
|
||||
let g:lazygit_use_neovim_remote = 0
|
||||
```
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if executable("nvr")
|
||||
if g:lazygit_use_neovim_remote && executable("nvr")
|
||||
augroup GIT
|
||||
autocmd!
|
||||
autocmd WinLeave <buffer> :LazyGit
|
||||
|
||||
@@ -15,6 +15,10 @@ if !exists('g:lazygit_floating_window_scaling_factor')
|
||||
let g:lazygit_floating_window_scaling_factor = 0.9
|
||||
endif
|
||||
|
||||
if !exists('g:lazygit_use_neovim_remote')
|
||||
let g:lazygit_use_neovim_remote = 1
|
||||
endif
|
||||
|
||||
command! LazyGit lua require'lazygit'.lazygit()
|
||||
|
||||
command! LazyGitFilter lua require'lazygit'.lazygitfilter()
|
||||
|
||||
Reference in New Issue
Block a user