about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2016-09-30T14·30-0400
committerWilliam Carroll <wpcarro@gmail.com>2016-09-30T14·30-0400
commit645cf364a3fcb7503b77317670dc486890b574ba (patch)
tree6befd621538823d71565ce94ec9b8d8e02fb6744
parent455c278c5c5c4bc3075df2f642a4624c18772458 (diff)
parente0055b21390da92894a03fa15d7b152f7133c480 (diff)
Merge branch 'master' of https://github.com/wpcarro/pc_settings
-rw-r--r--README.md4
-rw-r--r--configs/.tmux.conf10
-rw-r--r--configs/.zsh_profile6
-rw-r--r--functions/index.sh17
-rw-r--r--functions/vim_functions.sh3
-rw-r--r--install.sh5
-rwxr-xr-xinstall_brew.sh21
-rw-r--r--usbify/.DS_Storebin6148 -> 0 bytes
-rw-r--r--usbify/README.md11
-rwxr-xr-xusbify/update.sh44
-rw-r--r--usbify/vim/.vimrc128
-rwxr-xr-xusbify/vim/vim_point_to_usb.sh52
12 files changed, 59 insertions, 242 deletions
diff --git a/README.md b/README.md
index bfe0f8a3934b..eaf897c4d315 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
 I'm documenting this for personal use. Shell settings, vim settings, commonly used applications, et cetera...
 
 ### 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
diff --git a/configs/.tmux.conf b/configs/.tmux.conf
index 5ef3765e86ab..04b210c12f55 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 28e21f3ca40c..26da66d00ccb 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/index.sh b/functions/index.sh
index a60bc4167ce9..ae73bed38f54 100644
--- a/functions/index.sh
+++ b/functions/index.sh
@@ -1,4 +1,4 @@
-functon npms() {
+npms() {
   clear;
   npm start;
 }
@@ -19,7 +19,6 @@ source $HOME/pc_settings/functions/history_functions.sh
 # custom functions to work with vim
 source $HOME/pc_settings/functions/vim_functions.sh
 
-
 # generates placeholder content for FE work
 function lorem {
     text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
@@ -37,3 +36,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/functions/vim_functions.sh b/functions/vim_functions.sh
index 63e01b534b18..70aed74df9bd 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/install.sh b/install.sh
new file mode 100644
index 000000000000..302245f141e8
--- /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 000000000000..a86f1a1556db
--- /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/usbify/.DS_Store b/usbify/.DS_Store
deleted file mode 100644
index 10ebd8500a1c..000000000000
--- a/usbify/.DS_Store
+++ /dev/null
Binary files differdiff --git a/usbify/README.md b/usbify/README.md
deleted file mode 100644
index ea84b36bbb32..000000000000
--- 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 b17e1d0d021f..000000000000
--- 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 ce2a7c88726e..000000000000
--- a/usbify/vim/.vimrc
+++ /dev/null
@@ -1,128 +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'
-
-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 --
-
-
-" -- 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 <header> 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 <silent> <leader>h1 :execute 'match InterestingWord1 /\<<c-r><c-w>\>/'<CR>
-nnoremap <silent> <leader>xh1 :execute 'match none'<CR>
-
-" h2 highlighting
-nnoremap <silent> <leader>h2 :execute '2match InterestingWord2 /\<<c-r><c-w>\>/'<CR>
-nnoremap <silent> <leader>xh2 :execute '2match none'<CR>
-
-" h3 highlighting
-nnoremap <silent> <leader>h3 :execute '3match InterestingWord3 /\<<c-r><c-w>\>/'<CR>
-nnoremap <silent> <leader>xh3 :execute '3match none'<CR>
-
-"clear all highlighted groups
-nnoremap <silent> <leader>xhh :execute 'match none'<CR> :execute '2match none'<CR> :execute '3match none'<CR>
-
-
-" add 80 character wrap line
-highlight OverLength ctermbg=red ctermfg=white guibg=#592929
-match OverLength /\%81v.\+/
-
-
-" map jj to <Esc>
-imap jj <Esc>
-
-" map ctrl + n to :NERDTree
-map <C-n> :NERDTreeToggle<CR>
-
-
-" BOL and EOL
-nnoremap H ^
-nnoremap L $
-
-
-" set -o emacs line-editor defaults
-inoremap <C-a> <Esc>I
-inoremap <C-e> <Esc>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 = '<c-p>'
-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 7ea24fb0b787..000000000000
--- 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."
-