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

new plugin: uniform shell information presentation plugin #605

Closed
wants to merge 1 commit into from

Conversation

SethMilliken
Copy link

This plugin is designed to provide a uniform method of cleanly applying
style modifications to shell information included in the prompt.

Provided in this version are functions to add simple shell parameters
(as in man zshparam) with corresponding prefix and suffix
configuration settings, to allow for clean application of style
directives (i.e. color and spacing) as settings rather than directly
inline in your PROMPT.

EXAMPLE THEME USAGE:
...
PROMPT+="$(command_number)"
...
SHELL_PLUGIN[command_number_prefix]="%{$bg[white]%}%{$fg_bold[grey]%} "
SHELL_PLUGIN[command_number_suffix]=" %{$reset_color%}"

This plugin is designed to provide a uniform method of cleanly applying
style modifications to shell information included in the prompt.

Provided in this version are functions to add simple shell parameters
(as in `man zshparam`) with corresponding prefix and suffix
configuration settings, to allow for clean application of style
directives (i.e. color and spacing) as settings rather than directly
inline in your PROMPT.

EXAMPLE THEME USAGE:
...
PROMPT+="$(command_number)"
...
SHELL_PLUGIN[command_number_prefix]="%{$bg[white]%}%{$fg_bold[grey]%} "
SHELL_PLUGIN[command_number_suffix]=" %{$reset_color%}"
@sorin-ionescu
Copy link
Contributor

You're wrapping shell prompt escapes for no good reason. It's overly complicated and has a performance hit due to the sub shells. %F{white}%n%f@%F{blue}%m%f is much simpler.

If you want your PROMPT definition to be simpler, catenate or type man zshmodules and study zstyle and zformat.

@SethMilliken
Copy link
Author

@sorin-ionescu: alas, the dangers of naïve enthusiasm and of assuming the model from which i extended was sound. thank you for the information and the prescriptions.

@SethMilliken
Copy link
Author

closing. going to rework this or my whole strategy for shell prompt escapes based on @sorin-ionescu's advice.

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