then PS4=$'%D{%M%S%.} %N:%i> ' exec 3>&2 2>$HOME/tmp/startlog.$$ setopt xtrace prompt_subst fi # Your zshrc here… if [[ "$PROFILE_STARTUP" == true ]]; then unsetopt xtrace exec 2>&3 3>&- fi
smiling_face=$'\U1F60A' local frowning_face=$'\U1F914' local smiley="%(?,%{%F{green}%}${smiling_face}%{%f%},${frowning_face}%{%F{red}%}%{%f%})" PROMPT='%m %B%F{red}::%f%b %B%F{green}%3~%f%b ${smiley}%{$reset_color%} %B%F{blue}%(0!.#.»)%b%f ' RPROMPT='' if type pretty-git-prompt > /dev/null; then RPROMPT='$(pretty-git-prompt)' fi # Put rbenv version info on the right side, if rbenv is available if type rbenv > /dev/null; then RPROMPT="%F{white}\$(rbenv version-name)%f $RPROMPT"; fi
`ls` with `exa`, if it's available if type exa > /dev/null then alias ls='exa --color=auto' alias la='exa --color=auto --all --group' alias lla='exa --color=auto --all --group --long' alias lt='exa --color=auto --all --group --tree --level=2' alias l='exa --color=auto --group --long' else alias ls='ls -hFbC' alias la='ls -hFA' alias lla='ls -lhFA' alias lt='echo This command requires exa installed' alias l='ls -lhFbC' fi
so they're expaned even inside commands alias -g ...='../..' alias -g ....='../../..' alias -g .....='../../../..' alias -g ......='../../../../..' alias -g .......='../../../../../..' # Aliases '-' to 'cd -' alias -- -='cd -'
proj=$(ls ~/Projects | selecta) if [[ -n "$proj" ]]; then cd ~/Projects/$proj fi } # Switch work function w() { local work=$(ls ~/Work | selecta) if [[ -n "$work" ]]; then cd ~/Work/$work fi } # Edit a note function n() { # Need to use -L, since Notes and Research are usually symlinked into some sort of syncing service local note=$(find -L ~/Notes ~/Research | selecta) if [[ -n "$note" ]]; then (cd ~/Notes && vi "$note") fi }
relative line numbers set numberwidth=5 " How many columns to use for the line number augroup relativenumbers autocmd! " Show absolute line numbers in insert mode, relative line numbers otherwise autocmd InsertEnter * :set norelativenumber autocmd InsertLeave * :set relativenumber augroup END
showmatch " Show matching brackets set incsearch " ... dynamically as they are typed " make /-style searches case-sensitive only if " there is a capital letter in the search expression set ignorecase set smartcase
" modified flag set statusline+=\ %2*%m " help buffer flag set statusline+=\ %1*%h " Fugtive status set statusline+=%#warningmsg# set statusline+=%{fugitive#statusline()} set statusline+=%* " Readonly flag set statusline+=%r " Switch to right side set statusline+=%= set statusline+=[ " File encoding set statusline+=%{&encoding} " File format set statusline+=\ %{&fileformat} " Detected file type set statusline+=\ %{strlen(&filetype)?&filetype:'none'} set statusline+=] " Position in file set statusline+=\ %12.(%c:%l/%L%)