Skip to content

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

Merged
noborus merged 3 commits into
noborus:masterfrom
resolritter:pr
Jun 27, 2023
Merged

Introduce options for customizing the normal mode's prompt#364
noborus merged 3 commits into
noborus:masterfrom
resolritter:pr

Conversation

@resolritter

@resolritter resolritter commented Jun 1, 2023

Copy link
Copy Markdown
Contributor

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

noborus commented Jun 1, 2023

Copy link
Copy Markdown
Owner

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

resolritter commented Jun 1, 2023

Copy link
Copy Markdown
Contributor Author

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

noborus commented Jun 1, 2023

Copy link
Copy Markdown
Owner

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

noborus commented Jun 27, 2023

Copy link
Copy Markdown
Owner

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
@visrosa

visrosa commented Jun 5, 2025

Copy link
Copy Markdown
Contributor

Thanks for this software. I'd love more prompt customization options!

Setting background and foreground at least, but would be nice to hide it completely too.

@noborus

noborus commented Jun 5, 2025

Copy link
Copy Markdown
Owner

Thanks for this software. I'd love more prompt customization options!

Setting background and foreground at least, but would be nice to hide it completely too.

Thank you for your comment.
I would appreciate it if you could create a new issue.

@noborus

noborus commented Jun 9, 2025

Copy link
Copy Markdown
Owner

The issue of hiding the statusline has already been raised in issue #426.
Please leave your comments and reactions here.

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.

3 participants