geometry-zsh / geometry Goto Github PK
View Code? Open in Web Editor NEWgeometry is a minimal, fully customizable and composable zsh prompt theme
License: ISC License
geometry is a minimal, fully customizable and composable zsh prompt theme
License: ISC License
Is it possible to be added? I really like geometry!
Update default plugins to make use of GEOMETRY_PLUGIN_SEPARATOR
to separate prompt blocks.
Some plugins such as git
use a hardcoded string as separator (ex. ::
). Review if it's necessary to change it for each plugin or just some of them.
Is there any particular reason the prompt always adds an extra line? I was wondering if we could add an option to remove that, I found if I changed
prompt_geometry_render() {
PROMPT="
%(?.$GEOMETRY_PROMPT.$GEOMETRY_EXIT_VALUE) %F{$GEOMETRY_COLOR_DIR}%3~%f "
PROMPT2=" $GEOMETRY_SYMBOL_RPROMPT "
RPROMPT="$(prompt_geometry_git_info)%{$reset_color%}"
}
to
prompt_geometry_render() {
PROMPT="%(?.$GEOMETRY_PROMPT.$GEOMETRY_EXIT_VALUE) %F{$GEOMETRY_COLOR_DIR}%3~%f "
PROMPT2=" $GEOMETRY_SYMBOL_RPROMPT "
RPROMPT="$(prompt_geometry_git_info)%{$reset_color%}"
}
and i get a single line
unless you think this would break anything I'm happy to submit a PR w/ this as a feature/optoin
Is there any plan to add some sort of indicator for background jobs?
Some users may assume that syntax highlighting will be enabled with the theme (command colouring) - at least I got asked once.
So it may be useful to add a note explaining which plugins are used.
AFAIK there is only zsh-users/zsh-syntax-highlighting
plugin installed in the screenshots.
Edit: Other thing to add would be the terminal and rupa/z
plugin.
Create built-in plugin (in the lines of virtualenv
and docker_machine
) for node
and npm
version prompt.
Prompt should look something like:
⬡ v6.9.2 (3.10.9)
npm
s start up time is quite noticeable so version information should be cached in the setup phrase, in fact, this should be done for node
and npm
.
This is a great opportunity for anyone interested in contributing.
--ignore-submodules
flag was introduced in git 1.7.2
. If geometry is used with this git version it throws an error:
▲ ~/geometry error: unknown option `ignore-submodules'
usage: git status [options] [--] <filepattern>...
-v, --verbose be verbose
-s, --short show status concisely
--porcelain show porcelain output format
-z, --null terminate entries with NUL
-u, --untracked-files[=<mode>]
show untracked files, optional modes: all, normal, no. (Default: all)
This is almost a non-issue as git 1.7.1
was released in 2010, but I stumbled with this issue on a CentOS 6 machine.
After every prompt, I'm getting the following, which can be dismissed by pressing enter:
remove /tmp/geometry-rprompt-info-69286?
To give visibility and kick start a plugin ecosystem.
Meanwhile most custom plugins are rather too specific for publishing there is still a place for plugins for 'svn', for example.
Thoughts you guys?
I am using zplug
to manage my plugins, since the update from #13, I now get this error:
prompt_geometry_render:1: = not found
I have updated, reloaded my terminal, reloaded zsh and as a last resort re-installed geometry.
Any thoughts? I looked through the code but my understanding is very primitive. Thanks
Variables that I am using:
PROMPT_GEOMETRY_GIT_TIME=false
GEOMETRY_COLOR_GIT_DIRTY=9
GEOMETRY_COLOR_GIT_BRANCH=6
GEOMETRY_COLOR_EXIT_VALUE=9
PROMPT_GEOMETRY_GIT_CONFLICTS=true
GEOMETRY_SYMBOL_EXIT_VALUE="▲"
I am having a problem using this theme when I try to tab complete
so it's like
▲ .oh-my-zsh/custom/themes ls
and after tab completion it becomes
▲ .oh-my-zsh/custom/themesls
I tried to modify the theme but failed. Really can't figure out where the problem is
As per #59. Aliased commands may break/change geometry inner workings.
Avoid this with a similar approach to zsh-users/zsh-syntax-highlighting#390:
At the top:
# Save aliases into a variable and remove/unalias everything
zsh_highlight__aliases=`alias -L`
builtin unalias -m '*'
At the bottom:
# Restore aliases & kill global variable
eval "$zsh_highlight__aliases"
builtin unset zsh_highlight__aliases
It seems like there is a big delay getting the git information, especially for large repositories. There are some small optimizations we can do with git log -1
everywhere but maybe looking at pure and other prompts that use async we can get a pty to render the git portion.
The idea is to compile geometry.zsh with lib/*
and plugins/*
bundled into it in order to have a single .zsh
to source.
In the example images, the colors and other configuration options are different from the default configuration geometry has. Is it possible for the exact configuration of the example to be explained somewhere, or at least some of the color choices? It looks awesome.
As of now it's not really that much random.
There are a lot of recurrent colors (purple, blue, light blue). Might have to do with my own setup which currently is Base16 Tomorrow Night.
However there seem to be some colors that are missing out, mainly to try and avoid conflicts with the red symbol used when a command has a non-zero exit.
I'd like to define my own indicators that will be included in PROMPT. I can easily create a function or variable to return indicator string, but I miss is a proper way to inject it into geometry PROMPT.
Similar to #57 create a plugin for ruby/rvm version information prompt.
Use rvm
/rbenv
if available. Display in the following format:
◆ 2.3.3 (1.27.0)
Cache version information in the setup phrase.
This is a great opportunity for anyone interested in contributing.
I was looking for a way to configure geometry to a single line prompt, so I tried setting GEOMETRY_PROMPT_PREFIX=""
but this does not seem to work. I randombly fell on #102 and specifically on this line. I have very limited zsh knowledge but I guess that this defines GEOMETRY_PROMPT_PREFIX
to be $\n
if it is not set.
By adding it in a configuration file with an empty setting, I guess it is treated as "not set" so it defaults to a new line.
Is it possible to override this somehow and get a single line prompt?
I seem ti be getting a parse error when im changing from branch or fetch. This ends up to not showing the branch name in the promt anymore.
_git_branch:4: parse error: condition expected: 1
__gitcomp_nl:compset:5: can only be called from completion function
__gitcomp_nl:compadd:6: can only be called from completion function
I'm using iTerm on OS X El Capitan v10.11.4
Change error message:
Error: Plugin $PLUGIN already registered.
Into a warning message:
Warning: Plugin $PLUGIN already registered.
Fixes #109
There are lots of tools that can be added to the prompt, they are useful for some but not generally useful for everyone, naturally. This causes the code to grow large and maintenance becomes a problem. This will become an issue as more prompts are added.
To be able to manage this issue I propose to turn most informative prompts (git, virtualenv, python, etc) into a separate file that can be loaded at runtime. This will keep separate the base prompt from the informative prompts, making maintenance a bit easier. Also performance-wise seems reasonable to keep unloaded unused prompts.
This structure will also provide the ability to create custom -user made- prompts, outside the geometry code base.
Implementation will require to establish a common interface for the prompts (function and variable names) as well as a globally available array to register a given plugins/prompt. Similar to https://github.com/zsh-users/zsh-syntax-highlighting/blob/master/docs/highlighters.md
Thoughts?
Edit: Probably Fixes #24
BRACE_CCL
option set by prezto's environment
module causes:
Fatal error ambiguous argument @u
By removing {
and }
from the commands.
On this particular scenario, where the user holds the enter-key and the current directory is a huge repository, geometry (async library, in fact) may consume a lot of CPU and for this reason the prompt may "lag" and seem "slow".
I attribute the high CPU usage to the exec, kill, and re-exec of git subprocesses to print the git built-in plugin.
We could solve this by performing a small cache (1 sec, half a sec) of rprompt. Any other idea? Suggestion?
Hi there, I really like this minimal theme. There's just a small annoyance, whenever I cd
to a directory with a git repo, it outputs:
_git_remote_check:5: = not found
Having RPROMPT when running a subshell in midnight commander produces all kind of weirdness. I used to disable it completely under such condition. All I need is an option in geometry to do so. Probably I can hack it around without changing the geometry, but messing with precmd hooks isn't a sane way to maintain it.
Alright, so i'm running the latest version of oh-my-zsh and I've gone through the tutorial on your page and keep getting the same error for the theme "geometry":
prompt_geometry_render:local:13: not valid in this context: %F{242}master%f
but the triangle will still load...
Any thoughts?
We have removed the "enabled" flags from virtual_env
and docker_machine
, exec_time
still has this configuration available.
The exec_time
built-in plugin shows a strange behavior after being displayed once. It may keep being show whether a command is executed or not.
Steps to reproduce:
Expected behavior:
exec_time
plugin is shownShown behavior:
exec_time
is shown (8s, 9s, etc)I get the following error when trying to use geometry:
geometry_prompt:1: command not found: add-zsh-hook
geometry_prompt:2: command not found: add-zsh-hook
Any way to fix that?
Hi @frmendes, I found this theme recently and am loving it, but it's missing Python's virtualenv support, if I send a PR, are you interested in merging such a feature?
Currently geometry won't run on zsh 5.0.x
due to a simple syntax issue present in a couple of places, ej. https://github.com/frmendes/geometry/blob/master/geometry.zsh#L124, https://github.com/frmendes/geometry/blob/master/geometry.zsh#L223.
Error message:
geometry.plugin.zsh:124: parse error near `]]'
These are easy to fix issues for anyone interested in contributing.
As per #53 (comment). Rename GEOMETRY_PROMPT_DEFAULT_PROMPTS
to GEOMETRY_PROMPT_PLUGINS
.
@frmendes I'm creating this just to keep track of it.
A bit offtopic but I'm having trouble with developing for this plugin, since my process currently is just to change the repo dir inside ~/.antigen/repos/
, running antigen update and then opening a new terminal and checking if it worked. I'm using an absolute dir path in my ~/.zshrc
but antigen update doesn't seem to be tracking changes there. Do you have a better way of doing this?
Over at oh-my-zsh we just confirmed the geometry theme to be responsible for the double evaluation of commands within backticks and $():
$ echo echo doh >> doh
$ cat doh
doh
doh
The same happens with $(). mcornella was able to trace it to:
prompt_geometry_set_cmd_title () {
prompt_geometry_print_title "${2} @ %m"
}
When I set that function to {}, the problem disappears.
Some plugins, such as docker machine, have an enabled
variable. If the plugin is loaded, it should be considered enabled, otherwise the user wouldn't have added it to the plugin list.
It's also not intuitive having to add the plugin to a plugin list and setting an environment variable.
After updating zplug and my plugins (including geometry) I began receiving the following messages, everytime I start a new session.
$ zsh
Error: Plugin exec_time already registered.
Error: Plugin git already registered.
Error: Plugin hg already registered.
How can this be fixed?
Close after answer, Thanks!
Hi,
Updated to zplug 2.3.1
, and since then have had lots of issues with zsh, there is also this issue, where the theme is not displayed, but this error keeps appearing:
prompt_geometry_git_conflicts:[:10: integer expression expected: 1\n1
I have an issue posted (here, for some more information)[https://github.com/zplug/zplug/issues/268]
Do you know if this is anything caused on your end, or a symptom of a larger issue?
Current instructions are outdated and I guess they don't work with the current geometry structure (I haven't tried it).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.