Browse Source

initial commit

remotes/remote_mirror_0048a893dc9c9faa373a1b34fba08204/master
Andrew Zah 1 year ago
commit
0dee046f1b
Signed by: Andrew Zah <zah@andrewzah.com> GPG Key ID: 0AE942445EB70FAA
14 changed files with 474 additions and 0 deletions
  1. 8
    0
      .curlrc
  2. 1
    0
      .gemrc
  3. 98
    0
      .gitconfig
  4. 1
    0
      .gitignore
  5. 127
    0
      .nvimrc
  6. 23
    0
      .wgetrc
  7. 17
    0
      .zshrc
  8. 6
    0
      zsh/aliases.zsh
  9. 11
    0
      zsh/colors.zsh
  10. 33
    0
      zsh/exports.zsh
  11. 81
    0
      zsh/functions.zsh
  12. 4
    0
      zsh/history.zsh
  13. 50
    0
      zsh/setopt.zsh
  14. 14
    0
      zsh/zsh-path.zsh

+ 8
- 0
.curlrc View File

@@ -0,0 +1,8 @@
1
+# Disguise as IE 9 on Windows 7.
2
+user-agent = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)"
3
+
4
+# When following a redirect, automatically set the previous URL as referer.
5
+referer = ";auto"
6
+
7
+# Wait 60 seconds before timing out.
8
+connect-timeout = 60

+ 1
- 0
.gemrc View File

@@ -0,0 +1 @@
1
+gem: --no-rdoc --no-ri

+ 98
- 0
.gitconfig View File

@@ -0,0 +1,98 @@
1
+[user]
2
+	email = zah@andrewzah.com
3
+	name = Andrew Zah
4
+  signingkey = 5EB70FAA
5
+[core]
6
+	editor = nvim
7
+        excludesfile = ~/.global_gitignore
8
+[alias]
9
+        aliases = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\ \t => \\2/' | sort
10
+
11
+        # pretty log 
12
+        lg = log --color --graph --pretty=format:'%Cred%h%Creset %C(yellow) %G? %Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
13
+        
14
+        # delete branch
15
+        brdel = branch -D
16
+        
17
+        # most modified files
18
+        churn = !git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort | awk 'BEGIN {print "count,file"} {print $1 "," $2}'
19
+         
20
+        # save repo as tarball
21
+        export = archive -o latest.tar.gz -9 --prefix=latest/
22
+        
23
+        # list of commit sha-1s
24
+        l = "!f() { git log $* | grep '^commit ' | cut -f 2 -d ' '; }; f"       
25
+        
26
+        # list all tags
27
+        tags = tag -l
28
+        
29
+        # checks that local refs are up to date before overwriting
30
+        please = push --force-with-lease
31
+
32
+        # see recent branches worked on
33
+        recent = for-each-ref --count=10 --sort=-committerdate refs/heads/ --format="%(refname:short)"
34
+
35
+        # see overview of commits
36
+        overview = log --all --oneline --no-merges
37
+
38
+        # recap your own commits on a project
39
+        recap = log --all --pretty=format:'%h %ad %s' --no-merges --author=<zah@andrewzah.com> --date=short
40
+        
41
+        # amend commit
42
+        commend = commit --amend --no-edit
43
+         
44
+        # merge no fast forward
45
+        merc = merge --no-ff
46
+         
47
+        # brief status
48
+        st = status --short --branch
49
+         
50
+        # stash only unstaged changes to tracked files
51
+        stsh = stash --keep-index
52
+        
53
+        # stash any changes to tracked files
54
+        staash = stash --include-untracked
55
+         
56
+        # stash ignored, untracked, and tracked files 
57
+        staaash = stash --all
58
+        
59
+        # initialize empty repo and commit
60
+        it = !git init && git commit -m \"root\" --allow-empty }
61
+[diff]
62
+    indentHeuristic = on
63
+[log]
64
+  date = relative
65
+[color]
66
+        ui = true
67
+[color "branch"]
68
+        current = yellow reverse
69
+        local = yellow
70
+        remote = green
71
+[color "diff"]
72
+        meta = yellow
73
+        frag = magenta
74
+        old = red 
75
+        new = green
76
+[color "status"]
77
+        added = yellow
78
+        changed = green
79
+        untracked = red
80
+[commit]
81
+        gpgsign = true
82
+
83
+# shorthand URLs
84
+[url "https://github.com/"]
85
+        insteadOf = gh:
86
+[url "git@github.com:"]
87
+        insteadOf = ghs:
88
+[url "https://gist.github.com/"]
89
+        insteadOf = gist:
90
+[url "https://gitlab.com/"]
91
+        insteadOf = gl:
92
+[url "git@gitlab.com:"]
93
+        insteadOf = gls:
94
+[url "git@github.com:"]
95
+	insteadOf = https://github.com/
96
+
97
+[init]
98
+        templatedir = ~/.config/git/templates/init

+ 1
- 0
.gitignore View File

@@ -0,0 +1 @@
1
+.DS_Store

+ 127
- 0
.nvimrc View File

@@ -0,0 +1,127 @@
1
+" Leader key
2
+let mapleader = ","
3
+
4
+" Load plugins
5
+execute pathogen#infect()
6
+" Gruvbo
7
+set background=dark
8
+" let g:gruvbox_italic = 1
9
+colorscheme gruvbox
10
+
11
+filetype plugin indent on
12
+runtime macros/matchit.vim
13
+
14
+inoremap jj <Esc>
15
+
16
+syntax enable 
17
+syntax on
18
+" set t_co=256
19
+set termguicolors
20
+
21
+" Fast Saving
22
+nmap <leader>w :w!<cr>
23
+
24
+" Fast Save+Quit
25
+nmap <leader>x :wq<cr>
26
+
27
+set scrolloff=3
28
+
29
+" Ctrl-P
30
+let g:ctrlp_map = '<c-p>'
31
+let g:ctrlp_cmd = 'CtrlP'
32
+let g:ctrlp_working_path_mode = 'ra'
33
+
34
+" oo/OO insert newline without entering INSERT
35
+" nmap oo o<Esc>k
36
+" nmap OO O<Esc>j
37
+
38
+" Line Numbers
39
+set number
40
+
41
+" Rainbow brackets/parens
42
+let g:rainbow_active = 1
43
+
44
+" 7 lines to the cursor when moving vertically using j/k
45
+" set so=7
46
+
47
+set backspace=eol,start,indent
48
+set whichwrap+=<,>,h,l
49
+
50
+set magic
51
+
52
+set showmatch
53
+set mat=2
54
+
55
+vmap <Tab> >gv
56
+vmap <S-Tab> <gv
57
+
58
+set tabstop=2
59
+set softtabstop=0
60
+set expandtab
61
+set shiftwidth=2
62
+set smarttab
63
+" set cursorline
64
+set hls is
65
+
66
+" clear search highlight
67
+" nnoremap <silent> <C-l><C-l> :nohl<CR><C-l>
68
+nnoremap <silent> <Leader>l :nohl<CR>
69
+
70
+" NerdTree
71
+map <F2> :NERDTreeToggle<CR>
72
+
73
+" Tabularize
74
+nmap <Leader>a= :Tabularize /=<CR>
75
+vmap <Leader>a= :Tabularize /=<CR>
76
+nmap <Leader>a: :Tabularize /:\zs<CR>
77
+vmap <Leader>a: :Tabularize /:\zs<CR>
78
+
79
+" Save 1 keystroke on vim splits
80
+nnoremap <C-J> <C-W><C-J>
81
+nnoremap <C-K> <C-W><C-K>
82
+nnoremap <C-L> <C-W><C-L>
83
+nnoremap <C-H> <C-W><C-H>
84
+
85
+" Allow mac copy/paste
86
+vmap <C-x> :!pbcopy<CR>  
87
+vmap <C-c> :w !pbcopy<CR><CR>
88
+
89
+" Autoset slang -> slim syntax highlighting
90
+au BufRead,BufNewFile *.slang set filetype=slim
91
+
92
+" Autoset ecr -> erb syntax highlighting
93
+au BufRead,BufNewFile *.ecr set filetype=erb
94
+
95
+" Session stuff
96
+nnoremap <leader>ss :call MakeSession()<cr>
97
+nnoremap <leader>sl :call LoadSession()<cr>
98
+
99
+set ssop-=options       " do not store options (vimrc) in a session
100
+"" Make and load method to save session per dir
101
+function! MakeSession()
102
+    let b:sessiondir = $HOME . "/.vim/sessions" . getcwd()
103
+    if (filewritable(b:sessiondir) != 2)
104
+        exe 'silent !mkdir -p ' b:sessiondir
105
+        redraw!
106
+    endif
107
+    let b:filename = b:sessiondir . '/session.vim'
108
+    exe "mksession! " . b:filename
109
+endfunction
110
+function! LoadSession()
111
+    let b:sessiondir = $HOME . "/.vim/sessions" . getcwd()
112
+    let b:sessionfile = b:sessiondir . "/session.vim"
113
+    if (filereadable(b:sessionfile))
114
+        exe 'source ' b:sessionfile
115
+    else
116
+        echo "No session loaded."
117
+    endif
118
+
119
+endfunction
120
+
121
+" Auto-commands 
122
+augroup autosourcing
123
+    if(argc() == 0)
124
+        "au VimEnter * nested :call LoadSession() " Uncomment to automatically load session
125
+        au VimLeave * :call MakeSession()
126
+    endif
127
+augroup END

+ 23
- 0
.wgetrc View File

@@ -0,0 +1,23 @@
1
+# Follow FTP links from HTML documents by default
2
+follow_ftp = on
3
+
4
+# Do not go up in the directory structure when downloading recursively
5
+no_parent = on
6
+
7
+# Wait 60 seconds before timing out. This applies to all timeouts: DNS, connect and read. (The default read timeout is 15 minutes!)
8
+timeout = 60
9
+
10
+# Retry a few times when a download fails, but don’t overdo it. (The default is 20!)
11
+tries = 3
12
+
13
+# Use the server-provided last modification date, if available
14
+timestamping = on
15
+
16
+# Add a `.html` extension to `text/html` or `application/xhtml+xml` files that lack one, or a `.css` extension to `text/css` files that lack one
17
+adjust_extension = on
18
+
19
+# Ignore `robots.txt` and `<meta name=robots content=nofollow>`
20
+robots = off
21
+
22
+# Disguise as IE 9 on Windows 7
23
+user_agent = Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)

+ 17
- 0
.zshrc View File

@@ -0,0 +1,17 @@
1
+source ~/.zsh/zsh-path.zsh
2
+source ~/.zsh/colors.zsh
3
+source ~/.zsh/setopt.zsh
4
+source ~/.zsh/exports.zsh
5
+source ~/.zsh/aliases.zsh
6
+source ~/.zsh/functions.zsh
7
+source ~/.zsh/history.zsh
8
+source ~/.zsh/secret-exports.zsh
9
+
10
+ZSH_THEME="theunraveler"
11
+
12
+plugins=(git lein brew ruby wd)
13
+
14
+source $ZSH/oh-my-zsh.sh
15
+source $ZSH/plugins/zsh-up/up.plugin.zsh
16
+source $ZSH/plugins/zsh-colored-man-pages/colored-man-pages_mod.plugin.zsh
17
+source $ZSH/plugins/fast-syntax-highlighting/fast-syntax-highlighting.plugin.zsh

+ 6
- 0
zsh/aliases.zsh View File

@@ -0,0 +1,6 @@
1
+alias ls='ls -GFhl'
2
+alias ll='ls -GFH'
3
+
4
+alias pubkey="more ~/.ssh/id_rsa.pub | pbcopy | echo '=> Public key copied to pasteboard.'"
5
+
6
+alias git=hub

+ 11
- 0
zsh/colors.zsh View File

@@ -0,0 +1,11 @@
1
+# The variables are wrapped in \%\{\%\}. This should be the case for every
2
+# variable that does not contain space.
3
+for COLOR in RED GREEN YELLOW BLUE MAGENTA CYAN BLACK WHITE; do
4
+  eval PR_$COLOR='%{$fg_no_bold[${(L)COLOR}]%}'
5
+  eval PR_BOLD_$COLOR='%{$fg_bold[${(L)COLOR}]%}'
6
+done
7
+
8
+eval RESET='$reset_color'
9
+export PR_RED PR_GREEN PR_YELLOW PR_BLUE PR_WHITE PR_BLACK PR_MAGENTA
10
+export PR_BOLD_RED PR_BOLD_GREEN PR_BOLD_YELLOW PR_BOLD_BLUE PR_BOLD_MAGENTA
11
+export PR_BOLD_WHITE PR_BOLD_BLACK

+ 33
- 0
zsh/exports.zsh View File

@@ -0,0 +1,33 @@
1
+# PATH
2
+export PATH=/usr/local/bin:$PATH~/bin:/usr/local/sbin:~/bin
3
+
4
+# ZSH 
5
+export ZSH=/Users/andrew/.oh-my-zsh
6
+export UPDATE_ZSH_DAYS=1
7
+
8
+# If you come from bash you might have to change your $PATH.
9
+# export PATH=$HOME/bin:/usr/local/bin:$PATH
10
+
11
+# Custom
12
+########
13
+
14
+export TERM=xterm-256color
15
+
16
+export GREP_OPTIONS='--color=auto'
17
+export GREP_COLOR='3;33'
18
+
19
+# This resolves issues install the mysql, postgres, and other gems with native non universal binary extensions
20
+export ARCHFLAGS='-arch x86_64'
21
+
22
+# export MANPATH="/usr/local/man:$MANPATH"
23
+export GPG_TTY=$(tty)
24
+
25
+# You may need to manually set your language environment
26
+export LANG=en_US.UTF-8
27
+
28
+# Preferred editor for local and remote sessions
29
+if [[ -n $SSH_CONNECTION ]]; then
30
+ export EDITOR='nvim'
31
+else
32
+ export EDITOR='nvim'
33
+fi

+ 81
- 0
zsh/functions.zsh View File

@@ -0,0 +1,81 @@
1
+function extract {
2
+  echo Extracting $1 ...
3
+  if [ -f $1 ] ; then
4
+      case $1 in
5
+          *.tar.bz2)   tar xjf $1  ;;
6
+          *.tar.gz)    tar xzf $1  ;;
7
+          *.bz2)       bunzip2 $1  ;;
8
+          *.rar)       unrar x $1    ;;
9
+          *.gz)        gunzip $1   ;;
10
+          *.tar)       tar xf $1   ;;
11
+          *.tbz2)      tar xjf $1  ;;
12
+          *.tgz)       tar xzf $1  ;;
13
+          *.zip)       unzip $1   ;;
14
+          *.Z)         uncompress $1  ;;
15
+          *.7z)        7z x $1  ;;
16
+          *)        echo "'$1' cannot be extracted via extract()" ;;
17
+      esac
18
+  else
19
+      echo "'$1' is not a valid file"
20
+  fi
21
+}
22
+
23
+function trash () {
24
+  local path
25
+  for path in "$@"; do
26
+    # ignore any arguments
27
+    if [[ "$path" = -* ]]; then :
28
+    else
29
+      local dst=${path##*/}
30
+      # append the time if necessary
31
+      while [ -e ~/.Trash/"$dst" ]; do
32
+        dst="$dst "$(date +%H-%M-%S)
33
+      done
34
+      /bin/mv "$path" ~/.Trash/"$dst"
35
+    fi
36
+  done
37
+}
38
+
39
+function mkd() {
40
+	mkdir -p "$@";
41
+}
42
+
43
+# mkdir -p && cd shorthand
44
+function mkdc() {
45
+	mkdir -p "$@" && cd "$_";
46
+}
47
+# `o` with no arguments opens the current directory, otherwise opens the given
48
+# location
49
+function o() {
50
+	if [ $# -eq 0 ]; then
51
+		open .;
52
+	else
53
+		open "$@";
54
+	fi;
55
+}
56
+
57
+# `v` with no arguments opens the current directory in Vim, otherwise opens the
58
+# given location
59
+function v() {
60
+	if [ $# -eq 0 ]; then
61
+		nvim .;
62
+	else
63
+		nvim "$@";
64
+	fi;
65
+}
66
+
67
+
68
+# transfer.sh alias
69
+transfer() { if [ $# -eq 0 ]; then echo -e "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi 
70
+tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile ; fi; cat $tmpfile; cat $tmpfile | pbcopy; rm -f $tmpfile; } 
71
+
72
+# `tre` is a shorthand for `tree` with hidden files and color enabled, ignoring
73
+# the `.git` directory, listing directories first. The output gets piped into
74
+# `less` with options to preserve color and line numbers, unless the output is
75
+# small enough for one screen.
76
+function tre() {
77
+	tree -aC -I '.git|node_modules|bower_components' --dirsfirst "$@"
78
+}
79
+
80
+# SOURCES
81
+# https://github.com/mathiasbynens/dotfiles/blob/master/.functions

+ 4
- 0
zsh/history.zsh View File

@@ -0,0 +1,4 @@
1
+# HISTORY
2
+HISTSIZE=20000
3
+SAVEHIST=20000
4
+HISTFILE=~/.zsh/zsh_history

+ 50
- 0
zsh/setopt.zsh View File

@@ -0,0 +1,50 @@
1
+# ===== Basics
2
+
3
+# If you type foo, and it isn't a command, and it is a directory in your cdpath, go there
4
+setopt AUTO_CD
5
+
6
+# Allow comments even in interactive shells (especially for Muness)
7
+# setopt INTERACTIVE_COMMENTS
8
+
9
+# ===== History
10
+
11
+HISTFILE=~/.zsh_history
12
+HISTSIZE=20000
13
+SAVEHIST=20000
14
+
15
+# Allow multiple terminal sessions to all append to one zsh command history
16
+setopt APPEND_HISTORY 
17
+
18
+# Add comamnds as they are typed, don't wait until shell exit
19
+setopt INC_APPEND_HISTORY 
20
+
21
+# Do not write events to history that are duplicates of previous events
22
+# setopt HIST_IGNORE_DUPS
23
+
24
+# When searching history don't display results already cycled through twice
25
+setopt HIST_FIND_NO_DUPS
26
+
27
+# Remove extra blanks from each command line being added to history
28
+setopt HIST_REDUCE_BLANKS
29
+
30
+# Include more information about when the command was executed, etc
31
+setopt EXTENDED_HISTORY
32
+
33
+# remove command line from history list when first character on the line is a space
34
+setopt hist_ignore_space 
35
+
36
+# ===== Completion 
37
+
38
+# Allow completion from within a word/phrase
39
+setopt COMPLETE_IN_WORD 
40
+
41
+# When completing from the middle of a word, move the cursor to the end of the word
42
+setopt ALWAYS_TO_END            
43
+
44
+# ===== Prompt
45
+
46
+# Enable parameter expansion, command substitution, and arithmetic expansion in the prompt
47
+setopt PROMPT_SUBST
48
+
49
+unsetopt MENU_COMPLETE
50
+setopt AUTO_MENU

+ 14
- 0
zsh/zsh-path.zsh View File

@@ -0,0 +1,14 @@
1
+# Mac OS X uses path_helper and /etc/paths.d to preload PATH, clear it out first
2
+if [ -x /usr/libexec/path_helper ]; then
3
+    PATH=''
4
+    eval `/usr/libexec/path_helper -s`
5
+fi
6
+
7
+# if rbenv is present, configure it for use
8
+if which rbenv &> /dev/null; then
9
+    # Put the rbenv entry at the front of the line
10
+    export PATH="$HOME/.rbenv/bin:$PATH"
11
+
12
+    # enable shims and auto-completion
13
+    eval "$(rbenv init -)"
14
+fi

Loading…
Cancel
Save