jesseduffield / jesseduffield/lazygit

Filter to show only files under specific directory

Open
#5,625 0 comments 1 reaction 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.
I use a bare repo for managing my dotfiles. Using lazygit for this repo is not very convenient as even when hiding untracked files there is a lot of clutter besides the particular config I'm trying to modify.

For example if I'm editing my neovim config, I only care about the `~/.config/nvim` directory, but right now I get shown everything else:
Image

This becomes more annoying when trying to also manage untracked files, as when changing the filter option with `` to show untracked files the cursor jumps back to the top of the list, so I have to scroll back down to the folder I'm working in. I can somewhat mitigate this by filtering by name with `/` but that could still include other things I'm not interested in.
Untracked files also become an issue at least in my case because for the bare repo I don't bother to gitignore things, I just don't track them. So when I show untracked files in lazygit it hangs due to the large amount of untracked files. This would not be a problem if I could just specify which directory to show.

### Describe the solution you'd like
I would like being able to do something like `lazygit --filter-dir=/some/path/in/repo` and have lazygit show only files in `/some/path/in/repo`.

### Describe alternatives you've considered
For now I'm getting by by filtering with `/`.

### Additional context
Related discussion https://github.com/jesseduffield/lazygit/discussions/4610.

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.