Browse Source

Vimrc Tabstop, bashrc aliases

neuraflash
Cornejo, Brandon 9 years ago
parent
commit
1655be55b4
  1. 117
      bashrc
  2. 14
      vimrc

117
bashrc

@ -1,18 +1,15 @@
# Add home-dir bin for random scripts etc
export PATH=$HOME/bin:$PATH export PATH=$HOME/bin:$PATH
# Vi keybindings or bust
export EDITOR=vim export EDITOR=vim
set -o vi set -o vi
# If not running interactively, don't do anything # If not running interactively, don't do anything
[ -z "$PS1" ] && return [ -z "$PS1" ] && return
export HISTCONTROL='ignoreboth'
export HISTFILESIZE=2000000
export HISTIGNORE='&:ls:exit'
shopt -s histappend
set cmdhist
#export HISTCONTROL='ignoreboth'
#export HISTFILESIZE=2000000
#export HISTIGNORE='&:ls:exit'
#shopt -s histappend
#set cmdhist
# shopt -s checkwinsize # shopt -s checkwinsize
[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"
@ -25,10 +22,9 @@ fi
case "$TERM" in case "$TERM" in
xterm-color) color_prompt=yes;; xterm-color) color_prompt=yes;;
esac esac
# Get our git stuff (TODO: Add to dotfiles install.sh)
source ~/dotfiles/git-completion.sh
source ~/dotfiles/git-prompt.sh
# Get our git stuff
source ~/.git-completion.sh
source ~/.git-prompt.sh
force_color_prompt=yes force_color_prompt=yes
@ -36,15 +32,15 @@ force_color_prompt=yes
BGREEN='\[\033[1;32m\]' BGREEN='\[\033[1;32m\]'
GREEN='\[\033[0;32m\]' GREEN='\[\033[0;32m\]'
BRED='\[\033[1;31m\]' BRED='\[\033[1;31m\]'
BPURPLE='\e[1;36m'
PURPLE='\e[0;36m'
RED='\[\033[0;31m\]' RED='\[\033[0;31m\]'
CYAN='\[\033[0;36m\]'
LCYAN='\[\033[1;36m\]'
BBLUE='\[\033[1;34m\]' BBLUE='\[\033[1;34m\]'
BLUE='\[\033[0;34m\]' BLUE='\[\033[0;34m\]'
BYELLOW='\[\033[1;33m'
YELLOW='\[\033[0;33m'
BMAGENTA='\[\033[1;35M'
MAGENTA='\[\033[0;35M'
BCYAN='\[\033[1;36m'
CYAN='\[\033[0;36m'
GREY='\[033[0;37m\]'
DGREY='\[033[1;30m\]'
NORMAL='\[\033[00m\]' NORMAL='\[\033[00m\]'
# Prompt vars # Prompt vars
@ -65,7 +61,8 @@ if [ -n "$force_color_prompt" ]; then
fi fi
if [ "$color_prompt" = yes ]; then if [ "$color_prompt" = yes ]; then
PS1="${BLUE}(${GREEN}${CWD}${BLUE}) ${NORMAL}${USER}@${HOST}${BRED}${GIT}${GREEN} ${PUID}${NORMAL} "
#PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]-=[\u@\h]=-\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
PS1="${BLUE}(${GREEN}${CWD}${BLUE}) ${NORMAL}${HOST}${BRED}${GIT}${NORMAL} [$?${NORMAL}]${GREEN} ${PUID}${NORMAL} "
else else
PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
fi fi
@ -81,6 +78,7 @@ case "$TERM" in xterm*|rxvt*)
if [ -x /usr/bin/dircolors ]; then if [ -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls -X --color=auto' alias ls='ls -X --color=auto'
#alias dir='dir --color=auto' alias vdir='vdir --color=auto'
alias grep='grep --color=auto' alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto' alias fgrep='fgrep --color=auto'
@ -93,8 +91,23 @@ alias la='ls -A'
alias l='ls -CF' alias l='ls -CF'
#mah aliases, son #mah aliases, son
alias atr0phy='ssh br4n@binary.atr0phy.net'
alias atr0phy='ssh br4n@atr0phy.net'
alias at0rphy='ssh -L 9050:127.0.0.1:9050 br4n@atr0phy.net'
alias evoluent='xinput --set-button-map 12 3 1 1 4 5 7 8 9 0 10 11'
alias cloudme='cd ~/Code/django-cloud/corvisacloud && source ~/Code/django-cloud/bin/activate'
alias paybackme='cd ~/Code/payback && source ~/Code/payback/bin/activate'
alias pb='python -m payback'
alias wallaceme='cd ~/Code/wallace-io/ && node server.js -e ~/Code/wallace-sites -b redis'
alias zeusme='cd ~/Code/zeus2 && source ~/Code/zeus2/bin/activate && ./start_zeus.sh'
alias cls='clear && ls -X --color=auto' alias cls='clear && ls -X --color=auto'
alias ack="~/bin/ack"
alias ackpy="~/bin/ack -r --python --ignore-dir migrations"
alias pbtest="py.test -v -c conf/pytest-integration.ini"
alias pbtestdbg="py.test -sv -c conf/pytest-integration.ini"
alias pbdroptestdb="su postgres -c 'dropdb test_payback'"
alias notes="vim ~/Documents/Notes.txt"
alias pgwatch="tail -f /var/log/postgresql/postgresql-9.4-main.log | ccze -A"
alias postman="/opt/google/chrome/google-chrome \"--profile-directory=Profile 1\" --app-id=fhbjgbiflinjbdggehcddcbncdddomop"
# Add an "alert" alias for long running commands. Use like so: # Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert # sleep 10; alert
@ -103,3 +116,67 @@ alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion . /etc/bash_completion
fi fi
# add this configuration to ~/.bashrc
export HH_CONFIG=hicolor # get more colors
shopt -s histappend # append new history items to .bash_history
export HISTCONTROL=ignorespace # leading space hides commands from history
export HISTFILESIZE=10000 # increase history file size (default is 500)
export HISTSIZE=${HISTFILESIZE} # increase history size (default is 500)
export PROMPT_COMMAND="history -a; history -n; ${PROMPT_COMMAND}" # mem/file sync
# if this is interactive shell, then bind hh to Ctrl-r
bind '"\C-r": "hh\n"'
export NVM_DIR="/home/brandon.cornejo/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm
# Clipboard jazz
# A shortcut function that simplifies usage of xclip.
# - Accepts input from either stdin (pipe), or params.
# ------------------------------------------------
cb() {
local _scs_col="\e[0;32m"; local _wrn_col='\e[1;31m'; local _trn_col='\e[0;33m'
# Check that xclip is installed.
if ! type xclip > /dev/null 2>&1; then
echo -e "$_wrn_col""You must have the 'xclip' program installed.\e[0m"
# Check user is not root (root doesn't have access to user xorg server)
elif [[ "$USER" == "root" ]]; then
echo -e "$_wrn_col""Must be regular user (not root) to copy a file to the clipboard.\e[0m"
else
# If no tty, data should be available on stdin
if ! [[ "$( tty )" == /dev/* ]]; then
input="$(< /dev/stdin)"
# Else, fetch input from params
else
input="$*"
fi
if [ -z "$input" ]; then # If no input, print usage message.
echo "Copies a string to the clipboard."
echo "Usage: cb <string>"
echo " echo <string> | cb"
else
# Copy input to clipboard
echo -n "$input" | xclip -selection c
# Truncate text for status
if [ ${#input} -gt 80 ]; then input="$(echo $input | cut -c1-80)$_trn_col...\e[0m"; fi
# Print status.
echo -e "$_scs_col""Copied to clipboard:\e[0m $input"
fi
fi
}
# Aliases / functions leveraging the cb() function
# ------------------------------------------------
# Copy contents of a file
function cbf() { cat "$1" | cb; }
# Copy SSH public key
alias cbssh="cbf ~/.ssh/id_rsa.pub"
# Copy current working directory
alias cbwd="pwd | cb"
# Copy most recent command in bash history
alias cbhs="cat $HISTFILE | tail -n 1 | cb"
# ASCII ART GOODNESS
echo -e "$(<~/.motd)"

14
vimrc

@ -43,7 +43,7 @@ endif
set display+=lastline set display+=lastline
" spaces not tabs, etc " spaces not tabs, etc
set tabstop=8
set tabstop=4
set softtabstop=4 set softtabstop=4
set shiftwidth=4 set shiftwidth=4
set expandtab set expandtab
@ -84,6 +84,8 @@ Plugin 'ervandew/supertab.git'
Plugin 'myusuf3/numbers.vim.git' Plugin 'myusuf3/numbers.vim.git'
Plugin 'majutsushi/tagbar.git' Plugin 'majutsushi/tagbar.git'
Plugin 'nvie/vim-flake8.git' Plugin 'nvie/vim-flake8.git'
Plugin 'kien/rainbow_parentheses.vim.git'
Plugin 'hynek/vim-python-pep8-indent'
call vundle#end() call vundle#end()
filetype plugin indent on filetype plugin indent on
@ -109,9 +111,19 @@ colorscheme distinguished
" force django templates to use html syntax " force django templates to use html syntax
au BufNewFile,BufRead *.djhtml set filetype=html au BufNewFile,BufRead *.djhtml set filetype=html
au BufNewFile,BufRead *.raml set filetype=yaml
" sudo save " sudo save
cmap w!! w !sudo tee % >/dev/null cmap w!! w !sudo tee % >/dev/null
" Let's try some mouse stuff " Let's try some mouse stuff
set mouse=a set mouse=a
" Mark the 80th column. PEP8 yo
set colorcolumn=80
" rainbow parens
au VimEnter * RainbowParenthesesToggle
au Syntax * RainbowParenthesesLoadRound
au Syntax * RainbowParenthesesLoadSquare
au Syntax * RainbowParenthesesLoadBraces
Loading…
Cancel
Save