-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Configurable keybinds #117
Conversation
Codecov Report
@@ Coverage Diff @@
## master #117 +/- ##
=======================================
Coverage 23.41% 23.41%
=======================================
Files 13 13
Lines 1089 1089
=======================================
Hits 255 255
Misses 821 821
Partials 13 13
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #117 +/- ##
==========================================
- Coverage 26.12% 23.55% -2.58%
==========================================
Files 13 13
Lines 1129 1091 -38
==========================================
- Hits 295 257 -38
Misses 821 821
Partials 13 13
Continue to review full report at Codecov.
|
@jesseduffield and anyone interested I'm in a bit of a pickle, |
The keybinding struct (now having []interface{} instead of interface{})
The recovery
The keybinding def
The helper function
|
@glvr182 I think we should put the default KeyConfig on the UserConfig struct in app_config.go. We can then have our filterParser method in that file and it can handle all of our defaults on startup. In UserConfig:
In GetDefaultConfig
Then in keybindings.go
and then in the same file:
you'll need each keybinding to support an array of keys, so then you'll be doing this in
I think it's worth adding a MustParse() function to the keybindings library, which panics on failure, so that we don't need to worry about the error that could be returned. As you say we can recover from it. Hopefully the fact we now need to use an []interface{} isn't too bad, though I have had bad experiences with interface{} arrays in the past. What are your thoughts? |
I think having a must parse function in the lib is a good idea, I shall make that function tomorrow, (or if you have time be my guest). I'm not the biggest fan of interfaces either, i prefer having an actual type, but maybe we find a way to resolve that along the road. (might try that in this pr). I think with the Thanks for your input! |
Just finished the mustParse functions, will use them now |
@jesseduffield I'm again in a bit of a pickle, keybinding library uses awesome-gocui/gocui, lazydocker uses jesseduffield/gocui, what do you recon would be the best |
@glvr182 that is a good question. I would like for the two gocuis to be one-and-the-same, but I haven't really put the effort in to port my stuff over to awesome-gocui/gocui when I add something to my own. What are your thoughts on defining the gocui keys in the keybindings package and casting them in the consuming package? I'm assuming they are all integers under the hood? Otherwise, if we think that it's going to be too much work to get the two gocuis synced up, I could fork the keybindings package and get it to point at my own gocui. |
@jesseduffield They are as far as i know uint16, I don't really like the idea of casting, for obvious reasons, but as you said we would have to update awesome-gocui/gocui a lot. Maybe we could focus on that, as others might have use for it aswell. |
agreed |
* Might change this to less code later Signed-off-by: Glenn Vriesman <[email protected]>
I'm settings the defaults right now, it's taking longer than i hoped, thanks for the patience |
Rebased from master |
@jesseduffield might it be possible to lock the app_config.go and keybindings files for the time being? Just untill the pr is done |
sure, how long do you think you'll need? |
Well once i set all the defaults, i can test it. So how about this weekend? |
* Cleaned up some code * Added missing configs * Added documentation * Implemented config referencing to keybindings.go Signed-off-by: Glenn Vriesman <[email protected]>
Apart from the errors, i think you can have a look at the keybinding configs @jesseduffield |
* Changed the workings of a view functions to support multiple kb * Fixed some errors regarding building Signed-off-by: Glenn Vriesman <[email protected]>
Seems to be an issue with parsing characters to keys, will have to do more investigation |
Hit a bug while setting up the parser, hope to get stuff working tomorrow |
@glvr182 how is it going? Maybe need some halp? |
Yea well I back then hit a bug that had to do with some casting stuff. Haven't been able to fix that, but i was working on merging jesse's gocui with the awesome-gocui/gocui one to fix it. I'll post some errors tonight. |
Creates a new snowblock for lazydocker [1]. > The lazier way to manage everything Docker. > A simple terminal UI for both Docker and docker-compose. I've used it for quite some time and the configurations have now been tested enough on a day-by-day basis to be persisted in igloo. Initially this includes the `config.yml` file [2] symlinked to the corresponding XDG specific [3] and OS dependent path(s) [4]. The keybindings [5] are can not be customized yet, but some initial work has been done [6] so maybe it'll be possible in later versions. The colors have been adjusted to match the Nord [7] theme style. For more details about available configurations see the `github.com/jesseduffield/lazydocker/pkg/config` package documentation [8]. [1]: https://github.com/jesseduffield/lazydocker [2]: https://github.com/jesseduffield/lazydocker/blob/master/docs/Config.md [3]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html [4]: https://github.com/jesseduffield/lazydocker/blob/master/docs/Config.md#locations [5]: https://github.com/jesseduffield/lazydocker/blob/master/docs/keybindings/Keybindings_en.md [6]: jesseduffield/lazydocker#117 [7]: https://www.nordtheme.com [8]: https://pkg.go.dev/github.com/jesseduffield/lazydocker/pkg/config GH-283 Co-authored-by: Sven Greb <[email protected]>
Created a new snowblock for lazydocker [1]. > The lazier way to manage everything Docker. > A simple terminal UI for both Docker and docker-compose. I've used it for quite some time and the configurations have now been tested enough on a day-by-day basis to be persisted in igloo. Initially this includes the `config.yml` file [2] symlinked to the corresponding XDG specific [3] and OS dependent path(s) [4]. The keybindings [5] are can not be customized yet, but some initial work has been done [6] so maybe it'll be possible in later versions. The colors have been adjusted to match the Nord [7] theme style. For more details about available configurations see the `github.com/jesseduffield/lazydocker/pkg/config` package documentation [8]. [1]: https://github.com/jesseduffield/lazydocker [2]: https://github.com/jesseduffield/lazydocker/blob/master/docs/Config.md [3]: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html [4]: https://github.com/jesseduffield/lazydocker/blob/master/docs/Config.md#locations [5]: https://github.com/jesseduffield/lazydocker/blob/master/docs/keybindings/Keybindings_en.md [6]: jesseduffield/lazydocker#117 [7]: https://www.nordtheme.com [8]: https://pkg.go.dev/github.com/jesseduffield/lazydocker/pkg/config Resolves GH-283 Co-authored-by: Sven Greb <[email protected]>
fixes #48
Signed-off-by: Glenn Vriesman [email protected]