Code Monkey home page Code Monkey logo

Comments (5)

ColinHebert avatar ColinHebert commented on September 21, 2024

I agree with the hardware part, I'm not so sure for the theming part.

It's not useful to have prompt-init in the init of OMZ, but having themes inside a promptmodule isn't IMHO an acceptable solution.

Indeed, themes can sometime need a prompt-init, but it doesn't have to always be about the prompt (if they only set LESS variables, etc). What I mean is, themes aren't really a part of any module, they can rely on some of them (git-module, prompt-module, hardware-module) but are more "global" than modules.

I don't claim that I have a nice solution for this problem, but I'm pretty sure that having every themes into prompt is a not-so-great idea. I think they should be kept in the root of OMZ in the theme folder, because as I said, they're not really related to "a module" but are (as modules are) an important part of OMZ.

Another use case that annoys me a bit is when there is a theme that does not need a promptinit. Where should that theme go? How should it be loaded? If they're in $OMZ/themes there is some logic to where it should be put and how it should be loaded.


Maybe a theme should be loaded the same way modules are (sourcing). Themes using prompt would omload the prompt module (which would load the right theme) whereas other would just take care of themselves.

from prezto.

sorin-ionescu avatar sorin-ionescu commented on September 21, 2024

What I am proposing is not a radical idea. It just looks alien compared to OMZ 1. Zsh themes are installed in /usr/share/zsh/4.3.11/functions/ or /share/zsh/4.3.11/functions/Prompts/ depending on ./configure flags.

/usr/share/zsh/4.3.11/functions/prompt_adam1_setup
/usr/share/zsh/4.3.11/functions/prompt_adam2_setup
/usr/share/zsh/4.3.11/functions/prompt_bart_setup
...

Themes should just style the prompt. They are not the place to style LESS.

A theme that does not use promptinit, such as Phil's, should remain where it already is, in zshrc, until the author decides to convert it to prompt_phil_setup. themes/ has never been the place to mix promptinit and non-prompinit themes nor intended as such.

from prezto.

ColinHebert avatar ColinHebert commented on September 21, 2024

Okay, I can agree with that solution if it's not about 'themes' anymore but only and specifically 'prompts'.

OMZ1 (and the current layout) implies with "themes", that it isn't only about the prompt but about theming in general (could include man, ls, grep and basically anything that can be themed).

Until now this question hasn't really been raised, mostly because current themes (even the one I'm making) are only using prompt, but some of the old themes did set LS_COLORS. So it should be said clearly in the wiki that nothing except prompts should be used, everything else should be in zshrc.

from prezto.

sorin-ionescu avatar sorin-ionescu commented on September 21, 2024

It was always about prompts in both OMZ1 and my own fork. Some people got carried away and put all sorts of stuff in the themes, and you can as well, nothing stops you, but it's mainly about prompts.

from prezto.

sorin-ionescu avatar sorin-ionescu commented on September 21, 2024

This was done in 66c1448.

from prezto.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.