diff --git a/ZSH_Themes.md b/ZSH_Themes.md index f86599c..daa7d6c 100644 --- a/ZSH_Themes.md +++ b/ZSH_Themes.md @@ -6,7 +6,7 @@ Using the [spaceship theme](https://github.com/spaceship-prompt/spaceship-prompt) : This shows the conda environment, current dir and kubectl context on the left, and the git branch on the right -screenshot +screenshot my settings in .zshrc @@ -59,7 +59,7 @@ ZSH_THEME="common" If you are using conda/miniconda, there are no modifications required for the common.zsh-theme. It should show like this: -screenshot +screenshot @@ -88,7 +88,7 @@ See the result below. In this case, the folder name is webscrape and the pyenv name is py39 -screenshot +screenshot ### Configuring kube-ps-1 diff --git a/common_theme_conda_env.png b/assets/common_theme_conda_env.png similarity index 100% rename from common_theme_conda_env.png rename to assets/common_theme_conda_env.png diff --git a/common_theme_screenshot.png b/assets/common_theme_screenshot.png similarity index 100% rename from common_theme_screenshot.png rename to assets/common_theme_screenshot.png diff --git a/assets/ohmyposh-screenshot-moreinfo.png b/assets/ohmyposh-screenshot-moreinfo.png new file mode 100644 index 0000000..3c0c764 Binary files /dev/null and b/assets/ohmyposh-screenshot-moreinfo.png differ diff --git a/assets/ohmyposh-shell-screenshot.png b/assets/ohmyposh-shell-screenshot.png new file mode 100644 index 0000000..8dabc22 Binary files /dev/null and b/assets/ohmyposh-shell-screenshot.png differ diff --git a/spaceship-theme.png b/assets/spaceship-theme.png similarity index 100% rename from spaceship-theme.png rename to assets/spaceship-theme.png diff --git a/minimal-setup-2024.md b/minimal-setup-2024.md new file mode 100644 index 0000000..641f192 --- /dev/null +++ b/minimal-setup-2024.md @@ -0,0 +1,81 @@ +# An attempt at a minimal mac dev setup + + +## Install Homebrew + +```bash +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +brew +(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/g/.zprofile\ + eval "$(/opt/homebrew/bin/brew shellenv)"\ +``` + +## Install some utilities +```bash +brew install 1password dropbox iterm2 arc shottr firefox telegram +``` + +## Install dev tools +```bash +brew install colima kind docker docker-credential-helper docker-compose docker-buildx kubectl visual-studio-code zed micromamba +``` + +## Setup custom resolutions with [hipdpi script](https://github.com/xzhih/one-key-hidpi) +- This is for my ultra wide monitor (optional) +```bash +bash -c "$(curl -fsSL https://raw.githubusercontent.com/xzhih/one-key-hidpi/master/hidpi.sh)" +# set custom resolution of 2580x1080 in the script menus +``` + +## Setup ZSH + +### ZSH Plugins + +Add ZSH Autosuggestions +```bash +git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions +``` + +ZSH Syntax Highlighting +```bash +git clone https://github.com/zsh-users/zsh-syntax-highlighting.git +echo "source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >> ${ZDOTDIR:-$HOME}/.zshrc +``` + +Append to the end of the file `.zshrc + +It might look like this +```bash +source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh +source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh +``` + +### `oh-my-posh` + +Modified Theme [bubblesline](https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/themes/bubblesline.omp.json) to simplify the display + +You may view the config [here](ohmyposh.json) + +Screenshot showing the Folder Name, and kubernetes context name + +![alt text](assets/ohmyposh-shell-screenshot.png) + +Screenshot showing folder name, git branch , python environment name and kubernetes context and namespace: + +![alt text](assets/ohmyposh-screenshot-moreinfo.png) + + +Source the theme using the snippet below +``` +#ohmyposh + +# update the file name and path accordingly +OHMYPOSHTHEMEFILE=v2a.json + +eval "$(oh-my-posh init zsh --config $HOME/.config/ohmyposh/$OHMYPOSHTHEMEFILE)" +if [ "$TERM_PROGRAM" != "Apple_Terminal" ]; then + eval "$(oh-my-posh init zsh)" +fi +``` + +Reload the Shell: `exec $SHELL` diff --git a/ohmyposh.json b/ohmyposh.json new file mode 100644 index 0000000..cec411e --- /dev/null +++ b/ohmyposh.json @@ -0,0 +1,68 @@ +{ + "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", + + "version": 2, + "final_space": true, + "console_title_template": "{{ .Shell }} in {{ .Folder }}", + "blocks": [ + { + "alignment": "left", + "type": "prompt", + "segments": [ + { + "type": "path", + "background": "darkGray", + "foreground": "lightYellow", + "leading_diamond": "\ue0b6", + "style": "diamond", + "template": "\ue5ff {{ .Folder }}", + "trailing_diamond": "\ue0b4", + "properties": { + "style" : "full" + } + }, + { + "type": "git", + "background": "darkGray", + "foreground": "blue", + "leading_diamond": " \ue0b6", + "properties": { + "branch_icon": "" + }, + "style": "diamond", + "template": "{{ .HEAD }}", + "trailing_diamond": "\ue0b4" + }, + { + "type": "python", + "background": "darkGray", + "foreground": "lightGreen", + "leading_diamond": " \ue0b6", + "style": "diamond", + "template": "{{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }} {{ end }}{{ .Full }}{{ end }}", + "trailing_diamond": "\ue0b4", + "properties": { + "fetch_version": false, + "fetch_virtual_env": true + } + }, + + { + "type": "kubectl", + "style": "diamond", + "leading_diamond": " \ue0b6", + "trailing_diamond": "\ue0b4", + "foreground": "cyan", + "background": "darkGray", + "template": " {{.Context}}{{if .Namespace}} :: {{.Namespace}}{{end}} ", + "properties": { + "context_aliases": { + "arn:aws:eks:eu-west-1:1234567890:cluster/posh": "posh" + } + } + } + ] + } + ] + +} \ No newline at end of file