Skip to content

Instantly share code, notes, and snippets.

@dunvi
Last active October 12, 2018 19:36
Show Gist options
  • Save dunvi/ed1ee4925ce96c2f451b to your computer and use it in GitHub Desktop.
Save dunvi/ed1ee4925ce96c2f451b to your computer and use it in GitHub Desktop.
configs!
""" syntax and colors
syntax on
set t_Co=256
colorscheme pablo
set cursorline
highlight CursorLine cterm=NONE ctermbg=235
""" vim settings, not vi
set nocompatible
set hidden
set mouse=a
set ttymouse=xterm2
"""reload changed files
set autoread
""" the command window at the bottom
set laststatus=2
set ruler
set showcmd
set showmode
set noerrorbells
set visualbell
set t_vb=
""" tabbing behavior
set autoindent
set smartindent
set smarttab
set shiftwidth=4
set softtabstop=4
set expandtab
set backspace=2
set showmatch
""" display stuff
set list
set listchars=trail:~
set listchars=tab:>-
set number
set scrolloff=8
set sidescrolloff=8
set sidescroll=1
set nowrap
set textwidth=0
""" search options
set incsearch
set wrapscan
set nohls
set ignorecase
""" tab completion!
""" set wildmenu
""" set wildmode=list:longest,full
set path=$PWD/**
########
# .zshrc
#
########
# PROMPT
# Colors
fg_bold_red="$(print '%{\e[1;31m%}')"
fg_bold_green="$(print '%{\e[1;32m%}')"
fg_green="$(print '%{\e[32m%}')"
fg_bold_mag="$(print '%{\e[1;35m%}')"
fg_mag="$(print '%{\e[35m%}')"
fg_cyan="$(print '%{\e[36m%}')"
fg_normal="$(print '%{\e[0m%}')"
c_cyan='\e[36m'
c_mag='\e[35m'
c_bold_mag='\e[1;35m'
c_green='\e[32m'
c_normal='\e[0m'
# Prompt
PS1=" %(!.${fg_bold_red}.${fg_bold_green})%n${fg_normal}@${fg_bold_mag}%B%m%b ${fg_cyan}[%6d]${fg_normal}
(%!) %#> "
alias parse_git_branch="git branch 2>/dev/null | grep '*' | sed -e 's/* \(.*\)/ [\1]/g'"
alias wsgb="git branch 2>/dev/null | grep '*' | sed -e 's/* //g'"
export RPROMPT="${fg_cyan}$(parse_git_branch)${fg_bold_green}(%*)${fg_normal}"
}
HISTSIZE=5000
setopt inc_append_history
#setopt share_history <-- FUCK THIS OPTION I DONT LIKE YOU
unsetopt share_history # JUST TO BE SURE
export HISTIGNORE='&:ls:[bf]g:exit:reset:clear:cd:cd ..:cd..'
export VISUAL=vim
export EDITOR=$VISUAL
# Turn off the infuriating beeping noises
setopt nobeep
# Make symbolic paths resolve
setopt chaselinks
# Protect files from being overwritten
setopt noclobber
# don't spellcheck my commands pls
unsetopt correct # disabling this because it irritates me
# Have zsh tell you when background jobs finish
setopt notify
# watch for other logins
watch=(notme)
LOGCHECK=60
WATCHFMT='%n %a %l from %m at %t'
# safetyyyy
setopt RM_STAR_WAIT
########
# SETTING ALIASES
if [[ "$(uname)" == "Darwin" ]]; then
alias ls='ls -alFG'
else
alias ls='ls -alF --color=auto'
fi
alias grep="grep --color=auto"
alias cd..='cd ..'
alias less="less -nRi"
functionn cdls () {
cd $1
ls
}
alias graph="git log --graph --oneline --decorrate --date=relative --all"
########
# KEY BINDINGS - adjust as needed
# set ctrl+arrows
bindkey '^[[1;5C' emacs-forward-word
bindkey '^[[1;5D' emacs-backward-word
# putty ctrl+arrows
bindkey '^[OC' emacs-forward-word
bindkey '^[OD' emacs-backward-word
# ??? dunno where these ones came from
bindkey '^[OH' beginning-of-line
bindkey '^[OF' end-of-line
# set del/home/end on putty
bindkey '^[[3~' delete-char
bindkey '^[[H' beginning-of-line
bindkey '^[[F' end-of-line
########
# COMPLETION
# Load the zsh completion system
# Keeping separate .zcompdump files is necessary
# for working around some issues with zsh
autoload -U compinit
compinit -d ~/.zcompdump_`uname -s`
setopt COMPLETE_IN_WORD
" untested - don't know if this will work or do anything useful
" but it's what's left after stripping out all vim settings from my vi xD
syntax on
colorscheme pablo
set autoindent
set ignorecase
set list
set noerrorbells
set number
set showmatch
set showmode
set shiftwidth=4
set wrapscan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment