jesseduffield / jesseduffield/lazygit

(Neo)Vim Integration with a Flag

Open
#1,591 1 comment 5 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
82.4k
Forks
3k
Avg merge
2d 18h
Merged PRs (30d)
19

Description

**Is your feature request related to a problem? Please describe.**
Looking at #996, it is clear to me that people would like to see a better way of using `Lazygit` in Neovim, however, there isn't really a good way of doing this. I too would like to see some sort of vim integration yet I see no good solution to this.

**Describe the solution you'd like**
What I suggest is creating a flag for `Lazygit` where if a file is opened with `e`, instead of opening the file with `$EDITOR`, it will write the path of the file to some temporary file (the flag would be like `--flagname `. `Lazygit` would then close and from then on, a Vim or Neovim can just read from the file and open the selected file with the written file path. Lots of terminal file managers such as Nnn (`-p`), Ranger (`--chosefiles=`), and Lf (`-selection-path`) have flags like these that allows vim integration.

**Describe alternatives you've considered**
An alternative to this is using something of the likes [lazygit.nvim](https://github.com/kdheepak/lazygit.nvim) or even [neovim-remote](https://github.com/mhinz/neovim-remote), however, I find both of these approaches to be quite excessive for just wanting to open a file in Neovim.

**Additional context**
I have a Neovim plugin for terminal file managers and fuzzy finders called [fm-nvim](https://github.com/is0n/fm-nvim) and its method for integrating external programs is the same method I have used to integrate 3 fuzzy finders and 10 file managers.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.