Skip to content

Instantly share code, notes, and snippets.

@idoqo
Created November 24, 2020 15:39
Show Gist options
  • Save idoqo/c8617fd982a5d69eaf931ae2d02b8858 to your computer and use it in GitHub Desktop.
Save idoqo/c8617fd982a5d69eaf931ae2d02b8858 to your computer and use it in GitHub Desktop.

Revisions

  1. idoqo created this gist Nov 24, 2020.
    72 changes: 72 additions & 0 deletions zshrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,72 @@
    #
    # Executes commands at the start of an interactive session.
    #
    # Authors:
    # Sorin Ionescu <[email protected]>
    #

    # Source Prezto.
    if [[ -s "${ZDOTDIR:-$HOME}/.zprezto/init.zsh" ]]; then
    source "${ZDOTDIR:-$HOME}/.zprezto/init.zsh"
    fi

    # Customize to your needs...
    export LANG=en_US.UTF-8
    export LC_TYPE=en_US.UTF-8
    export PATH="$PATH:$HOME/go/bin"
    export PATH="$PATH:$HOME/.config/composer/vendor/bin"
    export PATH="$PATH:$HOME/.local/bin"

    # add path for the nand2tetris project
    export PATH="$PATH:/home/michael/apps/nand2tetris/tools"
    autoload -Uz promptinit
    promptinit
    prompt cloud 'λ' grey green

    # Aliases
    alias dotfiles="/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME"
    alias def="sdcv -c"
    alias fp="featherpad"
    alias scth="schemathesis"
    alias xcopy="xclip -selection clipboard"
    alias xpaste="xclip -selection clipboard -o"
    alias mk="minikube"
    alias kb="kubectl"
    alias vb="VBoxManage"
    alias def="sdcv -c"
    alias sth="systemctl suspend-then-hibernate"
    alias ls="ls --color=auto"
    alias grep="grep --color=auto"
    alias egrep="egrep --color=auto"
    alias fgrep="fgrep --color=auto"
    alias cp="cp -i"
    alias df="df -h"
    alias more="less"
    alias ws="windscribe"
    alias kittyconf="vim ~/.config/kitty/kitty.conf"

    # Defer initialization of nvm until nvm, node or a node-dependent command is
    # run. Ensure this block is only run once if .bashrc gets sourced multiple times
    # by checking whether __init_nvm is a function.
    if [ -s "$HOME/.nvm/nvm.sh" ] && [ ! "$(type __init_nvm)" = function ]; then
    export NVM_DIR="$HOME/.nvm"
    [ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion"
    declare -a __node_commands=('nvm' 'node' 'npm' 'yarn' 'gulp' 'grunt' 'webpack')
    function __init_nvm() {
    for i in "${__node_commands[@]}"; do unalias $i; done
    . "$NVM_DIR"/nvm.sh
    unset __node_commands
    unset -f __init_nvm
    }
    for i in "${__node_commands[@]}"; do alias $i='__init_nvm && '$i; done
    fi

    if [ $commands[kubectl] ]; then
    kubectl() {
    # remove this function, subsequent calls will call kubectl directly
    unfunction "$0"
    source <(kubectl completion zsh)
    $0 "$@"
    }
    fi