From 120cab741ee2bd6aa308a1a4a120feb8d9745ef9 Mon Sep 17 00:00:00 2001 From: sgoudham Date: Wed, 7 Dec 2022 23:33:46 +0000 Subject: [PATCH] update zsh stuff --- dot_config/empty_M365Princess.omp.json | 0 dot_config/private_M365Princess.omp.json | 75 ---------------- dot_zshenv | 3 + dot_zshrc | 104 +++++++++-------------- 4 files changed, 45 insertions(+), 137 deletions(-) create mode 100644 dot_config/empty_M365Princess.omp.json delete mode 100644 dot_config/private_M365Princess.omp.json create mode 100644 dot_zshenv diff --git a/dot_config/empty_M365Princess.omp.json b/dot_config/empty_M365Princess.omp.json new file mode 100644 index 0000000..e69de29 diff --git a/dot_config/private_M365Princess.omp.json b/dot_config/private_M365Princess.omp.json deleted file mode 100644 index fb306ab..0000000 --- a/dot_config/private_M365Princess.omp.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", - "version": 2, - "final_space": true, - "blocks": [ - { - "type": "prompt", - "alignment": "left", - "segments": [ - { - "foreground": "#757575", - "style": "plain", - "template": "\u250c ", - "type": "text" - }, - { - "type": "path", - "style": "powerline", - "foreground": "#cba6f7", - "leading_diamond": "\ue0b0", - "template": "{{ .Path }} ", - "properties": { - "style": "folder" - } - }, - { - "type": "git", - "style": "plain", - "foreground": "#f5c2e7", - "template": "on {{ .UpstreamIcon }}{{ .HEAD }} ", - "properties": { - "fetch_upstream_icon": true - } - }, - { - "type": "node", - "style": "plain", - "foreground": "#fab387", - "template": "via \ue718 {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }} " - }, - { - "type": "go", - "style": "plain", - "foreground": "#fab387", - "template": "via \uFCD1 {{ .Full }} " - }, - { - "type": "haskell", - "style": "plain", - "foreground": "#fab387", - "template": "via \ue61f {{ .Full }}" - } - ] - }, - { - "type": "prompt", - "alignment": "left", - "newline": true, - "segments": [ - { - "foreground": "#757575", - "style": "plain", - "template": "\u2514 ", - "type": "text" - }, - { - "foreground": "#ffffff", - "style": "plain", - "template": "$", - "type": "text" - } - ] - } - ] -} diff --git a/dot_zshenv b/dot_zshenv new file mode 100644 index 0000000..81e1c78 --- /dev/null +++ b/dot_zshenv @@ -0,0 +1,3 @@ +# Editing +export EDITOR="lvim" +export SUDO_EDITOR=$(which lvim) diff --git a/dot_zshrc b/dot_zshrc index e4ce1f0..f9e0fcb 100644 --- a/dot_zshrc +++ b/dot_zshrc @@ -1,7 +1,9 @@ # vim:ft=zsh:fenc=utf-8 -### plugins via antigen {{{ -# don't pollute $HOME with antigen +# Prompt +eval "$(starship init zsh)" + +# Plugins - Antigen ADOTDIR="$HOME/.local/share/antigen" if [[ ! -d "$ADOTDIR" ]]; then mkdir -p "$ADOTDIR" @@ -9,7 +11,7 @@ if [[ ! -d "$ADOTDIR" ]]; then chmod +x "$ADOTDIR" fi -# load antigen +# Load Antigen source "$ADOTDIR/antigen.zsh" antigen use oh-my-zsh antigen bundle colored-man-pages @@ -23,86 +25,64 @@ antigen bundle zsh-users/zsh-syntax-highlighting antigen apply -# If not running interactively, don't do anything -case $- in - *i*) ;; - *) return;; -esac +# Make 'less' friendlier for non-text input files, see lesspipe(1) +[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# Forcing 256 bit colour +export TERM=xterm-256color +# Keep History export HISTFILE="$HOME/.zhistory" export HISTSIZE=10000 export SAVEHIST=10000 setopt HIST_IGNORE_ALL_DUPS setopt HIST_IGNORE_DUPS -# If set, the pattern "**" used in a pathname expansion context will -# match all files and zero or more directories and subdirectories. -#shopt -s globstar - -# make less more friendly for non-text input files, see lesspipe(1) -[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" - -# set variable identifying the chroot you work in (used in the prompt below) -if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then - debian_chroot=$(cat /etc/debian_chroot) -fi - -# Forcing 256 bit colour -TERM=xterm-256color +# Coloured GCC warnings and errors +export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' -# enable color support of ls and also add handy aliases +# Color support of 'ls' and also add aliases if [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" alias ls='ls --color=auto' - #alias dir='dir --color=auto' - #alias vdir='vdir --color=auto' - alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' fi -# Coloured GCC warnings and errors -export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' +# Display images in the terminal +function icat() { + if [ "$TERM_PROGRAM" = "WezTerm" ]; then + wezterm imgcat "$@" + elif [ "$TERM" = "xterm-kitty" ]; then + kitty +kitten icat "$@" + else + echo 'No image viewer defined for this terminal' + fi +} + +# export PATH="$PATH:$HOME/.local/share/scripts" +# export M2_HOME="$HOME/.local/bin/apache-maven-3.8.6/bin" +# export PATH="$PATH:$M2_HOME" +# export DENO_INSTALL="$HOME/.deno" +# export PATH="$DENO_INSTALL/bin:$PATH" + +# PATH +export PATH="$PATH:$HOME/.local/bin" +export PATH="$PATH:$HOME/.local/scripts" -# some more ls aliases -alias ll='ls -alF' -alias la='ls -A' -alias l='ls -CF' +# Rust +. "$HOME/.cargo/env" -alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' +# Go +export PATH="$PATH:$HOME/.local/share/go/bin" -. "$HOME/.cargo/env" +# Haskell (ghcup-env) +[ -f "$HOME/.ghcup/env" ] && source "$HOME/.ghcup/env" +# Node export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion -# set PATH so it includes user's private bin if it exists -if [ -d "$HOME/bin" ] ; then - PATH="$HOME/bin:$PATH" -fi - -export PATH="$PATH:$HOME/.local/bin" -export PATH="$PATH:$HOME/.local/share/scripts" -export PATH="$PATH:/usr/bin/go/bin" -export PATH="$PATH:/usr/local/go/bin" -export M2_HOME="$HOME/.local/bin/apache-maven-3.8.6/bin" -export PATH="$PATH:$M2_HOME" -export DENO_INSTALL="$HOME/.deno" -export PATH="$DENO_INSTALL/bin:$PATH" -export EDITOR="lvim" - -[ -f "/home/sgoudham/.ghcup/env" ] && source "/home/sgoudham/.ghcup/env" # ghcup-env - -eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" - -eval "$(zoxide init zsh)" -eval "$(oh-my-posh --init --shell zsh --config ~/.config/M365Princess.omp.json)" - -#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!! -export SDKMAN_DIR="$HOME/.sdkman" -[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh" - -. "$HOME/.config/wezterm/wezterm.sh" - +# . "$HOME/.config/wezterm/wezterm.sh"