about summary refs log tree commit diff
path: root/usbify
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2016-08-01T19·30-0400
committerWilliam Carroll <wpcarro@gmail.com>2016-08-01T19·30-0400
commit4e5f3f8846b400a0b9458e6aff4b862b927a657a (patch)
treeb562aa9b3bf89640e19e9749e173456b1670ba6b /usbify
parent9b714a32bb2e0db67525ed0756c766ccd0d14d6f (diff)
Adds files to make vim USB-portable
Diffstat (limited to 'usbify')
-rw-r--r--usbify/.DS_Storebin0 -> 6148 bytes
-rw-r--r--usbify/README.md11
-rw-r--r--usbify/vim/.DS_Storebin0 -> 6148 bytes
-rw-r--r--usbify/vim/.vim/.DS_Storebin0 -> 6148 bytes
-rw-r--r--usbify/vim/.vim/.netrwhist11
l---------usbify/vim/.vim/.vim1
m---------usbify/vim/.vim/bundle/L90
m---------usbify/vim/.vim/bundle/Vundle.vim0
m---------usbify/vim/.vim/bundle/command-t0
m---------usbify/vim/.vim/bundle/ctrlp.vim0
m---------usbify/vim/.vim/bundle/nerdtree0
m---------usbify/vim/.vim/bundle/newL90
m---------usbify/vim/.vim/bundle/sparkup0
m---------usbify/vim/.vim/bundle/syntastic0
m---------usbify/vim/.vim/bundle/vim-fugitive0
m---------usbify/vim/.vim/bundle/vim-monokai0
m---------usbify/vim/.vim/bundle/yajs.vim0
-rw-r--r--usbify/vim/.vim/ftdetect/soy.vim1
-rw-r--r--usbify/vim/.vim/gjslint.vim46
-rw-r--r--usbify/vim/.vim/syntax/soy.vim145
-rw-r--r--usbify/vim/.vimrc89
-rwxr-xr-xusbify/vim/vim_point_to_usb.sh36
22 files changed, 340 insertions, 0 deletions
diff --git a/usbify/.DS_Store b/usbify/.DS_Store
new file mode 100644
index 000000000000..10ebd8500a1c
--- /dev/null
+++ b/usbify/.DS_Store
Binary files differdiff --git a/usbify/README.md b/usbify/README.md
new file mode 100644
index 000000000000..4486c5984acc
--- /dev/null
+++ b/usbify/README.md
@@ -0,0 +1,11 @@
+# USBify
+
+This folder contains packages to make applications into 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/vim/.DS_Store b/usbify/vim/.DS_Store
new file mode 100644
index 000000000000..d30ee2020845
--- /dev/null
+++ b/usbify/vim/.DS_Store
Binary files differdiff --git a/usbify/vim/.vim/.DS_Store b/usbify/vim/.vim/.DS_Store
new file mode 100644
index 000000000000..5008ddfcf53c
--- /dev/null
+++ b/usbify/vim/.vim/.DS_Store
Binary files differdiff --git a/usbify/vim/.vim/.netrwhist b/usbify/vim/.vim/.netrwhist
new file mode 100644
index 000000000000..75884b1b5e65
--- /dev/null
+++ b/usbify/vim/.vim/.netrwhist
@@ -0,0 +1,11 @@
+let g:netrw_dirhistmax  =10
+let g:netrw_dirhist_cnt =9
+let g:netrw_dirhist_1='/Users/wcarroll/huge/projects/google/cerebro/static/js'
+let g:netrw_dirhist_2='/Users/wcarroll/huge/projects/google/cerebro/static'
+let g:netrw_dirhist_3='/Users/wcarroll/huge/projects/google/cerebro'
+let g:netrw_dirhist_4='/Users/wcarroll'
+let g:netrw_dirhist_5='/Users'
+let g:netrw_dirhist_6='/'
+let g:netrw_dirhist_7='/Users/wcarroll/huge/projects/google/cerebro'
+let g:netrw_dirhist_8='/Users/wcarroll'
+let g:netrw_dirhist_9='/Users/wcarroll/huge/projects/google/cerebro'
diff --git a/usbify/vim/.vim/.vim b/usbify/vim/.vim/.vim
new file mode 120000
index 000000000000..500cab06d653
--- /dev/null
+++ b/usbify/vim/.vim/.vim
@@ -0,0 +1 @@
+/Users/wcarroll/.vim
\ No newline at end of file
diff --git a/usbify/vim/.vim/bundle/L9 b/usbify/vim/.vim/bundle/L9
new file mode 160000
+Subproject c822b05ee0886f9a9703227dc85a6d47612c4bf
diff --git a/usbify/vim/.vim/bundle/Vundle.vim b/usbify/vim/.vim/bundle/Vundle.vim
new file mode 160000
+Subproject 4984767509e3d05ca051e253c8a8b37de784be4
diff --git a/usbify/vim/.vim/bundle/command-t b/usbify/vim/.vim/bundle/command-t
new file mode 160000
+Subproject 354c429dad34f7d163663943c948f819588b53d
diff --git a/usbify/vim/.vim/bundle/ctrlp.vim b/usbify/vim/.vim/bundle/ctrlp.vim
new file mode 160000
+Subproject b9fa920b4abbb54799927a3bc57869fdd556321
diff --git a/usbify/vim/.vim/bundle/nerdtree b/usbify/vim/.vim/bundle/nerdtree
new file mode 160000
+Subproject 2e2b649232d6ae4d02d74793e5da0ee08480ad8
diff --git a/usbify/vim/.vim/bundle/newL9 b/usbify/vim/.vim/bundle/newL9
new file mode 160000
+Subproject a78607c9f63f270137e472126ee1b2c3ae52a84
diff --git a/usbify/vim/.vim/bundle/sparkup b/usbify/vim/.vim/bundle/sparkup
new file mode 160000
+Subproject d400a570bf64b0c216aa7c8e1795820b911a740
diff --git a/usbify/vim/.vim/bundle/syntastic b/usbify/vim/.vim/bundle/syntastic
new file mode 160000
+Subproject 6014bdc57f161f5ae5140e4247b144ae149bf89
diff --git a/usbify/vim/.vim/bundle/vim-fugitive b/usbify/vim/.vim/bundle/vim-fugitive
new file mode 160000
+Subproject c00ebd75ac23f4080c0d0bf9453b16304a3fb31
diff --git a/usbify/vim/.vim/bundle/vim-monokai b/usbify/vim/.vim/bundle/vim-monokai
new file mode 160000
+Subproject e5d4bfb5dab8c4f122b97fe9c3ed2f2d1e8b3bd
diff --git a/usbify/vim/.vim/bundle/yajs.vim b/usbify/vim/.vim/bundle/yajs.vim
new file mode 160000
+Subproject 5cb4b369cac5b29dd7f2e688b23a2b57263972a
diff --git a/usbify/vim/.vim/ftdetect/soy.vim b/usbify/vim/.vim/ftdetect/soy.vim
new file mode 100644
index 000000000000..7c9420b0ef47
--- /dev/null
+++ b/usbify/vim/.vim/ftdetect/soy.vim
@@ -0,0 +1 @@
+au BufRead,BufNewFile *.soy set filetype=soy
diff --git a/usbify/vim/.vim/gjslint.vim b/usbify/vim/.vim/gjslint.vim
new file mode 100644
index 000000000000..336890553d5e
--- /dev/null
+++ b/usbify/vim/.vim/gjslint.vim
@@ -0,0 +1,46 @@
+"============================================================================
+"File:        gjslint.vim
+"Description: Javascript syntax checker - using gjslint
+"Maintainer:  Martin Grenfell <martin.grenfell at gmail dot com>
+"License:     This program is free software. It comes without any warranty,
+"             to the extent permitted by applicable law. You can redistribute
+"             it and/or modify it under the terms of the Do What The Fuck You
+"             Want To Public License, Version 2, as published by Sam Hocevar.
+"             See http://sam.zoy.org/wtfpl/COPYING for more details.
+"============================================================================
+
+if exists('g:loaded_syntastic_javascript_gjslint_checker')
+    finish
+endif
+let g:loaded_syntastic_javascript_gjslint_checker = 1
+
+let s:save_cpo = &cpo
+set cpo&vim
+
+function! SyntaxCheckers_javascript_gjslint_GetLocList() dict
+    call syntastic#log#deprecationWarn('javascript_gjslint_conf', 'javascript_gjslint_args')
+
+    let makeprg = self.makeprgBuild({
+        \ 'args': '--nodebug_indentation',
+        \ 'args_after': '--check_html --nosummary --unix_mode --nobeep' })
+
+    let errorformat =
+        \ "%f:%l:(New Error -%\\?\%n) %m," .
+        \ "%f:%l:(-%\\?%n) %m," .
+        \ "%-G1 files checked," .
+        \ " no errors found.," .
+        \ "%-G%.%#"
+
+    return SyntasticMake({
+        \ 'makeprg': makeprg,
+        \ 'errorformat': errorformat })
+endfunction
+
+call g:SyntasticRegistry.CreateAndRegisterChecker({
+    \ 'filetype': 'javascript',
+    \ 'name': 'gjslint'})
+
+let &cpo = s:save_cpo
+unlet s:save_cpo
+
+" vim: set sw=4 sts=4 et fdm=marker:
diff --git a/usbify/vim/.vim/syntax/soy.vim b/usbify/vim/.vim/syntax/soy.vim
new file mode 100644
index 000000000000..8b25b622be59
--- /dev/null
+++ b/usbify/vim/.vim/syntax/soy.vim
@@ -0,0 +1,145 @@
+" Google Closure templates syntax file.
+" Language: Soy
+" Maintainer: Dugan Chen (https://github.com/duganchen)
+"
+if exists("b:current_syntax")
+	finish
+endif
+
+if version < 600
+  syntax clear
+elseif exists("b:current_syntax")
+  finish
+endif
+
+syntax clear
+syntax case match
+
+syntax keyword soyConstant contained null
+syntax keyword soyConstant contained false
+syntax keyword soyConstant contained true
+
+syntax keyword soyFunction contained isFirst
+syntax keyword soyFunction contained isLast
+syntax keyword soyFunction contained index
+syntax keyword soyFunction contained hasData
+syntax keyword soyFunction contained length
+syntax keyword soyFunction contained round
+syntax keyword soyFunction contained floor
+syntax keyword soyFunction contained ceiling
+syntax keyword soyFunction contained min
+syntax keyword soyFunction contained max
+syntax keyword soyFunction contained randomInt
+syntax keyword soyFunction contained bidiGlobalDir
+syntax keyword soyFunction contained bidiDirAttr
+syntax keyword soyFunction contained bidiMark
+syntax keyword soyFunction contained bidiMarkAfter
+syntax keyword soyFunction contained bidiStartEdge
+syntax keyword soyFunction contained bidiEndEdge
+syntax keyword soyFunction contained bidiTextDir
+
+syntax keyword soyStatement contained namespace
+syntax keyword soyStatement contained template
+syntax keyword soyStatement contained delpackage
+syntax keyword soyStatement contained deltemplate
+
+syntax keyword soyKeyword contained literal
+syntax keyword soyKeyword contained print
+syntax keyword soyKeyword contained msg
+syntax keyword soyKeyword contained call
+syntax keyword soyKeyword contained delcall
+syntax keyword soyKeyword contained param
+syntax keyword soyKeyword contained let
+syntax keyword soyKeyword contained css
+
+syntax keyword soyConditional contained if
+syntax keyword soyConditional contained elseif
+syntax keyword soyConditional contained else
+syntax keyword soyConditional contained switch
+syntax keyword soyConditional contained case
+syntax keyword soyConditional contained default
+syntax keyword soyConditional contained ifempty
+
+syntax keyword soyRepeat contained foreach
+syntax keyword soyRepeat contained for
+syntax keyword soyRepeat contained in
+syntax keyword soyRepeat contained range
+
+syntax keyword soyCharacter contained sp
+syntax keyword soyCharacter contained nil
+syntax keyword soyCharacter contained r
+syntax keyword soyCharacter contained n
+syntax keyword soyCharacter contained t
+syntax keyword soyCharacter contained lb
+syntax keyword soyCharacter contained rb
+
+syntax keyword soyDirective contained private
+syntax keyword soyDirective contained autoescape
+syntax keyword soyDirective contained noAutoescape
+syntax keyword soyDirective contained id
+syntax keyword soyDirective contained escapeCssString
+syntax keyword soyDirective contained escapeHtml
+syntax keyword soyDirective contained escapeHtmlRcdata
+syntax keyword soyDirective contained escapeHtmlAttribute
+syntax keyword soyDirective contained escapeHtmlAttributeNospace
+syntax keyword soyDirective contained escapeUri
+syntax keyword soyDirective contained escapeJs
+syntax keyword soyDirective contained escapeJsRegex
+syntax keyword soyDirective contained escapeJsString
+syntax keyword soyDirective contained escapeJsValue
+syntax keyword soyDirective contained truncate
+syntax keyword soyDirective contained insertWordBreaks
+syntax keyword soyDirective contained changeNewlineToBr
+syntax keyword soyDirective contained desc
+syntax keyword soyDirective contained meaning
+syntax keyword soyDirective contained data
+syntax keyword soyDirective contained kind
+syntax keyword soyDirective contained variant
+syntax keyword soyDirective contained bidiSpanWrap
+syntax keyword soyDirective contained bidiUnicodeWrap
+
+syntax match soySpecialComment /@param?\?/ contained
+
+syntax region soyCommand start="{" end="}" contains=soyKeyword, soyDirective, soyIdentifier, soyString, soyTemplate, soyConstant, soyInteger, soyCharacter, soyFloat, soySci, soyOperator, soyFunction, soyRepeat, soyConditional, soyStatement, soyLabel
+
+syntax region soyString contained start="\'" end="\'"
+syntax region soyString contained start="\"" end="\""
+
+syntax match soyIdentifier /\$[a-zA-Z0-9._]*\>/ contained
+syntax region soyComment start=/\/\*/ end='\\*\/' contains=soySpecialComment
+
+syntax match soyComment /\/\/.*$/
+syntax match soyTemplate /\s\+\.\w\+\>/ contained
+
+syntax match soyInteger /\-\?\(0x\)\?[A-F0-9]\+\>/ contained
+
+syntax match soyNumber /\-\?\d\+\(e\-\?\d\+\)\?\>/ contained
+
+syntax match soyFloat /\-\?\d\+\.\d\+\>/ contained
+syntax match soySci /\-\?\d\+e\-\?\d\+\>/ contained
+
+syntax match soyOperator /\<\(not\|and\|or\)\>/ contained
+
+syntax match soyLabel /\<\w\+:/ contained
+
+" Yes, this causes the - in -1 to show as an operator. This is a bug.
+syntax match soyOperator /[-*/%+<>=!?:]/ contained
+
+highlight def link soyOperator Operator
+highlight def link soyKeyword Statement
+highlight def link soyDirective Type
+highlight def link soyIdentifier Identifier
+highlight def link soyString String
+highlight def link soyComment Comment
+highlight def link soyTemplate Identifier
+highlight def link soyInteger Number
+highlight def link soyFloat Float
+highlight def link soySci Float
+highlight def link soyConstant Constant
+highlight def link soyCharacter Character
+highlight def link soyFunction Function
+highlight def link soyRepeat Repeat
+highlight def link soyConditional Conditional
+highlight def link soyStatement Statement
+highlight def link soySpecialComment SpecialComment
+highlight def link soyLabel Identifier
diff --git a/usbify/vim/.vimrc b/usbify/vim/.vimrc
new file mode 100644
index 000000000000..dd720b76bdb1
--- /dev/null
+++ b/usbify/vim/.vimrc
@@ -0,0 +1,89 @@
+" -- 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'
+
+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']
+
+
+syntax on
+set number
+set tabstop=2
+set expandtab
+set shiftwidth=2
+colorscheme monokai
+set t_Co=255
+
+
+" 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>
+
+
+
+" 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
new file mode 100755
index 000000000000..db86e93a4399
--- /dev/null
+++ b/usbify/vim/vim_point_to_usb.sh
@@ -0,0 +1,36 @@
+#!/usr/bin/env bash
+
+# This script points the .vim directory to a USB to increase portability
+# it will toggle between modes
+
+if [ -L "$HOME/.vim" ]; then
+  echo "Already pointing to USB. Toggling back..."
+
+  # remove the symlink and .vimrc
+  rm "$HOME/.vim"
+
+  # remove the USB's version of the .vimrc and use the backed-up copy
+  rm "$HOME/.vimrc"
+  mv "$HOME/.vimrc.bak" "$HOME/.vimrc"
+
+  # rename the .vim.bak directory
+  mv "$HOME/.vim.bak" "$HOME/.vim"
+
+  echo ".vim now points to $HOME/.vim"
+else
+  echo "Not pointing to USB. Getting to work..."
+
+  # rename the current .vim directory and .vimrc
+  mv "$HOME/.vim" "$HOME/.vim.bak"
+  mv "$HOME/.vimrc" "$HOME/.vimrc.bak"
+
+  # point the $HOME/.vim name to the USB for source routing
+  # use the USB drive's copy of .vimrc
+  ln -s /Volumes/Untitled\ 1/.vim "$HOME/.vim"
+  cp /Volumes/Untitled\ 1/.vimrc "$HOME/"
+
+  echo ".vim now points to /Volumes/Untitled\ 1/.vim"
+fi
+
+echo "Done."
+