Skip to content

Commit

Permalink
feat: load config file on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
Piturnah committed Jul 7, 2023
1 parent c202843 commit a9f1aba
Show file tree
Hide file tree
Showing 9 changed files with 350 additions and 41 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
## [Unreleased](https://github.com/Piturnah/gex/compare/v0.4.0...main)
### Added
- Scrolling on cursor movement if content goes off-screen ([#1](https://github.com/Piturnah/gex/issues/1))
- Config file to configure certain options
- `auto_expand_files`
- `auto_expand_hunks`
- Use <kbd>Space</kbd> to toggle expansion of items
### Fixed
- Minibuffer can obscure the available subcommands ([#33](https://github.com/Piturnah/gex/issues/33))
Expand Down
211 changes: 211 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ strip = true
anyhow = "1.0.68"
clap = { version = "4.3.11", features = ["cargo"] }
crossterm = "0.26.0"
dirs = "5.0.1"
git2 = { version = "0.17.1", default-features = false }
itertools = "0.11.0"
nom = "7.1.1"
paste = "1.0.12"
serde = { version = "1.0.167", features = ["derive"] }
serde_ignored = "0.1.8"
toml = "0.7.6"

# Tokee
# (Gecko gekko) _____________
Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Primarily, this is a personal project since I recently switched to Neovim from E
- [x] Simple - uncluttered UI.
- [x] Intuitive - it should be easy to learn to use gex.
- [x] Cross platform - primary focus on Linux, but should work well on Windows and MacOS.
- [ ] Configurable - certain preferences in gex should be configurable to suit your own workflow.
- [x] [Configurable](./#Configuration) - certain preferences in gex should be configurable to suit your own workflow.
- [ ] Comprehensive\* - you should be able to use gex to do everything you can do in git.

\* gex supports executing arbitrary git commands with <kbd>:</kbd> for when something is not yet available
Expand Down Expand Up @@ -88,6 +88,24 @@ $ gex
| <kbd>p</kbd> | push |
| <kbd>z</kbd> | stash |

## Configuration

Gex will look for a config file in the following places:

| OS | Path |
| ------- | ------------------------------------------------- |
| Linux | $XDG_CONFIG_HOME/gex/config.toml |
| MacOS | $HOME/Library/Application Support/gex/config.toml |
| Windows | {FOLDERID_RoamingAppData}/gex/config.toml |

Here is an example `config.toml`:

```toml
[options]
auto_expand_files = false
auto_expand_hunks = false
```

## License

This project is dual-licensed under either:
Expand Down
Loading

0 comments on commit a9f1aba

Please sign in to comment.