Skip to content
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

Introduce options for customizing the normal mode's prompt #364

Merged
merged 3 commits into from
Jun 27, 2023
Merged

Introduce options for customizing the normal mode's prompt #364

merged 3 commits into from
Jun 27, 2023

Conversation

resolritter
Copy link
Contributor

@resolritter resolritter commented Jun 1, 2023

First of all, thanks for this great software.

I'd like to have a "Vim-like" minimalistic normal mode prompt without the default filename + background highlighting. I was not able to customize the prompt to my liking with the current options, thus I created two new ones: HidePromptFilename and InvertPromptColor. In my ~/.config/ov/config.yaml I am setting them like this:

HidePromptFilename: true
InvertPromptColor: false

I also thought of organizing all prompt-related options into a single Config entry, like this:

+type OVPromptConfig struct {
+	HideFilename       bool
+	InvertColor        bool
+}
+
 // Config represents the settings of ov.
 type Config struct {
 	Keybind                  map[string][]string
@@ -192,8 +197,7 @@ type Config struct {
 	RegexpSearch             bool
 	Incsearch                bool
 	Debug                    bool
-	HidePromptFilename       bool
-	InvertPromptColor        bool
+	Prompt                   OVPromptConfig
 }

What do you think?

@noborus
Copy link
Owner

noborus commented Jun 1, 2023

Thank you for your wonderful pull request.
I was thinking of postponing customizing the prompts until there was a demand.
I like your idea, but if others want to customize the prompt further, a boolean value may not be enough.
(If anyone else wants to customize it further, let me know in the comments.)
I don't want the configuration to be as complicated as possible, so I'm willing to integrate if this is good enough.

@resolritter
Copy link
Contributor Author

resolritter commented Jun 1, 2023

I like your idea, but if others want to customize the prompt further, a boolean value may not be enough.

Yes, I agree. I don't think that the initial design is flexible enough if we take into account the possibility of further customizations in the future.

Based on that feedback, I grouped the options under Prompt.Normal. Let's imagine a few possibilities based on this new design:

  • Customize the prompt's color: Prompt.Normal.Color: "#FF0000"
  • Control the prompt's modeStatus display: Prompt.Normal.ShowModeStatus: false
  • Use a preset style: Prompt.Normal.Style: "minimal"

Likewise, we'll allow for other modes to be customized independently through Prompt.[ModeName], e.g. Prompt.InputSearch.Icon: ">>".

Please let me know if you have other ideas or suggestions.

@noborus
Copy link
Owner

noborus commented Jun 1, 2023

Thank you for your improvement.
Another way I'm thinking of is to create a format that supports variable substitution like a shell prompt.
(I haven't decided to do so yet).

@noborus
Copy link
Owner

noborus commented Jun 27, 2023

Late, but decided to merge.
Thank you for the pr!

@noborus noborus merged commit 3bb04d7 into noborus:master Jun 27, 2023
@resolritter resolritter deleted the pr branch June 28, 2023 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants