From 31ddb38d6a670e0fa1dc9a4f49f6f17158d5b118 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 1 Aug 2016 13:29:45 -0400 Subject: [PATCH 1/6] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 97db3db33..3813c8717 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ I'm documenting this for personal use. Shell settings, vim settings, commonly us * migrate Google Chrome bookmarks to new machine ### Commonly used applications -* homebrew - `key-repeat: 50ms delay-until-repeat: 300ms` necessary for procuring shell applications -* karabiner - increase your Mac's key repeat settings beyond the default range +* homebrew - necessary for procuring shell applications +* karabiner - `key-repeat: 50ms delay-until-repeat: 300ms` increase your Mac's key repeat settings beyond the default range * spectacle - resize and move your windows with keyboard shortcuts * iterm - substitute for Terminal application * oh my zsh - z-shell for Mac From 792c690e0d2908f5b4d83c03fb413b2c80975ab0 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 1 Aug 2016 13:35:05 -0400 Subject: [PATCH 2/6] Adds script to batch install brew packages --- install_brew_packages.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 install_brew_packages.sh diff --git a/install_brew_packages.sh b/install_brew_packages.sh new file mode 100755 index 000000000..050ff655f --- /dev/null +++ b/install_brew_packages.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +pushd "$HOME/pc_settings" + +# install brew dependencies +cat ./brew_packages.txt | xargs brew install + +popd + From 3306754932caa6436ec51fe8d508eb6de75aaf1e Mon Sep 17 00:00:00 2001 From: William Carroll Date: Mon, 1 Aug 2016 14:01:51 -0400 Subject: [PATCH 3/6] Adds brew to PATH and adds is_online function --- .bash_profile | 26 +++++++++++++++----------- .misc_functions.sh | 13 ------------- .w_functions.sh | 18 ++++++++++++++++-- install.sh | 5 +++++ install_brew.sh | 21 +++++++++++++++++++++ install_brew_packages.sh | 9 --------- 6 files changed, 57 insertions(+), 35 deletions(-) delete mode 100644 .misc_functions.sh create mode 100644 install.sh create mode 100755 install_brew.sh delete mode 100755 install_brew_packages.sh diff --git a/.bash_profile b/.bash_profile index b72e72584..cf03d3a6f 100644 --- a/.bash_profile +++ b/.bash_profile @@ -1,17 +1,21 @@ -# bash profile settings for William Carroll +export PATH=$HOME/bin:/usr/local/bin:/opt/local/bin:/opt/local/sbin:$PATH -# welcome message -echo "Hello, welcome back, William" -# change bash prompt -PS1='$ ' +echo "Welcome back, $USER" -# input mode to Vi +# use vi bindings for terminal input set -o vi -# shortcuts -alias h="history" -alias vi="vim" -alias c="clear" +# aliases +source $HOME/pc_settings/.w_aliases.sh + +# functions +source $HOME/pc_settings/.w_functions.sh + +# run cmatrix command for 3 seconds before exiting +#. $HOME/pc_settings/.matrix_intro.sh + +# syntax highlighting for CLI; if not installed, run the following command +# brew install zsh-syntax-highlighting +source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh -export EDITOR=/usr/bin/vim diff --git a/.misc_functions.sh b/.misc_functions.sh deleted file mode 100644 index e775c2a89..000000000 --- a/.misc_functions.sh +++ /dev/null @@ -1,13 +0,0 @@ -# download files to /tmp directory -function wdownload { - URL="$1" - FILENAME="$(basename $URL)" - - wget -O /tmp/"$FILENAME" $URL >/dev/null && open /tmp && echo "Downloaded to: /tmp/$FILENAME" || echo "Error ..." -} - -# spell checker -function wspcheck { - if [ $# -ge 1 -a -f "$1" ] && input="$1" || input="-" - cat "$input" | tr '[:upper:]' '[:lower:]' | tr -cd '[:alpha:]_ \n' | tr -s ' ' '\n' | sort | comm -23 - ~/english_words.txt -} diff --git a/.w_functions.sh b/.w_functions.sh index e1a76bd3f..071289e46 100644 --- a/.w_functions.sh +++ b/.w_functions.sh @@ -1,4 +1,4 @@ -functon npms() { +npms() { clear; npm start; } @@ -10,7 +10,7 @@ source $HOME/pc_settings/.js_to_bash.sh source $HOME/pc_settings/.git_functions.sh # custom bash helpers functions -source $HOME/pc_settings/.misc_functions.sh +# source $HOME/pc_settings/.misc_functions.sh # generates placeholder content for FE work function lorem { @@ -29,3 +29,17 @@ function wsearchpath { echo $PATH | tr ':' '\n' | xargs -I {} find {} -type f -perm +111 -maxdepth 1 -name "*${1}*" -print | xargs basename } + +# tests an internet connection +function is_online { + wget -q --spider "http://google.com" + + if [ $? -eq 0 ]; then + echo "Online" + return 0 + else + echo "Offline" + return 1 + fi +} + diff --git a/install.sh b/install.sh new file mode 100644 index 000000000..302245f14 --- /dev/null +++ b/install.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +# install brew and its packages +. ./install_brew.sh + diff --git a/install_brew.sh b/install_brew.sh new file mode 100755 index 000000000..a86f1a155 --- /dev/null +++ b/install_brew.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +echo "Installing Homebrew..." +$(which ruby) -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)" +$(which ruby) -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +echo "Homebrew installed." +echo "" + +pushd "$HOME/pc_settings" + +# install brew dependencies +echo "Installing Homebrew packages..." +cat ./brew_packages.txt | xargs brew install +echo "Homebrew packages installed." +echo "" + +echo "Homebrew installed complete!" +echo "" + +popd + diff --git a/install_brew_packages.sh b/install_brew_packages.sh deleted file mode 100755 index 050ff655f..000000000 --- a/install_brew_packages.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash - -pushd "$HOME/pc_settings" - -# install brew dependencies -cat ./brew_packages.txt | xargs brew install - -popd - From 342e7dbcd9fb6954be127b43a7850e4513ef8304 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Tue, 23 Aug 2016 14:12:30 -0400 Subject: [PATCH 4/6] Removes zsh related items --- .bash_profile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.bash_profile b/.bash_profile index cf03d3a6f..28e20bb64 100644 --- a/.bash_profile +++ b/.bash_profile @@ -12,10 +12,6 @@ source $HOME/pc_settings/.w_aliases.sh # functions source $HOME/pc_settings/.w_functions.sh -# run cmatrix command for 3 seconds before exiting -#. $HOME/pc_settings/.matrix_intro.sh - # syntax highlighting for CLI; if not installed, run the following command # brew install zsh-syntax-highlighting -source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh From 63b282709308bf04b58ffbccd6849254eed3133d Mon Sep 17 00:00:00 2001 From: William Carroll Date: Wed, 24 Aug 2016 10:01:35 -0400 Subject: [PATCH 5/6] Updates local machine settings --- configs/.tmux.conf | 10 ++++++++++ configs/.zsh_profile | 6 ++++-- functions/vim_functions.sh | 3 ++- usbify/vim/.vimrc | 10 ++++++++++ 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/configs/.tmux.conf b/configs/.tmux.conf index 5ef3765e8..04b210c12 100644 --- a/configs/.tmux.conf +++ b/configs/.tmux.conf @@ -1,7 +1,17 @@ set -g default-terminal "screen-256color" +set -g mouse on bind-key -r -T prefix k select-pane -U bind-key -r -T prefix j select-pane -D bind-key -r -T prefix h select-pane -L bind-key -r -T prefix l select-pane -R +bind-key -r -T prefix C-k resize-p -U 2 +bind-key -r -T prefix C-j resize-p -D 2 +bind-key -r -T prefix C-h resize-p -L 2 +bind-key -r -T prefix C-l resize-p -R 2 + +bind % split-window -c "#{pane_current_path}" +bind '"' split-window -h -c "#{pane_current_path}" +bind c new-window -c "#{pane_current_path}" + diff --git a/configs/.zsh_profile b/configs/.zsh_profile index 28e21f3ca..26da66d00 100644 --- a/configs/.zsh_profile +++ b/configs/.zsh_profile @@ -1,10 +1,13 @@ -export PATH=$HOME/bin:/opt/local/bin:/opt/local/sbin:/usr/local/go/bin:$PATH +export PATH=$HOME/bin:/opt/local/bin:/opt/local/sbin:/usr/local/go/bin:/usr/local/sbin:$PATH # make vim the default editor for commit messages etc export EDITOR=$(which vim) echo "Welcome back, $USER" +# display the space available on each mounted Volume +df -hl + # use vi bindings for terminal input set -o vi @@ -14,7 +17,6 @@ source $HOME/pc_settings/aliases.sh # functions source $HOME/pc_settings/functions/index.sh - # setup keybindings for history functions source $HOME/pc_settings/scripts/setup_keybindings.sh diff --git a/functions/vim_functions.sh b/functions/vim_functions.sh index 63e01b534..70aed74df 100644 --- a/functions/vim_functions.sh +++ b/functions/vim_functions.sh @@ -21,7 +21,8 @@ function vfzopen() { if [ ! -z "$filename" ]; then - vim "$filename" + echo "$filename" + vim +/"$search_query" "$filename" return 0 else return 1 diff --git a/usbify/vim/.vimrc b/usbify/vim/.vimrc index ce2a7c887..1a1cbaa65 100644 --- a/usbify/vim/.vimrc +++ b/usbify/vim/.vimrc @@ -23,6 +23,7 @@ Plugin 'scrooloose/syntastic' Plugin 'scrooloose/nerdtree' Plugin 'mileszs/ack.vim' Plugin 'sjl/clam.vim' +Plugin 'kien/ctrlp.vim' call vundle#end() " required filetype plugin indent on " required @@ -40,6 +41,15 @@ filetype plugin indent on " required " -- END: Vundle config -- +" backspace settings +set backspace=2 +set backspace=indent,eol,start + + +" keyword completion +inoremap ;; + + " -- Syntastic Settings -- set statusline+=%#warningmsg# set statusline+=%{SyntasticStatuslineFlag()} From e0055b21390da92894a03fa15d7b152f7133c480 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Wed, 24 Aug 2016 10:37:10 -0400 Subject: [PATCH 6/6] Removes usbify dir --- usbify/.DS_Store | Bin 6148 -> 0 bytes usbify/README.md | 11 --- usbify/update.sh | 44 ----------- usbify/vim/.vimrc | 138 --------------------------------- usbify/vim/vim_point_to_usb.sh | 52 ------------- 5 files changed, 245 deletions(-) delete mode 100644 usbify/.DS_Store delete mode 100644 usbify/README.md delete mode 100755 usbify/update.sh delete mode 100644 usbify/vim/.vimrc delete mode 100755 usbify/vim/vim_point_to_usb.sh diff --git a/usbify/.DS_Store b/usbify/.DS_Store deleted file mode 100644 index 10ebd8500a1c85fea4ffd27109f1d75ea554ec71..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKL2KJE6qb@~v+ELkXra&*bYBix7nUAP+Fr(>0hjc!j?Bhl5qNU3orDqsK8*c= z{fzy9{eX>j`wKg7?ceBol2Tf-UAHjw;OTpMdhf~pWF(6aLVM%nDIq=~!~sRDxzPMZ za2$0>YQ}>|u|{zgr&$c0?f7gd+B#N|0bIK}nGiwV#nZd%mx`inw|~%Dz474TBgb9y z*1e|ZuQ$Es>u{7!!!jzzMK8*S{^L+2JdW}ck(8rjE)P>a;qoYd8I?SLg~7*JmO_BG zqj(_rbm(vFXR?fh18CN3~o zY1HY2s+pmVnVFg!3RSa%pQ&&{1C6$|3|I#4Gf>xEAJ6~8Ki~iFC)u85z%uY(F+dv! z;Xw~x$(*fAFNbF>1APOEf^n6`+Y~U=Q4Fzo6mNkl0Y5_nFfdqY1P_S)5l}SP#xn3% G8Mpz;NN?8w diff --git a/usbify/README.md b/usbify/README.md deleted file mode 100644 index ea84b36bb..000000000 --- a/usbify/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# USBify - -This folder contains packages to make applications USB portable. - -## vim -Run the `vim_to_usb.sh` script to point your $HOME/.vim folder to an external USB - -* vim_to_usb.sh -* .vimrc -* .vim - diff --git a/usbify/update.sh b/usbify/update.sh deleted file mode 100755 index b17e1d0d0..000000000 --- a/usbify/update.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash - -# This script is used to ensure the USB has the latest code from the repository. - -# Update the following values to reflect the locations of each directory on your -# particular machine. -path_to_local_repo="$HOME/pc_settings" # path to git repo -path_to_ext_device="/Volumes/usb_vim/" # path to USB device - -if [ ! -d "$path_to_ext_device" ]; then - echo "No external device found at ${path_to_ext_device}." - echo "Make sure the values input within update.sh are correct." - echo "path_to_ext_device: $path_to_ext_device" - echo "Exiting." - return 1 -fi - -if [ ! -d "$path_to_local_repo" ]; then - echo "No repository found at ${path_to_local_repo}." - echo "Make sure the values input within update.sh are correct." - echo "path_to_local_repo: $path_to_local_repo" - echo "Exiting." - return 1 -fi - -pushd "$path_to_ext_device" >/dev/null - -# Update the local copy of the repo. -echo "Updating pc_settings..." -pushd "$path_to_local_repo" >/dev/null -git pull origin master -echo "" - -echo "Copying files to external device..." -popd # $(pwd) -eq $path_to_ext_device -# copy the vim contents from $HOME/pc_settings into $path_to_ext_device -rm -rf ./vim -cp -r "${path_to_local_repo}/usbify/vim" . -echo "" - -popd # restore the dirs to its state before running this script - -echo "Done." - diff --git a/usbify/vim/.vimrc b/usbify/vim/.vimrc deleted file mode 100644 index 1a1cbaa65..000000000 --- a/usbify/vim/.vimrc +++ /dev/null @@ -1,138 +0,0 @@ -" -- BEGIN: Vundle config -- -set nocompatible " be iMproved, required -filetype off " required - -" set the runtime path to include Vundle and initialize -set rtp+=~/.vim/bundle/Vundle.vim -call vundle#begin() -" alternatively, pass a path where Vundle should install plugins -"call vundle#begin('~/some/path/here') - -" let Vundle manage Vundle, required -Plugin 'VundleVim/Vundle.vim' - -" The following are examples of different formats supported. -" Keep Plugin commands between vundle#begin/end. -" plugin on GitHub repo -Plugin 'tpope/vim-fugitive' - -" All of your Plugins must be added before the following line -Plugin 'othree/yajs.vim' -Plugin 'crusoexia/vim-monokai' -Plugin 'scrooloose/syntastic' -Plugin 'scrooloose/nerdtree' -Plugin 'mileszs/ack.vim' -Plugin 'sjl/clam.vim' -Plugin 'kien/ctrlp.vim' - -call vundle#end() " required -filetype plugin indent on " required -" To ignore plugin indent changes, instead use: -"filetype plugin on -" -" Brief help -" :PluginList - lists configured plugins -" :PluginInstall - installs plugins; append `!` to update or just :PluginUpdate -" :PluginSearch foo - searches for foo; append `!` to refresh local cache -" :PluginClean - confirms removal of unused plugins; append `!` to auto-approve removal -" -" see :h vundle for more details or wiki for FAQ -" Put your non-Plugin stuff after this line -" -- END: Vundle config -- - - -" backspace settings -set backspace=2 -set backspace=indent,eol,start - - -" keyword completion -inoremap ;; - - -" -- Syntastic Settings -- -set statusline+=%#warningmsg# -set statusline+=%{SyntasticStatuslineFlag()} -set statusline+=%* - -let g:syntastic_always_populate_loc_list = 1 -let g:syntastic_auto_loc_list = 1 -let g:syntastic_check_on_open = 1 -let g:syntastic_check_on_wq = 1 -let g:syntastic_javascript_checkers = ['gjslint'] - - -" Basic settings -syntax on -set number -set tabstop=2 -set expandtab -set shiftwidth=2 -colorscheme monokai -set t_Co=255 - - -" Ensure that
is "," character -let mapleader = "," - - -" Define highlighting groups -highlight InterestingWord1 ctermbg=Cyan ctermfg=Black -highlight InterestingWord2 ctermbg=Yellow ctermfg=Black -highlight InterestingWord3 ctermbg=Magenta ctermfg=Black - - -" h1 highlighting -nnoremap h1 :execute 'match InterestingWord1 /\<\>/' -nnoremap xh1 :execute 'match none' - -" h2 highlighting -nnoremap h2 :execute '2match InterestingWord2 /\<\>/' -nnoremap xh2 :execute '2match none' - -" h3 highlighting -nnoremap h3 :execute '3match InterestingWord3 /\<\>/' -nnoremap xh3 :execute '3match none' - -"clear all highlighted groups -nnoremap xhh :execute 'match none' :execute '2match none' :execute '3match none' - - -" add 80 character wrap line -highlight OverLength ctermbg=red ctermfg=white guibg=#592929 -match OverLength /\%81v.\+/ - - -" map jj to -imap jj - -" map ctrl + n to :NERDTree -map :NERDTreeToggle - - -" BOL and EOL -nnoremap H ^ -nnoremap L $ - - -" set -o emacs line-editor defaults -inoremap I -inoremap A - - -" trim trailing whitespace on save -autocmd BufWritePre *.{js,py,tpl,html} :%s/\s\+$//e - - -" set default font and size -set guifont=Operator\ Mono:h16 - - -" -- fuzzy-finder -- -set runtimepath^=~/.vim/bundle/ctrlp.vim -let g:ctrlp_map = '' -let g:ctrlp_cmd = 'CtrlP' -let g:ctrlp_custom_ignore = { - \ 'dir': 'node_modules' - \ } - diff --git a/usbify/vim/vim_point_to_usb.sh b/usbify/vim/vim_point_to_usb.sh deleted file mode 100755 index 7ea24fb0b..000000000 --- a/usbify/vim/vim_point_to_usb.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env bash - -path_to_ext_device="/Volumes/usb_vim" - - -# ensure there is an external device connected and that the path to it is -# accurate. -if [ ! -d "$path_to_ext_device" ]; then - echo "No external device found at: $path_to_ext_device" - echo "Ensure that the value set for path_to_ext_device is correct." - echo "path_to_ext_device: $path_to_ext_device" - echo "Exiting." - return 1 -fi - - - -# This script toggles between local vim and a version that can be stored on an -# external device like a USB. - -# USB --> local machine -if [ -L "$HOME/.vim" ] && [ -L "$HOME/.vimrc" ]; then - echo "Pointing to USB. Toggling back to local machine..." - - # remove the symlinks - rm "$HOME/.vim" - rm "$HOME/.vimrc" - - # restore back-ups as active files - [ -d "$HOME/.vim.bak" ] && mv "$HOME/.vim.bak" "$HOME/.vim" - [ -f "$HOME/.vimrc.bak" ] && mv "$HOME/.vimrc.bak" "$HOME/.vimrc" - - echo ".vim now points to $HOME/.vim" - echo ".vimrc now points to $HOME/.vimrc" - -# local machine --> USB -else - echo "Pointing to local machine. Toggling to USB..." - - # back-up local machine's files - [ -d "$HOME/.vim" ] && mv "$HOME/.vim" "$HOME/.vim.bak" - [ -f "$HOME/.vimrc" ] && mv "$HOME/.vimrc" "$HOME/.vimrc.bak" - - # symlink .vim and .vimrc to external device - ln -s "${path_to_ext_device}/vim/.vim" "$HOME/.vim" - ln -s "${path_to_ext_device}/vim/.vimrc" "$HOME/.vimrc" - - echo ".vim now points to ${path_to_ext_device}/vim/.vim" -fi - -echo "Done." -