- Add runcpp11 to this readme
Just my custom Zsh settings to get a nice looking terminal prompt.
you can get zsh from here
then if you load the files from this repository into your .oh-my-zsh/custom
folder you'll have the same beautiful prompt (see below for photos)
you'll need to move your ~/.zshrc
to ~/.oh-my-zsh/custom/
and then symlink it back using ln -s ~/.oh-my-zsh/custom/.zshrc .zshrc
if you want the custom options like removing duplicates in up arrow history. All file locations assume a default install of oh-my-zsh.
'/personalAliases.zsh' is for my custom shortcuts on my machine, probably not relevant to your machine and directories, you can delete it, modify it or whatever. I could have .gitignere'd it but I wanted to have it as a record up here.
syntax = git:( BRANCH )
git:(
and )
are the ZSH_THEME_GIT_PROMPT_PREFIX
and the ZSH_THEME_GIT_PROMPT_SUFFIX
respectively, referred to as 'git:( + )' from now on (as the prefix and suffix are always a matching colour)
BRANCH is the current branch checked out
Green = Nothing to commit and working tree is clean Yellow = Untracked, not staged files present, add and commit to get to BRANCH = green
Green = Remote exists and is same as local
Yellow = Remote doesn't exist or hasn't been set with: git remote add origin https/some/url/here.git
Magenta = Diverged state, some commits have been made locally and some have been made on remote separately (see note below)
Cyan = Local is ahead of tracked HEAD (not necessarily remote see note below)
Red = Local is ahead of tracked HEAD (not necessarily remote see note below)
The tracked HEAD is local, to see remote status try 'git remote show origin', to get full functionality use 'git fetch' to update local tracked HEAD to match remote, this will not overwrite local files but allow the functions for comparing to the remote to calculate correctly, this is specific to the Magenta, Cyan and Red displays.
Below is a screen shot:
it shows the following pseudo steps:
- Repository exists locally and on remote but is not yet set with the
git add remote https/some/url/here
command - Shows the BRANCH colour changing based on the local working tree status
- Equal remote and local, clean working tree (green and green)
- Equal remote and local, dirty working tree (green and yellow)
- Remote behind local, clean working tree (blue and green)
- In the mean time I added some files directly to the remote, you can see this in the output from
git remote show origin
- Used fetch to update the tracked HEAD to match the remote
- Diverged remote and local, clean working tree (magenta and green)
- Pull down remote changes, now local is ahead of remote
- Remote behind local, clean working tree (blue and green)
- Equal remote and local, clean working tree (green and green)
- Changed some files only on the remote, you can see this in the output from
git remote show origin
- Used fetch to update the tracked HEAD to match the remote
- Remote ahead of local, clean working tree (red and green)
git pull
- Equal remote and local, clean working tree (green and green) - "Ahh thats better, whew" - Shaun
Hopefully thats self explanatory, only works for macOS currently but easy to modify the battery_prompt_colour.zsh as per the comments found in it. Feel free to open up a pull request if you implement it.
Runc
is a little script to make, run and then remove the executable file, it takes a c or cpp filename without the extension (very important or it will delete your source code after running it) as an argument and compiles it and runs it. Full credit to Ben Allen.
use ghrc <username> <reponame> -p -d <description>
-p
= use this option to set github repo as private
-d
(optional) = a description and requires a description after it
to create a repo online at github, it will prompt you to enter your password.
username is the github username for the repository
requires the alias.zsh file for this short command.
use ginit
(same arguments as Github Create Repo) to run the initialise the directory with git, create a readme, stage the changes commit them, then uses Github Create Repo to create a remote repo and to set the origin to this remote and then link the local to the remote