Skip to content

Instantly share code, notes, and snippets.

@mohnasir-gh
Created November 10, 2023 08:13

Revisions

  1. mohnasir-gh created this gist Nov 10, 2023.
    153 changes: 153 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,153 @@
    # If you come from bash you might have to change your $PATH.
    # export PATH=$HOME/bin:/usr/local/bin:$PATH
    export PATH=/Users/mohnasir/.local/bin:$PATH
    # Path to your oh-my-zsh installation.
    export ZSH="$HOME/.oh-my-zsh"
    export NODE_OPTIONS=--max_old_space_size=8192
    export PATH="/usr/local/opt/python/libexec/bin:$PATH"
    KEYTIMEOUT=1

    # Set name of the theme to load --- if set to "random", it will
    # load a random theme each time oh-my-zsh is loaded, in which case,
    # to know which specific one was loaded, run: echo $RANDOM_THEME
    # See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
    ZSH_THEME="agnoster"

    # Set list of themes to pick from when loading at random
    # Setting this variable when ZSH_THEME=random will cause zsh to load
    # a theme from this variable instead of looking in $ZSH/themes/
    # If set to an empty array, this variable will have no effect.
    ZSH_THEME_RANDOM_CANDIDATES=( "robbyrussell" "agnoster" )

    # Uncomment the following line to use case-sensitive completion.
    # CASE_SENSITIVE="true"

    # Uncomment the following line to use hyphen-insensitive completion.
    # Case-sensitive completion must be off. _ and - will be interchangeable.
    # HYPHEN_INSENSITIVE="true"

    # Uncomment one of the following lines to change the auto-update behavior
    # zstyle ':omz:update' mode disabled # disable automatic updates
    # zstyle ':omz:update' mode auto # update automatically without asking
    zstyle ':omz:update' mode reminder # just remind me to update when it's time

    # Uncomment the following line to change how often to auto-update (in days).
    zstyle ':omz:update' frequency 13

    # Uncomment the following line if pasting URLs and other text is messed up.
    # DISABLE_MAGIC_FUNCTIONS="true"

    # Uncomment the following line to disable colors in ls.
    # DISABLE_LS_COLORS="true"

    # Uncomment the following line to disable auto-setting terminal title.
    # DISABLE_AUTO_TITLE="true"

    # Uncomment the following line to enable command auto-correction.
    ENABLE_CORRECTION="true"

    # Uncomment the following line to display red dots whilst waiting for completion.
    # You can also set it to another string to have that shown instead of the default red dots.
    # e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
    # Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
    # COMPLETION_WAITING_DOTS="true"

    # Uncomment the following line if you want to disable marking untracked files
    # under VCS as dirty. This makes repository status check for large repositories
    # much, much faster.
    # DISABLE_UNTRACKED_FILES_DIRTY="true"

    # Uncomment the following line if you want to change the command execution time
    # stamp shown in the history command output.
    # You can set one of the optional three formats:
    # "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
    # or set a custom format using the strftime function format specifications,
    # see 'man strftime' for details.
    # HIST_STAMPS="mm/dd/yyyy"

    # Would you like to use another custom folder than $ZSH/custom?
    # ZSH_CUSTOM=/path/to/new-custom-folder

    # Which plugins would you like to load?
    # Standard plugins can be found in $ZSH/plugins/
    # Custom plugins may be added to $ZSH_CUSTOM/plugins/
    # Example format: plugins=(rails git textmate ruby lighthouse)
    # Add wisely, as too many plugins slow down shell startup.
    plugins=(git zsh-autosuggestions zsh-syntax-highlighting docker zsh-vi-mode z dirhistory macos zsh-history-substring-search)

    # zsh-autosuggestions
    # ZSH_AUTOSUGGEST_STRATEGY=(completion)

    source $ZSH/oh-my-zsh.sh
    DEFAULT_USER="dev"
    # User configuration

    # export MANPATH="/usr/local/man:$MANPATH"

    # You may need to manually set your language environment
    # export LANG=en_US.UTF-8

    # Preferred editor for local and remote sessions
    # if [[ -n $SSH_CONNECTION ]]; then
    # export EDITOR='vim'
    # else
    # export EDITOR='mvim'
    # fi

    # Compilation flags
    # export ARCHFLAGS="-arch x86_64"

    # Set personal aliases, overriding those provided by oh-my-zsh libs,
    # plugins, and themes. Aliases can be placed here, though oh-my-zsh
    # users are encouraged to define aliases within the ZSH_CUSTOM folder.
    # For a full list of active aliases, run `alias`.
    #
    # Example aliases
    alias zshconfig="nvim ~/.zshrc"
    alias nvimconfig="code ~/.config/nvim/init.lua"
    alias startcypress="nx run cx-portal-e2e:e2e:dev"
    alias viconfig="code ~/.config/nvim/init.vim"
    alias viconf="nvim ~/.config/nvim/init.vim"
    alias cls="clear"
    alias home="cd ~"
    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
    export DEFAULT_USER="$(whoami)"


    # Load Angular CLI autocompletion.
    source <(ng completion script)

    ## Load zsh-vi-mode plugin
    # source $(brew --prefix)/opt/zsh-vi-mode/share/zsh-vi-mode/zsh-vi-mode.plugin.zsh
    #

    bindkey '^[[A' history-substring-search-up
    bindkey '^[[B' history-substring-search-down

    bindkey -M vicmd 'k' history-substring-search-up
    bindkey -M vicmd 'j' history-substring-search-down

    alias vi="nvim"

    # alias nvim-lazy="NVIM_APPNAME=LazyVim nvim"
    # alias nvim-chad="NVIM_APPNAME=NvChad nvim"
    # alias nvim-astro="NVIM_APPNAME=AstroNvim nvim"
    alias nvim-kickstart="NVIM_APPNAME=kickstartj nvim"
    alias nvim-kickstarterik="NVIM_APPNAME=kickstarterik nvim"

    function nvims() {
    items=("default" "kickstartj" "kickstarterik")
    config=$(printf "%s\n" "${items[@]}" | fzf --prompt=" Neovim Config  " --height=~50% --layout=reverse --border --exit-0)
    if [[ -z $config ]]; then
    echo "Nothing selected"
    return 0
    elif [[ $config == "default" ]]; then
    config=""
    else
    alias vi="NVIM_APPNAME=${config} nvim"
    fi
    NVIM_APPNAME=$config nvim $@
    }