├── .aliases
├── .bash_profile
├── .bash_prompt
├── .bashrc
├── .dircolors
├── .exports
├── .functions
├── .gitconfig
├── .gitignore
├── .inputrc
├── .screenrc
├── Brewfile
├── README.md
├── assets
├── 1.png
└── 2.png
├── colorls
├── colorls_colors.yaml
├── colorls_files.yaml
├── dark_colors.yaml
├── file_aliases.yaml
├── files.yaml
├── folder_aliases.yaml
├── folders.yaml
└── light_colors.yaml
├── fish
├── .gitignore
├── bundle
├── channel
├── completions
│ ├── fisher.fish
│ └── nvm.fish
├── fish_variables
├── fishfile
├── functions
│ ├── fisher.fish
│ └── fundle.fish
├── install
├── setup
│ ├── fish-install.sh
│ ├── fish-setup.old.sh
│ ├── fisher.sh
│ ├── install
│ ├── omf.sh
│ └── update.sh
└── theme
├── git
├── gitconfig
└── gitignore
├── install.sh
├── install_shell.sh
├── iterm
├── iterm-profile.json
└── themes
│ └── default.itermcolors
├── mac
├── app-configs
│ ├── chrome.sh
│ ├── safari.sh
│ └── transmission.sh
└── settings-default.sh
├── nvim
└── init.vim
├── scripts
├── antigen.zsh
├── iterm-colors-install.sh
├── zsh-antigen.sh
└── zsh-zgen.sh
├── setup.sh
├── vimrc.js
├── .gitignore
├── .vimrc.swp
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── install.sh
├── vimrc
└── vimrc.plugs
├── vscode
├── extensions.json
├── settings.json
└── vscode-setup.sh
└── zsh
├── dircolors.zsh
├── powerlevel9
└── defaulttheme.zsh
├── zgen_setup.zsh
├── zsh_aliases.zsh
├── zsh_functions.zsh
└── zshrc.zsh
/.aliases:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | alias ls='exa'
4 | alias lc='colorls'
5 |
6 | # Easier navigation: .., ..., ...., ....., ~ and -
7 | alias ..="cd .."
8 | alias ...="cd ../.."
9 | alias ....="cd ../../.."
10 | alias .....="cd ../../../.."
11 | alias ~="cd ~" # `cd` is probably faster to type though
12 | alias -- -="cd -"
13 |
14 | # Shortcuts
15 | alias d="cd ~/Documents/Dropbox"
16 | alias dl="cd ~/Downloads"
17 | alias dt="cd ~/Desktop"
18 | alias p="cd ~/projects"
19 | alias g="git"
20 |
21 | # Detect which `ls` flavor is in use
22 | if ls --color > /dev/null 2>&1; then # GNU `ls`
23 | colorflag="--color"
24 | export LS_COLORS='no=00:fi=00:di=01;31:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'
25 | else # macOS `ls`
26 | colorflag="-G"
27 | export LSCOLORS='BxBxhxDxfxhxhxhxhxcxcx'
28 | fi
29 |
30 | # List all files colorized in long format
31 | alias l="ls -lF ${colorflag}"
32 |
33 | # List all files colorized in long format, excluding . and ..
34 | alias la="ls -lAF ${colorflag}"
35 |
36 | # List only directories
37 | alias lsd="ls -lF ${colorflag} | grep --color=never '^d'"
38 |
39 | # Always use color output for `ls`
40 | alias ls="command ls ${colorflag}"
41 |
42 | # Always enable colored `grep` output
43 | # Note: `GREP_OPTIONS="--color=auto"` is deprecated, hence the alias usage.
44 | alias grep='grep --color=auto'
45 | alias fgrep='fgrep --color=auto'
46 | alias egrep='egrep --color=auto'
47 |
48 | # Enable aliases to be sudo’ed
49 | alias sudo='sudo '
50 |
51 | # Get week number
52 | alias week='date +%V'
53 |
54 | # Get macOS Software Updates, and update installed Ruby gems, Homebrew, npm, and their installed packages
55 | alias update='sudo softwareupdate -i -a; brew update; brew upgrade; brew cleanup; npm install npm -g; npm update -g; sudo gem update --system; sudo gem update; sudo gem cleanup'
56 |
57 | # Google Chrome
58 | alias chrome='/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome'
59 | alias canary='/Applications/Google\ Chrome\ Canary.app/Contents/MacOS/Google\ Chrome\ Canary'
60 |
61 | # IP addresses
62 | alias ip="dig +short myip.opendns.com @resolver1.opendns.com"
63 | alias localip="ipconfig getifaddr en0"
64 | alias ips="ifconfig -a | grep -o 'inet6\? \(addr:\)\?\s\?\(\(\([0-9]\+\.\)\{3\}[0-9]\+\)\|[a-fA-F0-9:]\+\)' | awk '{ sub(/inet6? (addr:)? ?/, \"\"); print }'"
65 |
66 | # Show active network interfaces
67 | alias ifactive="ifconfig | pcregrep -M -o '^[^\t:]+:([^\n]|\n\t)*status: active'"
68 |
69 | # Flush Directory Service cache
70 | alias flush="dscacheutil -flushcache && killall -HUP mDNSResponder"
71 |
72 | # Clean up LaunchServices to remove duplicates in the “Open With” menu
73 | alias lscleanup="/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user && killall Finder"
74 |
75 | # Canonical hex dump; some systems have this symlinked
76 | command -v hd > /dev/null || alias hd="hexdump -C"
77 |
78 | # macOS has no `md5sum`, so use `md5` as a fallback
79 | command -v md5sum > /dev/null || alias md5sum="md5"
80 |
81 | # macOS has no `sha1sum`, so use `shasum` as a fallback
82 | command -v sha1sum > /dev/null || alias sha1sum="shasum"
83 |
84 | # JavaScriptCore REPL
85 | jscbin="/System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc";
86 | [ -e "${jscbin}" ] && alias jsc="${jscbin}";
87 | unset jscbin;
88 |
89 | # Trim new lines and copy to clipboard
90 | alias c="tr -d '\n' | pbcopy"
91 |
92 | # Recursively delete `.DS_Store` files
93 | alias cleanup="find . -type f -name '*.DS_Store' -ls -delete"
94 |
95 | # Empty the Trash on all mounted volumes and the main HDD.
96 | # Also, clear Apple’s System Logs to improve shell startup speed.
97 | # Finally, clear download history from quarantine. https://mths.be/bum
98 | alias emptytrash="sudo rm -rfv /Volumes/*/.Trashes; sudo rm -rfv ~/.Trash; sudo rm -rfv /private/var/log/asl/*.asl; sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'delete from LSQuarantineEvent'"
99 |
100 | # Show/hide hidden files in Finder
101 | alias show="defaults write com.apple.finder AppleShowAllFiles -bool true && killall Finder"
102 | alias hide="defaults write com.apple.finder AppleShowAllFiles -bool false && killall Finder"
103 |
104 | # Hide/show all desktop icons (useful when presenting)
105 | alias hidedesktop="defaults write com.apple.finder CreateDesktop -bool false && killall Finder"
106 | alias showdesktop="defaults write com.apple.finder CreateDesktop -bool true && killall Finder"
107 |
108 | # URL-encode strings
109 | alias urlencode='python -c "import sys, urllib as ul; print ul.quote_plus(sys.argv[1]);"'
110 |
111 | # Merge PDF files
112 | # Usage: `mergepdf -o output.pdf input{1,2,3}.pdf`
113 | alias mergepdf='/System/Library/Automator/Combine\ PDF\ Pages.action/Contents/Resources/join.py'
114 |
115 | # Disable Spotlight
116 | alias spotoff="sudo mdutil -a -i off"
117 | # Enable Spotlight
118 | alias spoton="sudo mdutil -a -i on"
119 |
120 | # PlistBuddy alias, because sometimes `defaults` just doesn’t cut it
121 | alias plistbuddy="/usr/libexec/PlistBuddy"
122 |
123 | # Airport CLI alias
124 | alias airport='/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport'
125 |
126 | # Intuitive map function
127 | # For example, to list all directories that contain a certain file:
128 | # find . -name .gitattributes | map dirname
129 | alias map="xargs -n1"
130 |
131 | # One of @janmoesen’s ProTip™s
132 | for method in GET HEAD POST PUT DELETE TRACE OPTIONS; do
133 | alias "${method}"="lwp-request -m '${method}'"
134 | done
135 |
136 | # Make Grunt print stack traces by default
137 | command -v grunt > /dev/null && alias grunt="grunt --stack"
138 |
139 | # Stuff I never really use but cannot delete either because of http://xkcd.com/530/
140 | alias stfu="osascript -e 'set volume output muted true'"
141 | alias pumpitup="osascript -e 'set volume output volume 100'"
142 |
143 | # Kill all the tabs in Chrome to free up memory
144 | # [C] explained: http://www.commandlinefu.com/commands/view/402/exclude-grep-from-your-grepped-output-of-ps-alias-included-in-description
145 | alias chromekill="ps ux | grep '[C]hrome Helper --type=renderer' | grep -v extension-process | tr -s ' ' | cut -d ' ' -f2 | xargs kill"
146 |
147 | # Lock the screen (when going AFK)
148 | alias afk="/System/Library/CoreServices/Menu\ Extras/User.menu/Contents/Resources/CGSession -suspend"
149 |
150 | # Reload the shell (i.e. invoke as a login shell)
151 | alias reload="exec ${SHELL} -l"
152 |
153 | # Print each PATH entry on a separate line
154 | alias path='echo -e ${PATH//:/\\n}'
155 |
--------------------------------------------------------------------------------
/.bash_profile:
--------------------------------------------------------------------------------
1 | # Add `~/bin` to the `$PATH`
2 | export PATH="$HOME/bin:$PATH";
3 |
4 | # Load the shell dotfiles, and then some:
5 | # * ~/.path can be used to extend `$PATH`.
6 | # * ~/.extra can be used for other settings you don’t want to commit.
7 | for file in ~/.{path,bash_prompt,exports,aliases,functions,extra}; do
8 | [ -r "$file" ] && [ -f "$file" ] && source "$file";
9 | done;
10 | unset file;
11 |
12 | # Case-insensitive globbing (used in pathname expansion)
13 | shopt -s nocaseglob;
14 |
15 | # Append to the Bash history file, rather than overwriting it
16 | shopt -s histappend;
17 |
18 | # Autocorrect typos in path names when using `cd`
19 | shopt -s cdspell;
20 |
21 | # Enable some Bash 4 features when possible:
22 | # * `autocd`, e.g. `**/qux` will enter `./foo/bar/baz/qux`
23 | # * Recursive globbing, e.g. `echo **/*.txt`
24 | for option in autocd globstar; do
25 | shopt -s "$option" 2> /dev/null;
26 | done;
27 |
28 | # Add tab completion for many Bash commands
29 | if which brew &> /dev/null && [ -f "$(brew --prefix)/share/bash-completion/bash_completion" ]; then
30 | source "$(brew --prefix)/share/bash-completion/bash_completion";
31 | elif [ -f /etc/bash_completion ]; then
32 | source /etc/bash_completion;
33 | fi;
34 |
35 | # Enable tab completion for `g` by marking it as an alias for `git`
36 | if type _git &> /dev/null && [ -f /usr/local/etc/bash_completion.d/git-completion.bash ]; then
37 | complete -o default -o nospace -F _git g;
38 | fi;
39 |
40 | # Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards
41 | [ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2- | tr ' ' '\n')" scp sftp ssh;
42 |
43 | # Add tab completion for `defaults read|write NSGlobalDomain`
44 | # You could just use `-g` instead, but I like being explicit
45 | complete -W "NSGlobalDomain" defaults;
46 |
47 | # Add `killall` tab completion for common apps
48 | complete -o "nospace" -W "Contacts Calendar Dock Finder Mail Safari iTunes SystemUIServer Terminal Twitter" killall;
49 |
50 | alias ls='exa'
51 |
--------------------------------------------------------------------------------
/.bash_prompt:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # Shell prompt based on the Solarized Dark theme.
4 | # Screenshot: http://i.imgur.com/EkEtphC.png
5 | # Heavily inspired by @necolas’s prompt: https://github.com/necolas/dotfiles
6 | # iTerm → Profiles → Text → use 13pt Monaco with 1.1 vertical spacing.
7 |
8 | if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
9 | export TERM='gnome-256color';
10 | elif infocmp xterm-256color >/dev/null 2>&1; then
11 | export TERM='xterm-256color';
12 | fi;
13 |
14 | prompt_git() {
15 | local s='';
16 | local branchName='';
17 |
18 | # Check if the current directory is in a Git repository.
19 | if [ $(git rev-parse --is-inside-work-tree &>/dev/null; echo "${?}") == '0' ]; then
20 |
21 | # check if the current directory is in .git before running git checks
22 | if [ "$(git rev-parse --is-inside-git-dir 2> /dev/null)" == 'false' ]; then
23 |
24 | # Ensure the index is up to date.
25 | git update-index --really-refresh -q &>/dev/null;
26 |
27 | # Check for uncommitted changes in the index.
28 | if ! $(git diff --quiet --ignore-submodules --cached); then
29 | s+='+';
30 | fi;
31 |
32 | # Check for unstaged changes.
33 | if ! $(git diff-files --quiet --ignore-submodules --); then
34 | s+='!';
35 | fi;
36 |
37 | # Check for untracked files.
38 | if [ -n "$(git ls-files --others --exclude-standard)" ]; then
39 | s+='?';
40 | fi;
41 |
42 | # Check for stashed files.
43 | if $(git rev-parse --verify refs/stash &>/dev/null); then
44 | s+='$';
45 | fi;
46 |
47 | fi;
48 |
49 | # Get the short symbolic ref.
50 | # If HEAD isn’t a symbolic ref, get the short SHA for the latest commit
51 | # Otherwise, just give up.
52 | branchName="$(git symbolic-ref --quiet --short HEAD 2> /dev/null || \
53 | git rev-parse --short HEAD 2> /dev/null || \
54 | echo '(unknown)')";
55 |
56 | [ -n "${s}" ] && s=" [${s}]";
57 |
58 | echo -e "${1}${branchName}${2}${s}";
59 | else
60 | return;
61 | fi;
62 | }
63 |
64 | if tput setaf 1 &> /dev/null; then
65 | tput sgr0; # reset colors
66 | bold=$(tput bold);
67 | reset=$(tput sgr0);
68 | # Solarized colors, taken from http://git.io/solarized-colors.
69 | black=$(tput setaf 0);
70 | blue=$(tput setaf 33);
71 | cyan=$(tput setaf 37);
72 | green=$(tput setaf 64);
73 | orange=$(tput setaf 166);
74 | purple=$(tput setaf 125);
75 | red=$(tput setaf 124);
76 | violet=$(tput setaf 61);
77 | white=$(tput setaf 15);
78 | yellow=$(tput setaf 136);
79 | else
80 | bold='';
81 | reset="\e[0m";
82 | black="\e[1;30m";
83 | blue="\e[1;34m";
84 | cyan="\e[1;36m";
85 | green="\e[1;32m";
86 | orange="\e[1;33m";
87 | purple="\e[1;35m";
88 | red="\e[1;31m";
89 | violet="\e[1;35m";
90 | white="\e[1;37m";
91 | yellow="\e[1;33m";
92 | fi;
93 |
94 | # Highlight the user name when logged in as root.
95 | if [[ "${USER}" == "root" ]]; then
96 | userStyle="${red}";
97 | else
98 | userStyle="${orange}";
99 | fi;
100 |
101 | # Highlight the hostname when connected via SSH.
102 | if [[ "${SSH_TTY}" ]]; then
103 | hostStyle="${bold}${red}";
104 | else
105 | hostStyle="${yellow}";
106 | fi;
107 |
108 | # Set the terminal title and prompt.
109 | PS1="\[\033]0;\W\007\]"; # working directory base name
110 | PS1+="\[${bold}\]\n"; # newline
111 | PS1+="\[${userStyle}\]\u"; # username
112 | PS1+="\[${white}\] at ";
113 | PS1+="\[${hostStyle}\]\h"; # host
114 | PS1+="\[${white}\] in ";
115 | PS1+="\[${green}\]\w"; # working directory full path
116 | PS1+="\$(prompt_git \"\[${white}\] on \[${violet}\]\" \"\[${blue}\]\")"; # Git repository details
117 | PS1+="\n";
118 | PS1+="\[${white}\]\$ \[${reset}\]"; # `$` (and reset color)
119 | export PS1;
120 |
121 | PS2="\[${yellow}\]→ \[${reset}\]";
122 | export PS2;
123 |
--------------------------------------------------------------------------------
/.bashrc:
--------------------------------------------------------------------------------
1 | [ -n "$PS1" ] && source ~/.bash_profile;
2 |
3 | export NVM_DIR="$HOME/.nvm"
4 | [ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm
5 | [ -s "/usr/local/opt/nvm/etc/bash_completion" ] && . "/usr/local/opt/nvm/etc/bash_completion" # This loads nvm bash_completion
6 |
7 | export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
8 |
9 |
--------------------------------------------------------------------------------
/.dircolors:
--------------------------------------------------------------------------------
1 | # -- Core ----------------------------------------
2 |
3 | NORMAL 0 # Global default
4 | FILE 0 # Global file default
5 | DIR 38;5;110 # Global directory default
6 | EXEC 38;5;78;1 # Executable
7 | CAPABILITY 38;5;17
8 | LINK target # Symbolic link
9 | MULTIHARDLINK 38;5;222;1
10 | ORPHAN 48;5;196;38;5;232;1 # Orphaned symbolic link
11 | OTHER_WRITABLE 38;5;220;1
12 | SETGID 48;5;3;38;5;0
13 | SETUID 38;5;220;1;3;100;1
14 | STICKY 38;5;86;48;5;234
15 | STICKY_OTHER_WRITABLE 48;5;235;38;5;139;3
16 | BLK 38;5;68 # Block device
17 | SOCK 38;5;197 # Socket
18 | CHR 38;5;113;1 # Character device
19 | FIFO 38;5;126 # Named pipe
20 | DOOR 38;5;127 # Solaris door
21 |
22 | # -- Documents -----------------------------------
23 |
24 | *README 38;5;220;1
25 | *README.rst 38;5;220;1
26 | *LICENSE 38;5;220;1
27 | *COPYING 38;5;220;1
28 | *INSTALL 38;5;220;1
29 | *COPYRIGHT 38;5;220;1
30 | *AUTHORS 38;5;220;1
31 | *HISTORY 38;5;220;1
32 | *CONTRIBUTORS 38;5;220;1
33 | *PATENTS 38;5;220;1
34 | *VERSION 38;5;220;1
35 | *NOTICE 38;5;220;1
36 | *CHANGES 38;5;220;1
37 | .log 38;5;190
38 | .txt 38;5;253
39 | .etx 38;5;184
40 | .info 38;5;184
41 | .markdown 38;5;184
42 | .md 38;5;184
43 | .mkd 38;5;184
44 | .nfo 38;5;184
45 | .pod 38;5;184
46 | .rst 38;5;184
47 | .tex 38;5;184
48 | .textile 38;5;184
49 | .json 38;5;178
50 | .msg 38;5;178
51 | .pgn 38;5;178
52 | .rss 38;5;178
53 | .xml 38;5;178
54 | .yaml 38;5;178
55 | .yml 38;5;178
56 | .RData 38;5;178
57 | .rdata 38;5;178
58 | .cbr 38;5;141
59 | .cbz 38;5;141
60 | .chm 38;5;141
61 | .djvu 38;5;141
62 | .pdf 38;5;141
63 | .PDF 38;5;141
64 | .docm 38;5;111;4
65 | .doc 38;5;111
66 | .docx 38;5;111
67 | .eps 38;5;111
68 | .ps 38;5;111
69 | .odb 38;5;111
70 | .odt 38;5;111
71 | .rtf 38;5;111
72 | .odp 38;5;166
73 | .pps 38;5;166
74 | .csv 38;5;78
75 | .ods 38;5;112
76 | *cfg 1
77 | *conf 1
78 | *rc 1
79 | .ini 1
80 | .plist 1
81 | .viminfo 1
82 | .pcf 1
83 | .psf 1
84 |
85 | # -- Code ----------------------------------------
86 |
87 | .git 38;5;197
88 | .gitignore 38;5;240
89 | .gitattributes 38;5;240
90 | .gitmodules 38;5;240
91 | .awk 38;5;172
92 | .bash 38;5;172
93 | .bat 38;5;172
94 | .BAT 38;5;172
95 | .sed 38;5;172
96 | .sh 38;5;172
97 | .zsh 38;5;172
98 | .vim 38;5;172
99 | .ahk 38;5;41
100 | .py 38;5;41 # Python
101 | .pl 38;5;208 # Perl
102 | .PL 38;5;160
103 | .t 38;5;114
104 | .msql 38;5;222 # SQL
105 | .mysql 38;5;222
106 | .pgsql 38;5;222
107 | .sql 38;5;222
108 | .tcl 38;5;64;1
109 | .r 38;5;49
110 | .R 38;5;49
111 | .gs 38;5;81
112 | .asm 38;5;81 # Assembly
113 | .cl 38;5;81 # Common Lisp
114 | .lisp 38;5;81 # Lisp
115 | .lua 38;5;81 # Lua
116 | .moon 38;5;81 # MoonScript
117 | .c 38;5;81 # C
118 | .C 38;5;81 # C
119 | .h 38;5;110 # C header
120 | .H 38;5;110 # C header
121 | .tcc 38;5;110
122 | .c++ 38;5;81 # C++
123 | .h++ 38;5;110 # C++
124 | .hpp 38;5;110
125 | .hxx 38;5;110
126 | .ii 38;5;110
127 | .M 38;5;110 # Obj-C method
128 | .m 38;5;110 # obj-C method
129 | .cc 38;5;81 # C#
130 | .cs 38;5;81 # C#
131 | .cp 38;5;81
132 | .cpp 38;5;81
133 | .cxx 38;5;81
134 | .cr 38;5;81 # Crystal
135 | .go 38;5;81 # Goolang
136 | .f 38;5;81 # Fortran
137 | .for 38;5;81 # Fortran
138 | .ftn 38;5;81 # Fortra
139 | .s 38;5;110 # Pascal
140 | .S 38;5;110 # Pascal
141 | .rs 38;5;81 # Rust
142 | .swift 38;5;219 # Swift
143 | .sx 38;5;81
144 | .hi 38;5;110 # GHC interface
145 | .hs 38;5;81 # Haskell
146 | .lhs 38;5;81
147 | .pyc 38;5;240 # Python byte code
148 | .css 38;5;125;1 # CSS
149 | .less 38;5;125;1 # LESS
150 | .sass 38;5;125;1 # SASS
151 | .scss 38;5;125;1 # SCSS
152 | .htm 38;5;125;1 # HTML
153 | .html 38;5;125;1 # HTML
154 | .jhtm 38;5;125;1 # Dynamo Server Page
155 | .mht 38;5;125;1
156 | .eml 38;5;125;1
157 | .mustache 38;5;125;1 # Mustache template file
158 | .coffee 38;5;074;1 # CoffeeScript
159 | .java 38;5;074;1 # Java
160 | .js 38;5;074;1
161 | .jsm 38;5;074;1
162 | .jsm 38;5;074;1
163 | .jsp 38;5;074;1
164 | .php 38;5;81 # PHP
165 | .ctp 38;5;81 # CakePHP
166 | .twig 38;5;81 # Twig
167 | .vb 38;5;81 # Visual Basic
168 | .vba 38;5;81
169 | .vbs 38;5;81
170 | *Dockerfile 38;5;155 # Docker
171 | .dockerignore 38;5;240 # Docker
172 | *Makefile 38;5;155 # Make
173 | *MANIFEST 38;5;243
174 | *pm_to_blib 38;5;240
175 | .am 38;5;242 # Automake
176 | .in 38;5;242
177 | .hin 38;5;242
178 | .scan 38;5;242
179 | .m4 38;5;242
180 | .old 38;5;242
181 | .out 38;5;242
182 | .SKIP 38;5;244
183 | .diff 38;5;229
184 | .patch 48;5;197;38;5;232;1
185 |
186 | # -- Graphics ------------------------------------
187 |
188 | .bmp 38;5;97
189 | .tiff 38;5;97
190 | .tif 38;5;97
191 | .TIFF 38;5;97
192 | .cdr 38;5;97
193 | .gif 38;5;97
194 | .ico 38;5;97
195 | .jpeg 38;5;97
196 | .JPG 38;5;97
197 | .jpg 38;5;97
198 | .nth 38;5;97
199 | .png 38;5;97
200 | .psd 38;5;97
201 | .xpm 38;5;97
202 |
203 | # -- Vector --------------------------------------
204 |
205 | .ai 38;5;99
206 | .eps 38;5;99
207 | .epsf 38;5;99
208 | .drw 38;5;99
209 | .ps 38;5;99
210 | .svg 38;5;99
211 |
212 | # -- Video ---------------------------------------
213 |
214 | .avi 38;5;114
215 | .divx 38;5;114
216 | .IFO 38;5;114
217 | .m2v 38;5;114
218 | .m4v 38;5;114
219 | .mkv 38;5;114
220 | .MOV 38;5;114
221 | .mov 38;5;114
222 | .mp4 38;5;114
223 | .mpeg 38;5;114
224 | .mpg 38;5;114
225 | .ogm 38;5;114
226 | .rmvb 38;5;114
227 | .sample 38;5;114
228 | .wmv 38;5;114
229 | .3g2 38;5;115
230 | .3gp 38;5;115
231 | .gp3 38;5;115
232 | .webm 38;5;115
233 | .gp4 38;5;115
234 | .asf 38;5;115
235 | .flv 38;5;115
236 | .ts 38;5;115
237 | .ogv 38;5;115
238 | .f4v 38;5;115
239 | .VOB 38;5;115;1
240 | .vob 38;5;115;1
241 |
242 | # -- Audio ---------------------------------------
243 |
244 | .3ga 38;5;137;1
245 | .S3M 38;5;137;1
246 | .aac 38;5;137;1
247 | .au 38;5;137;1
248 | .dat 38;5;137;1
249 | .dts 38;5;137;1
250 | .fcm 38;5;137;1
251 | .m4a 38;5;137;1
252 | .mid 38;5;137;1
253 | .midi 38;5;137;1
254 | .mod 38;5;137;1
255 | .mp3 38;5;137;1
256 | .mp4a 38;5;137;1
257 | .oga 38;5;137;1
258 | .ogg 38;5;137;1
259 | .opus 38;5;137;1
260 | .s3m 38;5;137;1
261 | .sid 38;5;137;1
262 | .wma 38;5;137;1
263 | .ape 38;5;136;1
264 | .aiff 38;5;136;1
265 | .cda 38;5;136;1
266 | .flac 38;5;136;1
267 | .alac 38;5;136;1
268 | .midi 38;5;136;1
269 | .pcm 38;5;136;1
270 | .wav 38;5;136;1
271 | .wv 38;5;136;1
272 | .wvc 38;5;136;1
273 |
274 | # -- Fonts ---------------------------------------
275 |
276 | .afm 38;5;66
277 | .fon 38;5;66
278 | .fnt 38;5;66
279 | .pfb 38;5;66
280 | .pfm 38;5;66
281 | .ttf 38;5;66
282 | .otf 38;5;66
283 | .PFA 38;5;66
284 | .pfa 38;5;66
285 |
286 | # -- Archives ------------------------------------
287 |
288 | .7z 38;5;40
289 | .a 38;5;40
290 | .arj 38;5;40
291 | .bz2 38;5;40
292 | .cpio 38;5;40
293 | .gz 38;5;40
294 | .lrz 38;5;40
295 | .lz 38;5;40
296 | .lzma 38;5;40
297 | .lzo 38;5;40
298 | .rar 38;5;40
299 | .s7z 38;5;40
300 | .sz 38;5;40
301 | .tar 38;5;40
302 | .tgz 38;5;40
303 | .xz 38;5;40
304 | .z 38;5;40
305 | .Z 38;5;40
306 | .zip 38;5;40
307 | .zipx 38;5;40
308 | .zoo 38;5;40
309 | .zpaq 38;5;40
310 | .zz 38;5;40
311 | .apk 38;5;215
312 | .deb 38;5;215
313 | .rpm 38;5;215
314 | .jad 38;5;215
315 | .jar 38;5;215
316 | .cab 38;5;215
317 | .pak 38;5;215
318 | .pk3 38;5;215
319 | .vdf 38;5;215
320 | .vpk 38;5;215
321 | .bsp 38;5;215
322 | .dmg 38;5;215
323 | .r[0-9]{0,2} 38;5;239
324 | .zx[0-9]{0,2} 38;5;239
325 | .z[0-9]{0,2} 38;5;239
326 | .part 38;5;239
327 | .dmg 38;5;124
328 | .iso 38;5;124
329 | .bin 38;5;124
330 | .nrg 38;5;124
331 | .qcow 38;5;124
332 | .sparseimage 38;5;124
333 | .toast 38;5;124
334 | .vcd 38;5;124
335 | .vmdk 38;5;124
336 | .accdb 38;5;60
337 | .accde 38;5;60
338 | .accdr 38;5;60
339 | .accdt 38;5;60
340 | .db 38;5;60
341 | .fmp12 38;5;60
342 | .fp7 38;5;60
343 | .localstorage 38;5;60
344 | .mdb 38;5;60
345 | .mde 38;5;60
346 | .sqlite 38;5;60
347 | .typelib 38;5;60
348 | .nc 38;5;60
349 |
350 | # -- Temporary -----------------------------------
351 |
352 | .pacnew 38;5;33
353 | .un~ 38;5;241
354 | .orig 38;5;241
355 | .BUP 38;5;241
356 | .bak 38;5;241
357 | .o 38;5;241
358 | .rlib 38;5;241 # Static Rust Library
359 | .swp 38;5;244
360 | .swo 38;5;244
361 | .tmp 38;5;244
362 | .sassc 38;5;244
363 | .pid 38;5;248
364 | .state 38;5;248
365 | *lockfile 38;5;248
366 | .err 38;5;160;1
367 | .error 38;5;160;1
368 | .stderr 38;5;160;1
369 | .dump 38;5;241
370 | .stackdump 38;5;241
371 | .zcompdump 38;5;241
372 | .zwc 38;5;241
373 | .pcap 38;5;29
374 | .cap 38;5;29
375 | .dmp 38;5;29
376 | .DS_Store 38;5;239
377 | .localized 38;5;239
378 | .CFUserTextEncoding 38;5;239
379 |
380 | # -- System --------------------------------------
381 |
382 | .service 38;5;45
383 | *@.service 38;5;45
384 | .socket 38;5;45
385 | .swap 38;5;45
386 | .device 38;5;45
387 | .mount 38;5;45
388 | .automount 38;5;45
389 | .target 38;5;45
390 | .path 38;5;45
391 | .timer 38;5;45
392 | .snapshot 38;5;45
393 | .allow 38;5;112 # /etc/hosts.allow
394 | .deny 38;5;196 # /etc/hosts.deny
395 |
396 | # -- Metadata ------------------------------------
397 |
398 | .application 38;5;116
399 | .cue 38;5;116
400 | .description 38;5;116
401 | .directory 38;5;116
402 | .m3u 38;5;116
403 | .m3u8 38;5;116
404 | .md5 38;5;116
405 | .properties 38;5;116
406 | .sfv 38;5;116
407 | .srt 38;5;116
408 | .theme 38;5;116
409 | .torrent 38;5;116
410 | .urlview 38;5;116
411 |
412 | # -- Encrypted -----------------------------------
413 |
414 | .asc 38;5;192;3
415 | .bfe 38;5;192;3
416 | .enc 38;5;192;3
417 | .gpg 38;5;192;3
418 | .signature 38;5;192;3
419 | .sig 38;5;192;3
420 | .p12 38;5;192;3
421 | .pem 38;5;192;3
422 | .pgp 38;5;192;3
423 | .asc 38;5;192;3
424 | .enc 38;5;192;3
425 | .sig 38;5;192;3
426 |
427 | # -- Emulators -----------------------------------
428 |
429 | .32x 38;5;213
430 | .cdi 38;5;213
431 | .fm2 38;5;213
432 | .rom 38;5;213
433 | .sav 38;5;213
434 | .st 38;5;213
435 | .a00 38;5;213 # Atari
436 | .a52 38;5;213
437 | .A64 38;5;213
438 | .a64 38;5;213
439 | .a78 38;5;213
440 | .adf 38;5;213
441 | .atr 38;5;213
442 | .gb 38;5;213 # Nintendo
443 | .gba 38;5;213
444 | .gbc 38;5;213
445 | .gel 38;5;213
446 | .gg 38;5;213
447 | .ggl 38;5;213
448 | .ipk 38;5;213 # Nintendo (DS Packed Images)
449 | .j64 38;5;213
450 | .nds 38;5;213
451 | .nes 38;5;213
452 | .sms 38;5;213 # Sega
453 |
454 | # -- Unsorted ------------------------------------
455 |
456 | .pot 38;5;7 # Portable Object Translation for GNU Gettext
457 | .pcb 38;5;7 # CAD files for printed circuit boards
458 | .mm 38;5;7
459 | .pod 38;5;7 # Perl Documentation
460 | .gbr 38;5;7 # GIMP brush
461 | .spl 38;5;7 # Printer spool
462 | .scm 38;5;7 # GIMP project
463 | .Rproj 38;5;11 # RStudio project
464 | .sis 38;5;7 # Nokia Symbian OS
465 | .1p 38;5;7
466 | .3p 38;5;7
467 | .cnc 38;5;7
468 | .def 38;5;7
469 | .ex 38;5;7
470 | .example 38;5;7
471 | .feature 38;5;7
472 | .ger 38;5;7
473 | .map 38;5;7
474 | .mf 38;5;7
475 | .mfasl 38;5;7
476 | .mi 38;5;7
477 | .mtx 38;5;7
478 | .pc 38;5;7
479 | .pi 38;5;7
480 | .plt 38;5;7
481 | .pm 38;5;7
482 | .rb 38;5;7
483 | .rdf 38;5;7
484 | .rst 38;5;7
485 | .ru 38;5;7
486 | .sch 38;5;7
487 | .sty 38;5;7
488 | .sug 38;5;7
489 | .t 38;5;7
490 | .tdy 38;5;7
491 | .tfm 38;5;7
492 | .tfnt 38;5;7
493 | .tg 38;5;7
494 | .vcard 38;5;7
495 | .vcf 38;5;7
496 | .xln 38;5;7
497 | .iml 38;5;166 # AppCode
498 | .xcconfig 1 # Xcode
499 | .entitlements 1
500 | .strings 1
501 | .storyboard 38;5;196
502 | .xcsettings 1
503 | .xib 38;5;208
504 |
505 | # -- Termcap -------------------------------------
506 |
507 | TERM ansi
508 | TERM color-xterm
509 | TERM con132x25
510 | TERM con132x30
511 | TERM con132x43
512 | TERM con132x60
513 | TERM con80x25
514 | TERM con80x28
515 | TERM con80x30
516 | TERM con80x43
517 | TERM con80x50
518 | TERM con80x60
519 | TERM cons25
520 | TERM console
521 | TERM cygwin
522 | TERM dtterm
523 | TERM Eterm
524 | TERM eterm-color
525 | TERM gnome
526 | TERM gnome-256color
527 | TERM jfbterm
528 | TERM konsole
529 | TERM kterm
530 | TERM linux
531 | TERM linux-c
532 | TERM mach-color
533 | TERM mlterm
534 | TERM putty
535 | TERM rxvt
536 | TERM rxvt-256color
537 | TERM rxvt-cygwin
538 | TERM rxvt-cygwin-native
539 | TERM rxvt-unicode
540 | TERM rxvt-unicode-256color
541 | TERM rxvt-unicode256
542 | TERM screen
543 | TERM screen-256color
544 | TERM screen-256color-bce
545 | TERM screen-bce
546 | TERM screen-w
547 | TERM screen.linux
548 | TERM screen.rxvt
549 | TERM terminator
550 | TERM vt100
551 | TERM xterm
552 | TERM xterm-16color
553 | TERM xterm-256color
554 | TERM xterm-88color
555 | TERM xterm-color
556 | TERM xterm-debian
557 |
558 | # vim: filetype=dircolors expandtab
--------------------------------------------------------------------------------
/.exports:
--------------------------------------------------------------------------------
1 | # Make vim the default editor.
2 | export EDITOR='vim';
3 |
4 | # Enable persistent REPL history for `node`.
5 | NODE_REPL_HISTORY_FILE=~/.node_history;
6 | # Allow 32³ entries; the default is 1000.
7 | NODE_REPL_HISTORY_SIZE='32768';
8 |
9 | # Increase Bash history size. Allow 32³ entries; the default is 500.
10 | export HISTSIZE='32768';
11 | export HISTFILESIZE="${HISTSIZE}";
12 | # Omit duplicates and commands that begin with a space from history.
13 | export HISTCONTROL='ignoreboth';
14 |
15 | # Prefer US English and use UTF-8.
16 | export LANG='en_US.UTF-8';
17 | export LC_ALL='en_US.UTF-8';
18 |
19 | # Highlight section titles in manual pages.
20 | export LESS_TERMCAP_md="${yellow}";
21 |
22 | # Don’t clear the screen after quitting a manual page.
23 | export MANPAGER='less -X';
24 |
25 | # Always enable colored `grep` output.
26 | export GREP_OPTIONS='--color=auto';
27 |
--------------------------------------------------------------------------------
/.functions:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andreystarkov/dotfiles/27f7f41c44df39cf5e239ec6cc66506f2bd864f0/.functions
--------------------------------------------------------------------------------
/.gitconfig:
--------------------------------------------------------------------------------
1 | [alias]
2 |
3 | # View abbreviated SHA, description, and history graph of the latest 20 commits
4 | l = log --pretty=oneline -n 20 --graph --abbrev-commit
5 |
6 | # View the current working tree status using the short format
7 | s = status -s
8 |
9 | # Show the diff between the latest commit and the current state
10 | d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
11 |
12 | # `git di $number` shows the diff between the state `$number` revisions ago and the current state
13 | di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d"
14 |
15 | # Pull in remote changes for the current repository and all its submodules
16 | p = !"git pull; git submodule foreach git pull origin master"
17 |
18 | # Clone a repository including all submodules
19 | c = clone --recursive
20 |
21 | # Commit all changes
22 | ca = !git add -A && git commit -av
23 |
24 | # Switch to a branch, creating it if necessary
25 | go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f"
26 |
27 | # Show verbose output about tags, branches or remotes
28 | tags = tag -l
29 | branches = branch -a
30 | remotes = remote -v
31 |
32 | # List aliases
33 | aliases = config --get-regexp alias
34 |
35 | # Amend the currently staged files to the latest commit
36 | amend = commit --amend --reuse-message=HEAD
37 |
38 | # Credit an author on the latest commit
39 | credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f"
40 |
41 | # Interactive rebase with the given number of latest commits
42 | reb = "!r() { git rebase -i HEAD~$1; }; r"
43 |
44 | # Remove the old tag with this name and tag the latest commit with it.
45 | retag = "!r() { git tag -d $1 && git push origin :refs/tags/$1 && git tag $1; }; r"
46 |
47 | # Find branches containing commit
48 | fb = "!f() { git branch -a --contains $1; }; f"
49 |
50 | # Find tags containing commit
51 | ft = "!f() { git describe --always --contains $1; }; f"
52 |
53 | # Find commits by source code
54 | fc = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short -S$1; }; f"
55 |
56 | # Find commits by commit message
57 | fm = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f"
58 |
59 | # Remove branches that have already been merged with master
60 | # a.k.a. ‘delete merged’
61 | dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
62 |
63 | # List contributors with number of commits
64 | contributors = shortlog --summary --numbered
65 |
66 | # Merge GitHub pull request on top of the current branch or,
67 | # if a branch name is specified, on top of the specified branch
68 | mpr = "!f() { \
69 | declare currentBranch=\"$(git symbolic-ref --short HEAD)\"; \
70 | declare branch=\"${2:-$currentBranch}\"; \
71 | if [ $(printf \"%s\" \"$1\" | grep '^[0-9]\\+$' > /dev/null; printf $?) -eq 0 ]; then \
72 | git fetch origin refs/pull/$1/head:pr/$1 && \
73 | git checkout -B $branch && \
74 | git rebase $branch pr/$1 && \
75 | git checkout -B $branch && \
76 | git merge pr/$1 && \
77 | git branch -D pr/$1 && \
78 | git commit --amend -m \"$(git log -1 --pretty=%B)\n\nCloses #$1.\"; \
79 | fi \
80 | }; f"
81 |
82 | [apply]
83 |
84 | # Detect whitespace errors when applying a patch
85 | whitespace = fix
86 |
87 | [core]
88 |
89 | # Use custom `.gitignore` and `.gitattributes`
90 | excludesfile = ~/.gitignore
91 | attributesfile = ~/.gitattributes
92 |
93 | # Treat spaces before tabs and all kinds of trailing whitespace as an error
94 | # [default] trailing-space: looks for spaces at the end of a line
95 | # [default] space-before-tab: looks for spaces before tabs at the beginning of a line
96 | whitespace = space-before-tab,-indent-with-non-tab,trailing-space
97 |
98 | # Make `git rebase` safer on macOS
99 | # More info:
100 | trustctime = false
101 |
102 | # Prevent showing files whose names contain non-ASCII symbols as unversioned.
103 | # http://michael-kuehnel.de/git/2014/11/21/git-mac-osx-and-german-umlaute.html
104 | precomposeunicode = false
105 |
106 | # Speed up commands involving untracked files such as `git status`.
107 | # https://git-scm.com/docs/git-update-index#_untracked_cache
108 | untrackedCache = true
109 |
110 | [color]
111 |
112 | # Use colors in Git commands that are capable of colored output when
113 | # outputting to the terminal. (This is the default setting in Git ≥ 1.8.4.)
114 | ui = auto
115 |
116 | [color "branch"]
117 |
118 | current = yellow reverse
119 | local = yellow
120 | remote = green
121 |
122 | [color "diff"]
123 |
124 | meta = yellow bold
125 | frag = magenta bold # line info
126 | old = red # deletions
127 | new = green # additions
128 |
129 | [color "status"]
130 |
131 | added = yellow
132 | changed = green
133 | untracked = cyan
134 |
135 | [commit]
136 |
137 | # https://help.github.com/articles/signing-commits-using-gpg/
138 | gpgsign = true
139 |
140 | [diff]
141 |
142 | # Detect copies as well as renames
143 | renames = copies
144 |
145 | [diff "bin"]
146 |
147 | # Use `hexdump` to diff binary files
148 | textconv = hexdump -v -C
149 |
150 | [help]
151 |
152 | # Automatically correct and execute mistyped commands
153 | autocorrect = 1
154 |
155 | [merge]
156 |
157 | # Include summaries of merged commits in newly created merge commit messages
158 | log = true
159 |
160 | [push]
161 |
162 | # https://git-scm.com/docs/git-config#git-config-pushdefault
163 | default = simple
164 | # Make `git push` push relevant annotated tags when pushing branches out.
165 | followTags = true
166 |
167 | # URL shorthands
168 |
169 | [url "git@github.com:"]
170 |
171 | insteadOf = "gh:"
172 | pushInsteadOf = "github:"
173 | pushInsteadOf = "git://github.com/"
174 |
175 | [url "git://github.com/"]
176 |
177 | insteadOf = "github:"
178 |
179 | [url "git@gist.github.com:"]
180 |
181 | insteadOf = "gst:"
182 | pushInsteadOf = "gist:"
183 | pushInsteadOf = "git://gist.github.com/"
184 |
185 | [url "git://gist.github.com/"]
186 |
187 | insteadOf = "gist:"
188 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | iterm-color-schemes
3 |
--------------------------------------------------------------------------------
/.inputrc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andreystarkov/dotfiles/27f7f41c44df39cf5e239ec6cc66506f2bd864f0/.inputrc
--------------------------------------------------------------------------------
/.screenrc:
--------------------------------------------------------------------------------
1 | # Disable the startup message
2 | startup_message off
3 |
4 | # Set a large scrollback buffer
5 | defscrollback 32000
6 |
7 | # Always start `screen` with UTF-8 enabled (`screen -U`)
8 | defutf8 on
9 |
--------------------------------------------------------------------------------
/Brewfile:
--------------------------------------------------------------------------------
1 | tap 'homebrew/cask'
2 | tap 'homebrew/eid'
3 | tap 'homebrew/fonts'
4 | tap 'homebrew/versions'
5 | tap 'homebrew/bundle'
6 | tap 'homebrew/core'
7 | tap 'homebrew/services'
8 | tap 'bramstein/webfonttools'
9 | tap 'neovim/neovim'
10 |
11 | tap 'argon/mas'
12 | tap 'neovim/neovim'
13 | tap 'ravenac95/sudolikeaboss'
14 | tap 'vitorgalvao/tiny-scripts'
15 | tap 'buo/cask-upgrade'
16 |
17 | brew 'git'
18 | brew 'git-flow'
19 | brew 'gist'
20 | # brew 'diffstat'
21 | # brew 'diffutils'
22 |
23 | brew 'aria2'
24 | brew 'ack'
25 | brew 'argon/mas/mas'
26 | brew 'pandoc'
27 | brew 'bash' # Bash 4
28 | # brew 'bat'
29 | # brew 'coreutils'
30 | # brew 'moreutils'
31 | # brew 'gnupg2'
32 | # brew 'grep', args: ['with-default-names']
33 | # brew 'make', args: ['with-default-names']
34 | brew 'mackup'
35 | brew 'mas'
36 | # brew 'pkg-config' # https://github.com/driesvints/dotfiles/issues/20
37 | # brew 'trash'
38 | # brew 'tree'
39 | # brew 'screen'
40 | # brew 'nano'
41 | brew 'zsh'
42 | brew 'zsh-completions'
43 | # brew 'tmux'
44 | # brew 'imagemagick'
45 | # brew 'jq'
46 | # brew 'autoconf'
47 | # brew 'automake'
48 | # brew 'autossh'
49 | # brew 'gcc'
50 | # brew 'cmake'
51 | # brew 'go'
52 | # brew 'jpeg'
53 | # brew 'optipng'
54 | # brew 'redis'
55 | # brew 'freetype'
56 |
57 | # brew 'lame'
58 | # brew 'x264'
59 | # brew 'xvid'
60 | # brew 'ffmpeg'
61 | # brew 'readline'
62 | # brew 'libyaml'
63 | # brew 'xz'
64 |
65 | # brew 'p7zip'
66 | # brew 'pigz'
67 |
68 | brew 'pipenv'
69 | brew 'python'
70 | brew 'node'
71 | brew 'nvm'
72 | brew 'rbenv'
73 | brew 'ruby'
74 | brew 'ruby-build'
75 | cask 'java'
76 | brew 'unrar'
77 | brew 'upx'
78 | brew 'wget'
79 | brew 'curl'
80 | brew 'htop'
81 | brew 'stow'
82 | brew 'cowsay'
83 |
84 | brew 'yarn'
85 |
86 | brew 'streamlink'
87 | brew 'tree'
88 | brew 'autojump'
89 | brew 'vim', args: ['override-system-vi']
90 | brew 'neovim'
91 | brew 'mc'
92 | # brew 'colorls'
93 | brew 'exa'
94 |
95 | # brew 'nmap'
96 | # brew 'npm'
97 | # brew 'openssl'
98 | # brew 'httpie'
99 | # brew 'qt'
100 | # brew 'pcre'
101 | # brew 'passenger'
102 | # brew 'peco'
103 | # brew 'fzf'
104 | # brew 'findutils'
105 | # brew 'z'
106 | # brew 'highlight'
107 | # brew 'docker'
108 | # brew 'docker-compose'
109 | # brew 'docker-machine'
110 |
111 | # brew 'mysql'
112 | # brew 'postgresql'
113 | # brew 'sqlite3'
114 |
115 | # cask 'osxfuse'
116 | # cask 'xquartz'
117 | cask 'kitematic'
118 | # cask 'postman'
119 | # cask 'qlcolorcode'
120 | # cask 'qlimagesize'
121 | # cask 'qlmarkdown'
122 | # cask 'qlstephen'
123 | # cask 'quicklook-csv'
124 | # cask 'quicklook-json'
125 | # cask 'sip'
126 | # cask 'postgres'
127 | # cask 'aerial'
128 | cask 'alfred'
129 | # cask 'dictionaries'
130 | # cask 'bartender'
131 | # cask 'caffeine'
132 | # cask 'discord'
133 | # cask 'docker'
134 | # cask 'dropbox'
135 | # cask 'gpg-suite'
136 | # cask 'insomnia'
137 |
138 | # brew 'sfnt2woff'
139 | # brew 'sfnt2woff-zopfli'
140 | # brew 'woff2'
141 |
142 | cask 'now'
143 | cask 'framer'
144 | # cask 'nucleo'
145 | cask 'figma'
146 | # cask 'steam'
147 | cask 'teamviewer'
148 | # cask 'sequel-pro'
149 | cask 'tableplus'
150 |
151 | cask 'macdown'
152 | cask 'notion'
153 | cask 'boostnote'
154 |
155 | # cask 'firefox'
156 | cask 'google-backup-and-sync'
157 | cask 'google-chrome'
158 | # cask 'opera'
159 | cask 'tor-browser'
160 |
161 | # cask 'tunnelbear'
162 | # cask 'transmission'
163 |
164 | # cask 'skype'
165 | cask 'zoomus'
166 | cask 'telegram'
167 | cask 'telegram-desktop'
168 | # cask 'gitter'
169 |
170 | cask 'vlc'
171 | # cask 'spark'
172 | # cask 'handbrake'
173 |
174 | # cask 'hazel'
175 | # cask 'focus'
176 | # cask 'spectacle'
177 | # cask 'bettertouchtool'
178 | # cask 'istat-menus'
179 | # cask 'dropbox'
180 | # cask 'google-drive-file-stream'
181 | # cask 'google-photos-backup-and-sync'
182 |
183 | # cask 'vagrant'
184 | # cask 'virtualbox'
185 | # cask 'virtualbox-extension-pack'
186 | # cask 'genymotion'
187 | # cask 'monodraw'
188 |
189 | cask 'moom'
190 |
191 |
192 | cask 'tower2'
193 | cask 'sourcetree'
194 | # cask 'hyper'
195 | cask 'iterm2'
196 | cask 'visual-studio-code'
197 | cask 'visual-studio-code-insider'
198 |
199 | # cask 'qlcolorcode'
200 | # cask 'qlstephen'
201 | # cask 'qlmarkdown'
202 | # cask 'quicklook-json'
203 | # cask 'qlprettypatch'
204 | # cask 'quicklook-csv'
205 | # cask 'webpquicklook'
206 | cask 'suspicious-package'
207 |
208 | cask 'font-lato'
209 | cask 'font-open-sans'
210 | cask 'font-roboto'
211 | cask 'font-source-code-pro-for-powerline'
212 | cask 'font-source-code-pro'
213 | cask 'font-source-sans-pro'
214 | cask 'font-source-serif-pro'
215 | cask 'font-meslo-nerd-font'
216 | cask 'font-fira-code'
217 |
218 | cask 'font-firacode-nerd-font'
219 | cask 'font-hack-nerd-font'
220 | cask 'font-iosevka-nerd-font'
221 |
222 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Dotfiles
2 |
3 | My awesome configs. Work in progress.
4 |
5 | ## Terminal
6 |
7 | Oh my zsh, zgen, powerlevel9k prompt, a lot of [useful plugins](https://github.com/andreystarkov/dotfiles/blob/master/zsh/zgen_setup.zsh)
8 |
9 | 
10 |
11 | ## Vim/Nvim
12 |
13 | Vim-Plug with [some plugins](https://github.com/andreystarkov/dotfiles/blob/master/nvim/init.vim)
14 |
15 | 
16 |
17 | ## macOS
18 |
19 | - List of clis/apps/libs/fonts at [Brewfile](https://github.com/andreystarkov/dotfiles/blob/master/Brewfile)
20 | - OS tweaks & settings at [shell script](https://github.com/andreystarkov/dotfiles/blob/master/mac/settings-default.sh)
21 |
22 | ## VSCode
23 |
24 | - Core [settings](https://github.com/andreystarkov/dotfiles/blob/master/vscode/settings.json)
25 | - [Plugins & themes](https://github.com/andreystarkov/dotfiles/blob/master/vscode/extensions.json)
26 | - Sync settings [configuration gist](https://gist.github.com/andreystarkov/c5e523ad67b6f416fe2fab36007aad59)
27 |
28 | ## Quick start
29 |
30 | ```bash
31 | git clone https://github.com/andreystarkov/dotfiles ~/.dotfiles
32 | cd ~/.dotfiles
33 | bash ./setup.sh
34 | ```
35 |
--------------------------------------------------------------------------------
/assets/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andreystarkov/dotfiles/27f7f41c44df39cf5e239ec6cc66506f2bd864f0/assets/1.png
--------------------------------------------------------------------------------
/assets/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andreystarkov/dotfiles/27f7f41c44df39cf5e239ec6cc66506f2bd864f0/assets/2.png
--------------------------------------------------------------------------------
/colorls/colorls_colors.yaml:
--------------------------------------------------------------------------------
1 | # https://github.com/sickill/rainbow#color-list
2 | # Main Colors
3 | unrecognized_file: gold
4 | recognized_file: lime
5 | dir: aliceblue
6 |
7 | # Link
8 | dead_link: red
9 | link: cyan
10 |
11 | # Access Modes
12 | write: darkkhaki
13 | read: limegreen
14 | exec: red
15 | no_access: indianred
16 |
17 | # Age
18 | day_old: mediumspringgreen
19 | hour_old: lime
20 | no_modifier: seagreen
21 |
22 | # File Size
23 | file_large: orange
24 | file_medium: gold
25 | file_small: peachpuff
26 |
27 | # Random
28 | report: white
29 | user: moccasin
30 | tree: cyan
31 | empty: yellow
32 | error: red
33 | normal: darkkhaki
34 |
35 | # Git
36 | addition: chartreuse
37 | modification: darkkhaki
38 | deletion: darkred
39 | untracked: darkorange
40 | unchanged: forestgreen
--------------------------------------------------------------------------------
/colorls/colorls_files.yaml:
--------------------------------------------------------------------------------
1 | ai: "\ue7b4"
2 | android: "\ue70e"
3 | apple: "\uf179"
4 | audio: "\uf001"
5 | avro: "\ue60b"
6 | c: "\ue61e"
7 | clj: "\ue768"
8 | coffee: "\uf0f4"
9 | conf: "\ue615"
10 | cpp: "\ue61d"
11 | css: "\ue749"
12 | d: "\ue7af"
13 | dart: "\ue798"
14 | db: "\uf1c0"
15 | diff: "\uf440"
16 | doc: "\uf1c2"
17 | ebook: "\ue28b"
18 | env: "\uf462"
19 | epub: "\ue28a"
20 | erl: "\ue7b1"
21 | file: "\uf15b"
22 | font: "\uf031"
23 | gform: "\uf298"
24 | git: "\uf1d3"
25 | go: "\ue626"
26 | gruntfile.js: "\ue74c"
27 | hs: "\ue777"
28 | html: "\uf13b"
29 | image: "\uf1c5"
30 | iml: "\ue7b5"
31 | java: "\ue204"
32 | js: "\ue74e"
33 | json: "\ue60b"
34 | jsx: "\ue7ba"
35 | less: "\ue758"
36 | log: "\uf18d"
37 | lua: "\ue620"
38 | md: "\uf48a"
39 | mustache: "\ue60f"
40 | npmignore: "\ue71e"
41 | pdf: "\uf1c1"
42 | php: "\ue73d"
43 | pl: "\ue769"
44 | ppt: "\uf1c4"
45 | psd: "\ue7b8"
46 | py: "\ue606"
47 | r: "\uf25d"
48 | rb: "\ue21e"
49 | rdb: "\ue76d"
50 | rss: "\uf09e"
51 | rubydoc: "\ue73b"
52 | sass: "\ue603"
53 | scala: "\ue737"
54 | shell: "\uf489"
55 | sqlite3: "\ue7c4"
56 | styl: "\ue600"
57 | tex: "\ue600"
58 | ts: "\ue628"
59 | twig: "\ue61c"
60 | txt: "\uf15c"
61 | video: "\uf03d"
62 | vim: "\ue62b"
63 | windows: "\uf17a"
64 | xls: "\uf1c3"
65 | xml: "\ue619"
66 | yarn.lock: "\ue718"
67 | yml: "\uf481"
68 | zip: "\uf410"
69 |
--------------------------------------------------------------------------------
/colorls/dark_colors.yaml:
--------------------------------------------------------------------------------
1 | # Main Colors
2 | unrecognized_file: gold
3 | recognized_file: lime
4 | dir: dodgerblue
5 |
6 | # Link
7 | dead_link: red
8 | link: cyan
9 |
10 | # Access Modes
11 | write: darkkhaki
12 | read: limegreen
13 | exec: red
14 | no_access: indianred
15 |
16 | # Age
17 | day_old: mediumspringgreen
18 | hour_old: lime
19 | no_modifier: seagreen
20 |
21 | # File Size
22 | file_large: orange
23 | file_medium: gold
24 | file_small: peachpuff
25 |
26 | # Random
27 | report: white
28 | user: moccasin
29 | tree: cyan
30 | empty: yellow
31 | error: red
32 | normal: darkkhaki
33 |
34 | # Git
35 | addition: chartreuse
36 | modification: darkkhaki
37 | deletion: darkred
38 | untracked: darkorange
39 | unchanged: forestgreen
--------------------------------------------------------------------------------
/colorls/file_aliases.yaml:
--------------------------------------------------------------------------------
1 | apk: android
2 | gradle: android
3 | ds_store: apple
4 | localized: apple
5 | flac: audio
6 | m4a: audio
7 | mp3: audio
8 | ogg: audio
9 | wav: audio
10 | editorconfig: conf
11 | scss: css
12 | docx: doc
13 | gdoc: doc
14 | mobi: ebook
15 | eot: font
16 | otf: font
17 | ttf: font
18 | woff: font
19 | woff2: font
20 | gitconfig: git
21 | gitignore: git
22 | gitignore_global: git
23 | lhs: hs
24 | bmp: image
25 | gif: image
26 | ico: image
27 | jpeg: image
28 | jpg: image
29 | png: image
30 | pxm: image
31 | svg: image
32 | tiff: image
33 | webp: image
34 | jar: java
35 | properties: json
36 | tsx: jsx
37 | license: md
38 | markdown: md
39 | mkd: md
40 | rdoc: md
41 | readme: md
42 | gslides: ppt
43 | pptx: ppt
44 | ipynb: py
45 | pyc: py
46 | rdata: r
47 | rds: r
48 | gemfile: rb
49 | gemspec: rb
50 | guardfile: rb
51 | lock: rb
52 | procfile: rb
53 | rakefile: rb
54 | rspec: rb
55 | rspec_parallel: rb
56 | rspec_status: rb
57 | ru: rb
58 | erb: rubydoc
59 | slim: rubydoc
60 | bash: shell
61 | bash_history: shell
62 | bash_profile: shell
63 | bashrc: shell
64 | fish: shell
65 | sh: shell
66 | zsh: shell
67 | zsh-theme: shell
68 | zshrc: shell
69 | stylus: styl
70 | cls: tex
71 | avi: video
72 | flv: video
73 | mkv: video
74 | mov: video
75 | mp4: video
76 | ogv: video
77 | webm: video
78 | bat: windows
79 | exe: windows
80 | ini: windows
81 | csv: xls
82 | gsheet: xls
83 | xlsx: xls
84 | xul: xml
85 | yaml: yml
86 | gz: zip
87 | rar: zip
88 | tar: zip
89 |
--------------------------------------------------------------------------------
/colorls/files.yaml:
--------------------------------------------------------------------------------
1 | ai: "\ue7b4"
2 | android: "\ue70e"
3 | apple: "\uf179"
4 | audio: "\uf001"
5 | avro: "\ue60b"
6 | c: "\ue61e"
7 | clj: "\ue768"
8 | coffee: "\uf0f4"
9 | conf: "\ue615"
10 | cpp: "\ue61d"
11 | css: "\ue749"
12 | d: "\ue7af"
13 | dart: "\ue798"
14 | db: "\uf1c0"
15 | diff: "\uf440"
16 | doc: "\uf1c2"
17 | ebook: "\ue28b"
18 | env: "\uf462"
19 | epub: "\ue28a"
20 | erl: "\ue7b1"
21 | file: "\uf15b"
22 | font: "\uf031"
23 | gform: "\uf298"
24 | git: "\uf1d3"
25 | go: "\ue626"
26 | gruntfile.js: "\ue74c"
27 | hs: "\ue777"
28 | html: "\uf13b"
29 | image: "\uf1c5"
30 | iml: "\ue7b5"
31 | java: "\ue204"
32 | js: "\ue74e"
33 | json: "\ue60b"
34 | jsx: "\ue7ba"
35 | less: "\ue758"
36 | log: "\uf18d"
37 | lua: "\ue620"
38 | md: "\uf48a"
39 | mustache: "\ue60f"
40 | npmignore: "\ue71e"
41 | pdf: "\uf1c1"
42 | php: "\ue73d"
43 | pl: "\ue769"
44 | ppt: "\uf1c4"
45 | psd: "\ue7b8"
46 | py: "\ue606"
47 | r: "\uf25d"
48 | rb: "\ue21e"
49 | rdb: "\ue76d"
50 | rss: "\uf09e"
51 | rubydoc: "\ue73b"
52 | sass: "\ue603"
53 | scala: "\ue737"
54 | shell: "\uf489"
55 | sqlite3: "\ue7c4"
56 | styl: "\ue600"
57 | tex: "\ue600"
58 | ts: "\ue628"
59 | twig: "\ue61c"
60 | txt: "\uf15c"
61 | video: "\uf03d"
62 | vim: "\ue62b"
63 | windows: "\uf17a"
64 | xls: "\uf1c3"
65 | xml: "\ue619"
66 | yarn.lock: "\ue718"
67 | yml: "\uf481"
68 | zip: "\uf410"
69 |
--------------------------------------------------------------------------------
/colorls/folder_aliases.yaml:
--------------------------------------------------------------------------------
1 | bin: config
2 | include: config
--------------------------------------------------------------------------------
/colorls/folders.yaml:
--------------------------------------------------------------------------------
1 | .atom: "\ue764"
2 | .git: "\uf1d3"
3 | .github: "\uf408"
4 | .rvm: "\ue21e"
5 | .Trash: "\uf1f8"
6 | .vscode: "\ue70c"
7 | config: "\ue5fc"
8 | folder: "\uf115"
9 | hidden: "\uf023"
10 | lib: "\uf121"
11 | node_modules: "\ue718"
12 |
--------------------------------------------------------------------------------
/colorls/light_colors.yaml:
--------------------------------------------------------------------------------
1 | # Main Colors
2 | unrecognized_file: darkred
3 | recognized_file: darkgreen
4 | dir: navyblue
5 |
6 | # Link
7 | dead_link: red
8 | link: cyan
9 |
10 | # Access Modes
11 | write: red
12 | read: sienna
13 | exec: navyblue
14 | no_access: black
15 |
16 | # Age
17 | day_old: darkred
18 | hour_old: saddlebrown
19 | no_modifier: black
20 |
21 | # File Size
22 | file_large: darkred
23 | file_medium: saddlebrown
24 | file_small: black
25 |
26 | # Random
27 | report: black
28 | user: darkblue
29 | tree: cyan
30 | empty: yellow
31 | error: red
32 | normal: black
33 |
34 | # Git
35 | addition: chartreuse
36 | modification: darkkhaki
37 | deletion: darkred
38 | untracked: darkorange
39 | unchanged: darkgreen
--------------------------------------------------------------------------------
/fish/.gitignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andreystarkov/dotfiles/27f7f41c44df39cf5e239ec6cc66506f2bd864f0/fish/.gitignore
--------------------------------------------------------------------------------
/fish/bundle:
--------------------------------------------------------------------------------
1 | theme default
2 |
--------------------------------------------------------------------------------
/fish/channel:
--------------------------------------------------------------------------------
1 | stable
2 |
--------------------------------------------------------------------------------
/fish/completions/fisher.fish:
--------------------------------------------------------------------------------
1 | fisher complete
2 |
--------------------------------------------------------------------------------
/fish/completions/nvm.fish:
--------------------------------------------------------------------------------
1 | # NVM (https://github.com/creationix/nvm) completions for Fish shell
2 | # Inspired on (https://github.com/derekstavis/plugin-nvm)
3 |
4 | function __nvm_complete_ls_remote
5 | if not test "$__nvm_ls_remote"
6 | set -g __nvm_ls_remote (nvm ls-remote | grep -Po '(?:iojs-)?v[0-9]\.[0-9]\.[0-9]*')
7 | end
8 |
9 | printf "%s\n" $__nvm_ls_remote
10 | end
11 |
12 | function __nvm_complete_ls
13 | if not test "$__nvm_ls"
14 | set -g __nvm_ls (nvm ls | grep -Po '[[:space:]].\K(v[0-9]\.[0-9]\.[0-9]*)')
15 | end
16 |
17 | printf "%s\n" $__nvm_ls
18 | end
19 |
20 | #Install
21 | complete -f -c nvm -n '__fish_use_subcommand' -a 'install' -d 'Download and install a . Uses .nvmrc if available'
22 | complete -f -c nvm -n "__fish_seen_subcommand_from install" -a "(__nvm_complete_ls_remote)"
23 | complete -f -c nvm -n "__fish_seen_subcommand_from install" -l reinstall-packages-from= -d 'When installing, reinstall packages installed in '
24 | complete -f -c nvm -n "__fish_seen_subcommand_from install" -s s -d 'From source'
25 |
26 | #Use
27 | complete -f -c nvm -n '__fish_use_subcommand' -a 'use' -d 'Modify PATH to use . Uses .nvmrc if available'
28 | complete -f -c nvm -n "__fish_seen_subcommand_from use" -a "(__nvm_complete_ls)"
29 | complete -f -c nvm -n "__fish_seen_subcommand_from use" -l silent
30 |
31 | #Exec
32 | complete -f -c nvm -n '__fish_use_subcommand' -a 'exec' -d 'Run on . Uses .nvmrc if available'
33 | complete -f -c nvm -n "__fish_seen_subcommand_from exec" -a "(__nvm_complete_ls)"
34 | complete -f -c nvm -n "__fish_seen_subcommand_from exec" -l silent
35 |
36 | #Run
37 | complete -f -c nvm -n '__fish_use_subcommand' -a 'run' -d 'Run on . Uses .nvmrc if available'
38 | complete -f -c nvm -n "__fish_seen_subcommand_from run" -a "(__nvm_complete_ls)"
39 | complete -f -c nvm -n "__fish_seen_subcommand_from run" -l silent
40 |
41 |
42 | #Uninstall
43 | complete -f -c nvm -n '__fish_use_subcommand' -a 'uninstall' -d 'Uninstall a version'
44 | complete -f -c nvm -n "__fish_seen_subcommand_from uninstall" -a "(__nvm_complete_ls)"
45 |
46 | #Which
47 | complete -f -c nvm -n '__fish_use_subcommand' -a 'which' -d 'Display path to installed node version. Uses .nvmrc if available'
48 | complete -f -c nvm -n "__fish_seen_subcommand_from which" -a "(__nvm_complete_ls)"
49 |
50 | #Reinstall-Packages
51 | complete -f -c nvm -n '__fish_use_subcommand' -a 'reinstall-packages' -d 'Reinstall global `npm` packages contained in to current version'
52 | complete -f -c nvm -n "__fish_seen_subcommand_from reinstall-packages" -a "(__nvm_complete_ls)"
53 |
54 | #Completions
55 | complete -f -c nvm -n '__fish_use_subcommand' -a 'current' -d 'Display currently activated version'
56 | complete -f -c nvm -n '__fish_use_subcommand' -a 'ls' -d 'List installed versions'
57 | complete -f -c nvm -n '__fish_use_subcommand' -a 'ls-remote' -d 'List remote versions available for install'
58 | complete -f -c nvm -n '__fish_use_subcommand' -a 'version' -d 'Resolve the given description to a single local '
59 | complete -f -c nvm -n '__fish_use_subcommand' -a 'version-remote' -d 'Resolve the given description to a single remote '
60 | complete -f -c nvm -n '__fish_use_subcommand' -a 'deactivate' -d 'Undo effects of `nvm` on current shell'
61 | complete -f -c nvm -n '__fish_use_subcommand' -a 'alias' -d 'Show all aliases beginning with or set an alias named pointing to '
62 | complete -f -c nvm -n '__fish_use_subcommand' -a 'unalias' -d 'Deletes the alias named '
63 | complete -f -c nvm -n '__fish_use_subcommand' -a 'unload' -d 'Unload `nvm` from shell'
64 |
--------------------------------------------------------------------------------
/fish/fish_variables:
--------------------------------------------------------------------------------
1 | # This file contains fish universal variable definitions.
2 | # VERSION: 3.0
3 | SETUVAR FZF_DEFAULT_OPTS:\x2d\x2dheight\x2040\x25
4 | SETUVAR FZF_LEGACY_KEYBINDINGS:1
5 | SETUVAR FZF_PREVIEW_DIR_CMD:ls
6 | SETUVAR FZF_PREVIEW_FILE_CMD:head\x20\x2dn\x2010
7 | SETUVAR FZF_TMUX_HEIGHT:40\x25
8 | SETUVAR ZO_CMD:zo
9 | SETUVAR Z_CMD:z
10 | SETUVAR Z_DATA:/Users/deo/\x2elocal/share/z/data
11 | SETUVAR Z_DATA_DIR:/Users/deo/\x2elocal/share/z
12 | SETUVAR Z_EXCLUDE:/Users/deo
13 | SETUVAR __fish_init_2_39_8:\x1d
14 | SETUVAR __fish_init_2_3_0:\x1d
15 | SETUVAR __fish_init_3_x:\x1d
16 | SETUVAR fish_color_autosuggestion:555\x1ebrblack
17 | SETUVAR fish_color_cancel:\x2dr
18 | SETUVAR fish_color_command:005fd7
19 | SETUVAR fish_color_comment:990000
20 | SETUVAR fish_color_cwd:green
21 | SETUVAR fish_color_cwd_root:red
22 | SETUVAR fish_color_end:009900
23 | SETUVAR fish_color_error:ff0000
24 | SETUVAR fish_color_escape:00a6b2
25 | SETUVAR fish_color_history_current:\x2d\x2dbold
26 | SETUVAR fish_color_host:normal
27 | SETUVAR fish_color_match:\x2d\x2dbackground\x3dbrblue
28 | SETUVAR fish_color_normal:normal
29 | SETUVAR fish_color_operator:00a6b2
30 | SETUVAR fish_color_param:00afff
31 | SETUVAR fish_color_quote:999900
32 | SETUVAR fish_color_redirection:00afff
33 | SETUVAR fish_color_search_match:bryellow\x1e\x2d\x2dbackground\x3dbrblack
34 | SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack
35 | SETUVAR fish_color_user:brgreen
36 | SETUVAR fish_color_valid_path:\x2d\x2dunderline
37 | SETUVAR fish_greeting:Welcome\x20to\x20fish\x2c\x20the\x20friendly\x20interactive\x20shell
38 | SETUVAR fish_key_bindings:fish_default_key_bindings
39 | SETUVAR fish_pager_color_completion:\x1d
40 | SETUVAR fish_pager_color_description:B3A06D\x1eyellow
41 | SETUVAR fish_pager_color_prefix:white\x1e\x2d\x2dbold\x1e\x2d\x2dunderline
42 | SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan
43 | SETUVAR pisces_pairs:\x28\x2c\x29\x1e\x5b\x2c\x5d\x1e\x7b\x2c\x7d\x1e\x22\x2c\x22\x1e\x27\x2c\x27
44 |
--------------------------------------------------------------------------------
/fish/fishfile:
--------------------------------------------------------------------------------
1 | franciscolourenco/done
2 | matchai/spacefish
3 | jorgebucaran/fish-getopts
4 | jethrokuan/z
5 | jorgebucaran/fish-spark
6 | rodrigobdz/fish-apple-touchbar
7 | danhper/fish-ssh-agent
8 | edc/bass
9 | jorgebucaran/fish-bax
10 | jethrokuan/fzf
11 | laughedelic/pisces
12 | oh-my-fish/plugin-bang-bang
13 | brigand/fast-nvm-fish
14 | FabioAntunes/fish-nvm
15 |
--------------------------------------------------------------------------------
/fish/functions/fisher.fish:
--------------------------------------------------------------------------------
1 | set -g fisher_version 3.2.8
2 |
3 | function fisher -a cmd -d "fish package manager"
4 | set -q XDG_CACHE_HOME; or set XDG_CACHE_HOME ~/.cache
5 | set -q XDG_CONFIG_HOME; or set XDG_CONFIG_HOME ~/.config
6 |
7 | set -g fish_config $XDG_CONFIG_HOME/fish
8 | set -g fisher_cache $XDG_CACHE_HOME/fisher
9 | set -g fisher_config $XDG_CONFIG_HOME/fisher
10 |
11 | set -q fisher_path; or set -g fisher_path $fish_config
12 |
13 | for path in {$fish_config,$fisher_path}/{functions,completions,conf.d} $fisher_cache
14 | if test ! -d $path
15 | command mkdir -p $path
16 | end
17 | end
18 |
19 | if test ! -e $fisher_path/completions/fisher.fish
20 | echo "fisher complete" >$fisher_path/completions/fisher.fish
21 | _fisher_complete
22 | end
23 |
24 | if test -e $fisher_path/conf.d/fisher.fish
25 | switch "$version"
26 | case \*-\*
27 | command rm -f $fisher_path/conf.d/fisher.fish
28 | case 2\*
29 | case \*
30 | command rm -f $fisher_path/conf.d/fisher.fish
31 | end
32 | else
33 | switch "$version"
34 | case \*-\*
35 | case 2\*
36 | echo "fisher copy-user-key-bindings" >$fisher_path/conf.d/fisher.fish
37 | end
38 | end
39 |
40 | switch "$cmd"
41 | case {,self-}complete
42 | _fisher_complete
43 | case copy-user-key-bindings
44 | _fisher_copy_user_key_bindings
45 | case ls
46 | set -e argv[1]
47 | if test -s "$fisher_path/fishfile"
48 | set -l file (_fisher_fmt <$fisher_path/fishfile | _fisher_parse -R | command sed "s|@.*||")
49 | _fisher_ls | _fisher_fmt | command awk -v FILE="$file" "
50 | BEGIN { for (n = split(FILE, f); ++i <= n;) file[f[i]] } \$0 in file && /$argv[1]/
51 | " | command sed "s|^$HOME|~|"
52 | end
53 | case self-update
54 | _fisher_self_update (status -f)
55 | case self-uninstall
56 | _fisher_self_uninstall
57 | case {,-}-v{ersion,}
58 | echo "fisher version $fisher_version" (status -f | command sed "s|^$HOME|~|")
59 | case {,-}-h{elp,}
60 | _fisher_help
61 | case ""
62 | _fisher_commit --
63 | case add rm
64 | if not isatty
65 | while read -l arg
66 | set argv $argv $arg
67 | end
68 | end
69 |
70 | if test (count $argv) = 1
71 | echo "fisher: invalid number of arguments" >&2
72 | _fisher_help >&2
73 | return 1
74 | end
75 |
76 | _fisher_commit $argv
77 | case \*
78 | echo "fisher: unknown flag or command \"$cmd\"" >&2
79 | _fisher_help >&2
80 | return 1
81 | end
82 | end
83 |
84 | function _fisher_complete
85 | complete -ec fisher
86 | complete -xc fisher -n __fish_use_subcommand -a add -d "Add packages"
87 | complete -xc fisher -n __fish_use_subcommand -a rm -d "Remove packages"
88 | complete -xc fisher -n __fish_use_subcommand -a ls -d "List installed packages matching REGEX"
89 | complete -xc fisher -n __fish_use_subcommand -a --help -d "Show usage help"
90 | complete -xc fisher -n __fish_use_subcommand -a --version -d "$fisher_version"
91 | complete -xc fisher -n __fish_use_subcommand -a self-update -d "Update to the latest version"
92 | for pkg in (fisher ls)
93 | complete -xc fisher -n "__fish_seen_subcommand_from rm" -a $pkg
94 | end
95 | end
96 |
97 | function _fisher_copy_user_key_bindings
98 | if functions -q fish_user_key_bindings
99 | functions -c fish_user_key_bindings fish_user_key_bindings_copy
100 | end
101 | function fish_user_key_bindings
102 | for file in $fisher_path/conf.d/*_key_bindings.fish
103 | source $file >/dev/null 2>/dev/null
104 | end
105 | if functions -q fish_user_key_bindings_copy
106 | fish_user_key_bindings_copy
107 | end
108 | end
109 | end
110 |
111 | function _fisher_ls
112 | for pkg in $fisher_config/*/*/*
113 | command readlink $pkg; or echo $pkg
114 | end
115 | end
116 |
117 | function _fisher_fmt
118 | command sed "s|^[[:space:]]*||;s|^$fisher_config/||;s|^~|$HOME|;s|^\.\/*|$PWD/|;s|^github\.com/||;s|^https*:/*||;s|/*\$||"
119 | end
120 |
121 | function _fisher_help
122 | echo "usage: fisher add Add packages"
123 | echo " fisher rm Remove packages"
124 | echo " fisher Update all packages"
125 | echo " fisher ls [] List installed packages matching "
126 | echo " fisher --help Show this help"
127 | echo " fisher --version Show the current version"
128 | echo " fisher self-update Update to the latest version"
129 | echo " fisher self-uninstall Uninstall from your system"
130 | echo "examples:"
131 | echo " fisher add jethrokuan/z rafaelrinaldi/pure"
132 | echo " fisher add gitlab.com/foo/bar@v2"
133 | echo " fisher add ~/path/to/local/pkg"
134 | echo " fisher add &2
143 | command curl -s "$url?nocache" >$file.
144 |
145 | set -l next_version (command awk '{ print $4 } { exit }' <$file.)
146 | switch "$next_version"
147 | case "" $fisher_version
148 | command rm -f $file.
149 | if test -z "$next_version"
150 | echo "fisher: cannot update fisher -- are you offline?" >&2
151 | return 1
152 | end
153 | echo "fisher is already up-to-date" >&2
154 | case \*
155 | echo "linking $file" | command sed "s|$HOME|~|" >&2
156 | command mv -f $file. $file
157 | source $file
158 | echo "updated to fisher $fisher_version -- hooray!" >&2
159 | _fisher_complete
160 | end
161 | end
162 |
163 | function _fisher_self_uninstall
164 | for pkg in (_fisher_ls)
165 | _fisher_rm $pkg
166 | end
167 |
168 | for file in $fisher_cache $fisher_config $fisher_path/{functions,completions,conf.d}/fisher.fish $fisher_path/fishfile
169 | echo "removing $file"
170 | command rm -Rf $file 2>/dev/null
171 | end | command sed "s|$HOME|~|" >&2
172 |
173 | for name in (set -n | command awk '/^fisher_/')
174 | set -e "$name"
175 | end
176 |
177 | functions -e (functions -a | command awk '/^_fisher/') fisher
178 | complete -c fisher --erase
179 | end
180 |
181 | function _fisher_commit -a cmd
182 | set -e argv[1]
183 | set -l elapsed (_fisher_now)
184 | set -l fishfile $fisher_path/fishfile
185 |
186 | if test ! -e "$fishfile"
187 | command touch $fishfile
188 | echo "created new fishfile in $fishfile" | command sed "s|$HOME|~|" >&2
189 | end
190 |
191 | set -l old_pkgs (_fisher_ls | _fisher_fmt)
192 | for pkg in (_fisher_ls)
193 | _fisher_rm $pkg
194 | end
195 | command rm -Rf $fisher_config
196 | command mkdir -p $fisher_config
197 |
198 | set -l next_pkgs (_fisher_fmt <$fishfile | _fisher_parse -R $cmd (printf "%s\n" $argv | _fisher_fmt))
199 | set -l actual_pkgs (_fisher_fetch $next_pkgs)
200 | set -l updated_pkgs
201 | for pkg in $old_pkgs
202 | if contains -- $pkg $actual_pkgs
203 | set updated_pkgs $updated_pkgs $pkg
204 | end
205 | end
206 |
207 | if test -z "$actual_pkgs$updated_pkgs$old_pkgs$next_pkgs"
208 | echo "fisher: nothing to commit -- try adding some packages" >&2
209 | return 1
210 | end
211 |
212 | set -l out_pkgs
213 | if test "$cmd" = "rm"
214 | set out_pkgs $next_pkgs
215 | else
216 | for pkg in $next_pkgs
217 | if contains -- (echo $pkg | command sed "s|@.*||") $actual_pkgs
218 | set out_pkgs $out_pkgs $pkg
219 | end
220 | end
221 | end
222 |
223 | printf "%s\n" (_fisher_fmt <$fishfile | _fisher_parse -W $cmd $out_pkgs | command sed "s|^$HOME|~|") >$fishfile
224 |
225 | _fisher_complete
226 |
227 | command awk -v A=(count $actual_pkgs) -v U=(count $updated_pkgs) -v O=(count $old_pkgs) -v E=(_fisher_now $elapsed) '
228 | BEGIN {
229 | res = fmt("removed", O - U, fmt("updated", U, fmt("added", A - U)))
230 | printf((res ? res : "done") " in %.2fs\n", E / 1000)
231 | }
232 | function fmt(action, n, s) {
233 | return n ? (s ? s ", " : s) action " " n " package" (n > 1 ? "s" : "") : s
234 | }
235 | ' >&2
236 | end
237 |
238 | function _fisher_parse -a mode cmd
239 | set -e argv[1..2]
240 | command awk -v FS="[[:space:]]*#+" -v MODE="$mode" -v CMD="$cmd" -v ARGSTR="$argv" '
241 | BEGIN {
242 | for (n = split(ARGSTR, a, " "); i++ < n;) pkgs[getkey(a[i])] = a[i]
243 | }
244 | !NF { next } { k = getkey($1) }
245 | MODE == "-R" && !(k in pkgs) && $0 = $1
246 | MODE == "-W" && (/^#/ || k in pkgs || CMD != "rm") { print pkgs[k] (sub($1, "") ? $0 : "") }
247 | MODE == "-W" || CMD == "rm" { delete pkgs[k] }
248 | END {
249 | for (k in pkgs) {
250 | if (CMD != "rm" || MODE == "-W") print pkgs[k]
251 | else print "fisher: cannot remove \""k"\" -- package is not in fishfile" > "/dev/stderr"
252 | }
253 | }
254 | function getkey(s, a) {
255 | return (split(s, a, /@+|:/) > 2) ? a[2]"/"a[1]"/"a[3] : a[1]
256 | }
257 | '
258 | end
259 |
260 | function _fisher_fetch
261 | set -l pkg_jobs
262 | set -l out_pkgs
263 | set -l next_pkgs
264 | set -l local_pkgs
265 | set -q fisher_user_api_token; and set -l curl_opts -u $fisher_user_api_token
266 |
267 | for pkg in $argv
268 | switch $pkg
269 | case \~\* /\*
270 | set -l path (echo "$pkg" | command sed "s|^~|$HOME|")
271 | if test -e "$path"
272 | set local_pkgs $local_pkgs $path
273 | else
274 | echo "fisher: cannot add \"$pkg\" -- is this a valid file?" >&2
275 | end
276 | continue
277 | end
278 |
279 | command awk -v PKG="$pkg" -v FS=/ '
280 | BEGIN {
281 | if (split(PKG, tmp, /@+|:/) > 2) {
282 | if (tmp[4]) sub("@"tmp[4], "", PKG)
283 | print PKG "\t" tmp[2]"/"tmp[1]"/"tmp[3] "\t" (tmp[4] ? tmp[4] : "master")
284 | } else {
285 | pkg = split(PKG, _, "/") <= 2 ? "github.com/"tmp[1] : tmp[1]
286 | tag = tmp[2] ? tmp[2] : "master"
287 | print (\
288 | pkg ~ /^github/ ? "https://codeload."pkg"/tar.gz/"tag : \
289 | pkg ~ /^gitlab/ ? "https://"pkg"/-/archive/"tag"/"tmp[split(pkg, tmp, "/")]"-"tag".tar.gz" : \
290 | pkg ~ /^bitbucket/ ? "https://"pkg"/get/"tag".tar.gz" : pkg \
291 | ) "\t" pkg
292 | }
293 | }
294 | ' | read -l url pkg branch
295 |
296 | if test ! -d "$fisher_config/$pkg"
297 | fish -c "
298 | echo fetching $url >&2
299 | command mkdir -p $fisher_config/$pkg $fisher_cache/(command dirname $pkg)
300 | if test ! -z \"$branch\"
301 | command git clone $url $fisher_config/$pkg --branch $branch --depth 1 2>/dev/null
302 | or echo fisher: cannot clone \"$url\" -- is this a valid url\? >&2
303 | else if command curl $curl_opts -Ss -w \"\" $url 2>&1 | command tar -xzf- -C $fisher_config/$pkg 2>/dev/null
304 | command rm -Rf $fisher_cache/$pkg
305 | command mv -f $fisher_config/$pkg/* $fisher_cache/$pkg
306 | command rm -Rf $fisher_config/$pkg
307 | command cp -Rf {$fisher_cache,$fisher_config}/$pkg
308 | else if test -d \"$fisher_cache/$pkg\"
309 | echo fisher: cannot connect to server -- looking in \"$fisher_cache/$pkg\" | command sed 's|$HOME|~|' >&2
310 | command cp -Rf $fisher_cache/$pkg $fisher_config/$pkg/..
311 | else
312 | command rm -Rf $fisher_config/$pkg
313 | echo fisher: cannot add \"$pkg\" -- is this a valid package\? >&2
314 | end
315 | " >/dev/null &
316 | set pkg_jobs $pkg_jobs (_fisher_jobs --last)
317 | set next_pkgs $next_pkgs "$fisher_config/$pkg"
318 | end
319 | end
320 |
321 | if set -q pkg_jobs[1]
322 | while for job in $pkg_jobs
323 | contains -- $job (_fisher_jobs); and break
324 | end
325 | end
326 | for pkg in $next_pkgs
327 | if test -d "$pkg"
328 | set out_pkgs $out_pkgs $pkg
329 | _fisher_add $pkg
330 | end
331 | end
332 | end
333 |
334 | set -l local_prefix $fisher_config/local/$USER
335 | if test ! -d "$local_prefix"
336 | command mkdir -p $local_prefix
337 | end
338 | for pkg in $local_pkgs
339 | set -l target $local_prefix/(command basename $pkg)
340 | if test ! -L "$target"
341 | command ln -sf $pkg $target
342 | set out_pkgs $out_pkgs $pkg
343 | _fisher_add $pkg --link
344 | end
345 | end
346 |
347 | if set -q out_pkgs[1]
348 | _fisher_fetch (
349 | for pkg in $out_pkgs
350 | if test -s "$pkg/fishfile"
351 | _fisher_fmt <$pkg/fishfile | _fisher_parse -R
352 | end
353 | end)
354 | printf "%s\n" $out_pkgs | _fisher_fmt
355 | end
356 | end
357 |
358 | function _fisher_add -a pkg opts
359 | for src in $pkg/{functions,completions,conf.d}/**.* $pkg/*.fish
360 | set -l target (command basename $src)
361 | switch $src
362 | case $pkg/conf.d\*
363 | set target $fisher_path/conf.d/$target
364 | case $pkg/completions\*
365 | set target $fisher_path/completions/$target
366 | case $pkg/{functions,}\*
367 | switch $target
368 | case uninstall.fish
369 | continue
370 | case {init,key_bindings}.fish
371 | set target $fisher_path/conf.d/(command basename $pkg)\_$target
372 | case \*
373 | set target $fisher_path/functions/$target
374 | end
375 | end
376 | echo "linking $target" | command sed "s|$HOME|~|" >&2
377 | if set -q opts[1]
378 | command ln -sf $src $target
379 | else
380 | command cp -f $src $target
381 | end
382 | switch $target
383 | case \*.fish
384 | source $target >/dev/null 2>/dev/null
385 | end
386 | end
387 | end
388 |
389 | function _fisher_rm -a pkg
390 | for src in $pkg/{conf.d,completions,functions}/**.* $pkg/*.fish
391 | set -l target (command basename $src)
392 | set -l filename (command basename $target .fish)
393 | switch $src
394 | case $pkg/conf.d\*
395 | test "$filename.fish" = "$target"; and emit "$filename"_uninstall
396 | set target conf.d/$target
397 | case $pkg/completions\*
398 | test "$filename.fish" = "$target"; and complete -ec $filename
399 | set target completions/$target
400 | case $pkg/{,functions}\*
401 | test "$filename.fish" = "$target"; and functions -e $filename
402 | switch $target
403 | case uninstall.fish
404 | source $src
405 | continue
406 | case {init,key_bindings}.fish
407 | set target conf.d/(command basename $pkg)\_$target
408 | case \*
409 | set target functions/$target
410 | end
411 | end
412 | command rm -f $fisher_path/$target
413 | end
414 | if not functions -q fish_prompt
415 | source "$__fish_datadir$__fish_data_dir/functions/fish_prompt.fish"
416 | end
417 | end
418 |
419 | function _fisher_jobs
420 | jobs $argv | command awk '/^[0-9]+\t/ { print $1 }'
421 | end
422 |
423 | function _fisher_now -a elapsed
424 | switch (command uname)
425 | case Darwin \*BSD
426 | command perl -MTime::HiRes -e 'printf("%.0f\n", (Time::HiRes::time() * 1000) - $ARGV[0])' $elapsed
427 | case \*
428 | math (command date "+%s%3N") - "0$elapsed"
429 | end
430 | end
431 |
--------------------------------------------------------------------------------
/fish/functions/fundle.fish:
--------------------------------------------------------------------------------
1 | set __fundle_current_version '0.7.0'
2 |
3 | function __fundle_seq -a upto
4 | seq 1 1 $upto 2>/dev/null
5 | end
6 |
7 | function __fundle_next_arg -a index
8 | set -l args $argv[2..-1]
9 | set -l arg_index (math $index + 1)
10 | if test (count $args) -lt $arg_index
11 | echo "missing argument for $args[$index]"
12 | return 1
13 | end
14 | set -l arg $args[$arg_index]
15 | switch $arg
16 | case '--*'
17 | echo "expected argument for $args[$index], got $arg"; and return 1
18 | case '*'
19 | echo $arg; and return 0
20 | end
21 | end
22 |
23 | function __fundle_compare_versions -a version1 -a version2
24 | for i in (__fundle_seq 4)
25 | set -l v1 (echo $version1 | cut -d '.' -f $i | sed -Ee 's/[a-z]+//g')
26 | set -l v2 (echo $version2 | cut -d '.' -f $i | sed -Ee 's/[a-z]+//g')
27 | if test \( -n $v1 -a -z $v2 \) -o \( -n $v1 -a -n $v2 -a $v1 -lt $v2 \)
28 | echo -n "lt"; and return 0
29 | else if test \( -z $v1 -a -n $v2 \) -o \( -n $v1 -a -n $v2 -a $v1 -gt $v2 \)
30 | echo -n "gt"; and return 0
31 | end
32 | end
33 | echo -n "eq"; and return 0
34 | end
35 |
36 | function __fundle_date -d "returns a date"
37 | set -l d (date +%s%N)
38 | if echo $d | string match -rvq 'N'
39 | echo $d
40 | else
41 | gdate +%s%N
42 | end
43 | return 0
44 | end
45 |
46 | function __fundle_self_update -d "updates fundle"
47 | set -l fundle_repo_url "https://github.com/tuvistavie/fundle.git"
48 | # This `sed` stays for now since doing it easily with `string` requires "--filter", which is only in 2.6.0
49 | set -l latest (command git ls-remote --tags $fundle_repo_url | sed -n -e 's|.*refs/tags/v\(.*\)|\1|p' | tail -n 1)
50 | if test (__fundle_compare_versions $latest (__fundle_version)) != "gt"
51 | echo "fundle is already up to date"; and return 0
52 | else
53 | set -l file_url_template 'https://raw.githubusercontent.com/tuvistavie/fundle/VERSION/functions/fundle.fish'
54 | set -l file_url (string replace 'VERSION' -- "v$latest" $file_url_template)
55 | set -l tmp_file (mktemp /tmp/fundle.XXX)
56 | set -l update_message "fundle has been updated to version $latest"
57 | curl -Ls $file_url > $tmp_file; and mv $tmp_file (status -f); and echo $update_message; and return 0
58 | end
59 | end
60 |
61 | function __fundle_url_rev -d "prints the revision from the url" -a git_url
62 | set -l rev (echo $git_url | cut -d '#' -f 2 -s)
63 | if test -n "$rev"
64 | echo $rev
65 | else
66 | echo master
67 | end
68 | end
69 |
70 | function __fundle_remote_url -d "prints the remote url from the full git url" -a git_url
71 | echo $git_url | cut -d '#' -f 1
72 | end
73 |
74 | function __fundle_rev_parse -d "prints the revision if any" -a dir -a commitish
75 | set -l sha (command git --git-dir $dir rev-parse -q --verify $commitish 2>/dev/null)
76 | if test $status -eq 0
77 | echo -n $sha
78 | return 0
79 | end
80 | return 1
81 | end
82 |
83 | function __fundle_commit_sha -d "returns sha of the commit-ish" -a dir -a commitish
84 | if test -d "$dir/.git"
85 | set dir "$dir/.git"
86 | end
87 | if __fundle_rev_parse $dir "origin/$commitish"
88 | return 0
89 | end
90 | __fundle_rev_parse $dir $commitish
91 | end
92 |
93 | function __fundle_plugins_dir -d "returns fundle directory"
94 | if test -z "$fundle_plugins_dir"
95 | if test -n "$XDG_CONFIG_HOME"
96 | echo $XDG_CONFIG_HOME/fish/fundle
97 | else
98 | echo $HOME/.config/fish/fundle
99 | end
100 | else
101 | echo $fundle_plugins_dir
102 | end
103 | end
104 |
105 | function __fundle_no_git -d "check if git is installed"
106 | # `command -q` is >= 2.5.0
107 | if not command -s git > /dev/null 2>&1
108 | echo "git needs to be installed and in the path"
109 | return 0
110 | end
111 | return 1
112 | end
113 |
114 | function __fundle_check_date -d "check date"
115 | if date +%s%N | string match -rvq 'N'
116 | return 0
117 | end
118 | if command -s gdate > /dev/null 2>&1
119 | return 0
120 | end
121 | echo "You need to have a GNU date compliant date installed to use profiling. Use 'brew install coreutils' on OSX"
122 | return 1
123 | end
124 |
125 | function __fundle_get_url -d "returns the url for the given plugin" -a repo
126 | echo "https://github.com/$repo.git"
127 | end
128 |
129 |
130 | function __fundle_plugin_index -d "returns the index of the plugin" -a plugin
131 | for i in (__fundle_seq (count $__fundle_plugin_names))
132 | if test "$__fundle_plugin_names[$i]" = "$plugin"
133 | return $i
134 | end
135 | end
136 | # NOTE: should never reach this point
137 | echo "could not find plugin: $plugin"
138 | exit 1
139 | end
140 |
141 | function __fundle_checkout_revision -a plugin -a git_url
142 | set -l plugin_dir (__fundle_plugins_dir)/$plugin
143 | set -l git_dir $plugin_dir/.git
144 |
145 | set -l sha (__fundle_commit_sha $git_dir (__fundle_url_rev $git_url))
146 | if test $status -eq 0
147 | command git --git-dir="$git_dir" --work-tree="$plugin_dir" checkout -q -f $sha
148 | else
149 | echo "Could not checkout $plugin revision $sha"
150 | return 1
151 | end
152 | end
153 |
154 | function __fundle_update_plugin -d "update the given plugin" -a plugin -a git_url
155 | echo "Updating $plugin"
156 |
157 | set -l remote_url (__fundle_remote_url $git_url)
158 | set -l git_dir (__fundle_plugins_dir)/$plugin/.git
159 |
160 | command git --git-dir=$git_dir remote set-url origin $remote_url 2>/dev/null
161 | command git --git-dir=$git_dir fetch -q 2>/dev/null
162 |
163 | __fundle_checkout_revision $plugin $git_url
164 | end
165 |
166 | function __fundle_install_plugin -d "install the given plugin" -a plugin -a git_url
167 | if __fundle_no_git
168 | return 1
169 | end
170 |
171 | set -l plugin_dir (__fundle_plugins_dir)/$plugin
172 | set -l git_dir $plugin_dir/.git
173 | set -l remote_url (__fundle_remote_url $git_url)
174 |
175 | if test -d $plugin_dir
176 | echo "$argv[1] installed in $plugin_dir"
177 | return 0
178 | else
179 | echo "Installing $plugin"
180 | command git clone -q $remote_url $plugin_dir
181 | __fundle_checkout_revision $plugin $git_url
182 | end
183 | end
184 |
185 | function __fundle_update -d "update the given plugin, or all if unspecified" -a plugin
186 | if test -n "$plugin"; and test ! -d (__fundle_plugins_dir)/$plugin/.git
187 | echo "$plugin not installed. You may need to run 'fundle install'"
188 | return 1
189 | end
190 |
191 | if test -n "$plugin"
192 | set -l index (__fundle_plugin_index $plugin)
193 | __fundle_update_plugin "$plugin" $__fundle_plugin_urls[$index]
194 | else
195 | for i in (__fundle_seq (count $__fundle_plugin_names))
196 | __fundle_update_plugin $__fundle_plugin_names[$i] $__fundle_plugin_urls[$i]
197 | end
198 | end
199 | end
200 |
201 | function __fundle_show_doc_msg -d "show a link to fundle docs"
202 | if test (count $argv) -ge 1
203 | echo $argv
204 | end
205 | echo "See the docs for more info. https://github.com/tuvistavie/fundle"
206 | end
207 |
208 | function __fundle_load_plugin -a plugin -a path -a fundle_dir -a profile -d "load a plugin"
209 | if begin; set -q __fundle_loaded_plugins; and contains $plugin $__fundle_loaded_plugins; end
210 | return 0
211 | end
212 |
213 | set -l plugin_dir (string replace -r '/.$' '' -- "$fundle_dir/$plugin/$path")
214 |
215 | if not test -d $plugin_dir
216 | __fundle_show_doc_msg "$plugin not installed. You may need to run 'fundle install'"
217 | return 0
218 | end
219 |
220 | # Take everything but "plugin-" from the last path component
221 | set -l plugin_name (string replace -r '.*/(plugin-)?(.*)$' '$2' -- $plugin)
222 | set -l init_file "$plugin_dir/init.fish"
223 | set -l conf_dir "$plugin_dir/conf.d"
224 | set -l bindings_file "$plugin_dir/key_bindings.fish"
225 | set -l functions_dir "$plugin_dir/functions"
226 | set -l completions_dir "$plugin_dir/completions"
227 | set -l plugin_paths $__fundle_plugin_name_paths
228 |
229 | if begin; test -d $functions_dir; and not contains $functions_dir $fish_function_path; end
230 | set fish_function_path $fish_function_path[1] $functions_dir $fish_function_path[2..-1]
231 | end
232 |
233 | if begin; test -d $completions_dir; and not contains $completions_dir $fish_complete_path; end
234 | set fish_complete_path $fish_complete_path[1] $completions_dir $fish_complete_path[2..-1]
235 | end
236 |
237 | if test -f $init_file
238 | source $init_file
239 | else if test -d $conf_dir
240 | # read all *.fish files in conf.d
241 | for f in $conf_dir/*.fish
242 | source $f
243 | end
244 | else
245 | # For compatibility with oh-my-fish themes, if there is no `init.fish` file in the plugin,
246 | # which is the case with themses, the root directory of the plugin is trerated as a functions
247 | # folder, so we include it in the `fish_function_path` variable.
248 | if not contains $plugin_dir $fish_function_path
249 | set fish_function_path $fish_function_path[1] $plugin_dir $fish_function_path[2..-1]
250 | end
251 | end
252 |
253 | if test -f $bindings_file
254 | set -g __fundle_binding_paths $bindings_file $__fundle_binding_paths
255 | end
256 |
257 | set -g __fundle_loaded_plugins $plugin $__fundle_loaded_plugins
258 |
259 | set -l dependencies (printf '%s\n' $plugin_paths $__fundle_plugin_name_paths | sort | uniq -u)
260 | for dependency in $dependencies
261 | set -l name_path (string split : -- $dependency)
262 | if test "$profile" -eq 1
263 | set -l start_time (__fundle_date +%s%N)
264 | __fundle_load_plugin $name_path[1] $name_path[2] $fundle_dir $profile
265 | set -l ellapsed_time (math \((__fundle_date +%s%N) - $start_time\) / 1000)
266 | echo "$name_path[1]": {$ellapsed_time}us
267 | else
268 | __fundle_load_plugin $name_path[1] $name_path[2] $fundle_dir $profile
269 | end
270 | end
271 |
272 | emit "init_$plugin_name" $plugin_dir
273 | end
274 |
275 | function __fundle_bind -d "set up bindings"
276 | if functions -q fish_user_key_bindings; and not functions -q __fish_user_key_bindings
277 | functions -c fish_user_key_bindings __fish_user_key_bindings
278 | end
279 |
280 | function fish_user_key_bindings
281 | for bindings in $__fundle_binding_paths
282 | source $bindings
283 | end
284 | if functions -q __fish_user_key_bindings
285 | __fish_user_key_bindings
286 | end
287 | end
288 | end
289 |
290 | function __fundle_init -d "initialize fundle"
291 | set -l fundle_dir (__fundle_plugins_dir)
292 |
293 | if test (count $__fundle_plugin_names) -eq 0
294 | __fundle_show_doc_msg "No plugin registered. You need to call 'fundle plugin NAME' before using 'fundle init'. \
295 |
296 | Try reloading your shell if you just edited your configuration."
297 | return 1
298 | end
299 |
300 | set -l profile 0
301 | if begin; contains -- -p $argv; or contains -- --profile $argv; and __fundle_check_date; end
302 | set profile 1
303 | end
304 |
305 | for name_path in $__fundle_plugin_name_paths
306 | set -l name_path (string split : -- $name_path)
307 | if test "$profile" -eq 1
308 | set -l start_time (__fundle_date +%s%N)
309 | __fundle_load_plugin $name_path[1] $name_path[2] $fundle_dir $profile
310 | set -l ellapsed_time (math \((__fundle_date +%s%N) - $start_time\) / 1000)
311 | echo "$name_path[1]": {$ellapsed_time}us
312 | else
313 | __fundle_load_plugin $name_path[1] $name_path[2] $fundle_dir $profile
314 | end
315 | end
316 |
317 | __fundle_bind
318 | end
319 |
320 | function __fundle_install -d "install plugin"
321 | if test (count $__fundle_plugin_names) -eq 0
322 | __fundle_show_doc_msg "No plugin registered. You need to call 'fundle plugin NAME' before using 'fundle install'"
323 | end
324 |
325 | for i in (__fundle_seq (count $__fundle_plugin_names))
326 | __fundle_install_plugin $__fundle_plugin_names[$i] $__fundle_plugin_urls[$i] $argv
327 | end
328 |
329 | set -l original_plugins_count (count (__fundle_list -s))
330 | __fundle_init
331 |
332 | # if plugins count increase after init, new plugins have dependencies
333 | # install new plugins dependencies if any
334 | if test (count (__fundle_list -s)) -gt $original_plugins_count
335 | __fundle_install $argv
336 | end
337 | end
338 |
339 | function __fundle_clean -d "cleans fundle directory"
340 | set -l fundle_dir (__fundle_plugins_dir)
341 | set -l used_plugins (__fundle_list -s)
342 | set -l installed_plugins $fundle_dir/*/*/
343 | for installed_plugin in $installed_plugins
344 | set -l plugin (string trim --chars="/" \
345 | (string replace -r -- "$fundle_dir" "" $installed_plugin))
346 | if not contains $plugin $used_plugins
347 | echo "Removing $plugin"
348 | rm -rf $fundle_dir/$plugin
349 | end
350 | end
351 | end
352 |
353 | function __fundle_plugin -d "add plugin to fundle" -a name
354 | set -l plugin_url ""
355 | set -l plugin_path "."
356 | set -l argv_count (count $argv)
357 | set -l skip_next true
358 | if test $argv_count -eq 0 -o -z "$argv"
359 | echo "usage: fundle plugin NAME [[--url] URL] [--path PATH]"
360 | return 1
361 | else if test $argv_count -gt 1
362 | for i in (__fundle_seq (count $argv))
363 | test $skip_next = true; and set skip_next false; and continue
364 | set -l arg $argv[$i]
365 | switch $arg
366 | case '--url'
367 | set plugin_url (__fundle_next_arg $i $argv)
368 | test $status -eq 1; and echo $plugin_url; and return 1
369 | set skip_next true
370 | case '--path'
371 | set plugin_path (__fundle_next_arg $i $argv)
372 | test $status -eq 1; and echo $plugin_path; and return 1
373 | set skip_next true
374 | case '--*'
375 | echo "unknown flag $arg"; and return 1
376 | case '*'
377 | test $i -ne 2; and echo "invalid argument $arg"; and return 1
378 | set plugin_url $arg
379 | end
380 | end
381 | end
382 | test -z "$plugin_url"; and set plugin_url (__fundle_get_url $name)
383 |
384 | if not contains $name $__fundle_plugin_names
385 | set -g __fundle_plugin_names $__fundle_plugin_names $name
386 | set -g __fundle_plugin_urls $__fundle_plugin_urls $plugin_url
387 | set -g __fundle_plugin_name_paths $__fundle_plugin_name_paths $name:$plugin_path
388 | end
389 | end
390 |
391 | function __fundle_version -d "prints fundle version"
392 | echo $__fundle_current_version
393 | end
394 |
395 | function __fundle_print_help -d "prints fundle help"
396 | echo "usage: fundle (init | plugin | list | install | update | clean | self-update | version | help)"
397 | end
398 |
399 | function __fundle_list -d "list registered plugins"
400 | if begin; contains -- -s $argv; or contains -- --short $argv; end
401 | for name in $__fundle_plugin_names
402 | echo $name
403 | end
404 | else
405 | for i in (__fundle_seq (count $__fundle_plugin_names))
406 | echo {$__fundle_plugin_names[$i]}\n\t{$__fundle_plugin_urls[$i]}
407 | end
408 | end
409 | end
410 |
411 | function fundle -d "run fundle"
412 | if __fundle_no_git
413 | return 1
414 | end
415 |
416 | set -l sub_args ""
417 |
418 | switch (count $argv)
419 | case 0
420 | __fundle_print_help
421 | return 1
422 | case 1
423 | case '*'
424 | set sub_args $argv[2..-1]
425 | end
426 |
427 | switch $argv[1]
428 | case "init"
429 | __fundle_init $sub_args
430 | case "plugin"
431 | __fundle_plugin $sub_args
432 | case "list"
433 | __fundle_list $sub_args
434 | case "plugins"
435 | echo "'fundle plugins' has been replaced by 'fundle list'"
436 | case "install"
437 | __fundle_install $sub_args
438 | case "update"
439 | __fundle_update $sub_args
440 | case "clean"
441 | __fundle_clean
442 | case "self-update"
443 | __fundle_self_update
444 | case "version" -v --version
445 | __fundle_version
446 | case "help" -h --help
447 | __fundle_print_help
448 | return 0
449 | case "*"
450 | __fundle_print_help
451 | return 1
452 | end
453 | end
454 |
--------------------------------------------------------------------------------
/fish/setup/fish-install.sh:
--------------------------------------------------------------------------------
1 | brew install fish --HEAD
2 | brew install gnu-sed
--------------------------------------------------------------------------------
/fish/setup/fish-setup.old.sh:
--------------------------------------------------------------------------------
1 | rm -rf $HOME/.config/fish
2 | ln -s ./ ~/.config/fish
3 |
4 | wget https://git.io/fundle -O ./functions/fundle.fish
5 |
6 | mkdir -p ~/.config/fish/functions
7 |
8 | # wget https://git.io/fundle -O ~/.config/fish/functions/fundle.fish
9 | wget https://git.io/fisher -O ~/.config/fish/functions/fisher.fish
10 |
11 | fish install --path=~/.local/share/omf --config=~/.config/omf
12 |
13 | brew install jq &&
14 | brew install grc &&
15 | brew install thefuck &&
16 | omf install spark &&
17 | omf install license &&
18 | omf install battery &&
19 | omf install git-flow &&
20 | omf install await &&
21 | omf install hash &&
22 | omf install errno &&
23 | omf install brew &&
24 | omf install node-binpath &&
25 | omf install grc &&
26 | omf install pj &&
27 | set -gx PROJECT_PATHS ~/Library/Projects &&
28 | omf install thefuck
29 |
30 | # Prompts
31 |
32 | fisher add matchai/spacefish
33 |
34 | # Utilities
35 |
36 | fisher add jorgebucaran/fish-getopts # Automatically receive notifications when a long process finish
37 | fisher add franciscolourenco/done # Automatically receive notifications when a long process finish
38 | fisher add jethrokuan/z # Pure-fish rupa/z-like directory jumping
39 | fisher add jorgebucaran/fish-getopts # CLI options parser alternative to the argparse builtin
40 | # fisher add jorgebucaran/fish-spark # Pure-fish sparkline generator
41 | fisher add rodrigobdz/fish-apple-touchbar # Customize your Touch Bar in iTerm2
42 |
43 | # Environment
44 |
45 | fisher add danhper/fish-ssh-agent # Utility functions to start your ssh agent
46 | fisher add edc/bass # Make bash utilities usable in fish
47 | # fisher add jorgebucaran/fish-bax # Run bash utilities, replaying environment changes in fish without leaving the comfort of your session
48 |
49 | # Key Bindings
50 |
51 | fisher add jethrokuan/fzf # Improved key bindings for junegunn/fzf
52 | fisher add laughedelic/pisces # Autoclose parentheses, braces, quotes and other paired symbols
53 | fisher add oh-my-fish/plugin-bang-bang # bash style history substitution
54 |
55 | # Node.js
56 |
57 | # fisher add brigand/fast-nvm-fish # Enhanced nvm wrapper optimized for speed
58 | # fisher add FabioAntunes/fish-nvm # Completion-rich, true nvm wrapper
59 | # fisher add jorgebucaran/fish-nvm # Pure-fish, no nonsense Node.js version manager
60 | fisher add danhper/fish-fastdir
61 | fisher add jorgebucaran/fzf
--------------------------------------------------------------------------------
/fish/setup/fisher.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env fish
2 |
3 | curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish
4 |
5 | export GREP_OPTIONS=
6 |
7 | fisher add edc/bass
8 | fisher add jorgebucaran/fish-bax
9 |
10 | fisher add igalic/anicode
11 | fisher add fishpkg/fish-await
12 | fisher add oh-my-fish/plugin-battery
13 | fisher add oh-my-fish/theme-bobthefish
14 | fisher add laughedelic/brew-completions
15 |
16 | brew install terminal-notifier
17 | fisher add franciscolourenco/done
18 |
19 | fisher add Shadowigor/plugin-errno-grep
20 |
21 | brew install fzy
22 | fisher add gyakovlev/fish-fzy
23 |
24 | brew install grc
25 | fisher add oh-my-fish/plugin-grc
26 |
27 | brew install jq
28 | fisher add oh-my-fish/plugin-license
29 |
30 | fisher add oh-my-fish/plugin-node-binpath
31 |
32 | fisher add oh-my-fish/plugin-pj
33 | set -U PROJECT_PATHS ~/Library/Projects
34 |
35 | fisher add fisherman/shark
36 | fisher add Markcial/upto
37 | fisher add jethrokuan/z
38 | fisher add laughedelic/pisces
39 |
40 | fisher add rodrigobdz/fish-apple-touchbar
41 |
42 | fisher add matchai/spacefish
--------------------------------------------------------------------------------
/fish/setup/omf.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env fish
2 |
3 | curl -L https://get.oh-my.fish > install
4 | fish install --path=~/.local/share/omf --config=~/.config/omf
5 |
6 | omf install brew
7 |
8 | # omf install foreign-env
9 |
10 | omf install bobthefish
11 | fish install --path=~/.local/share/omf --config=~/.config/omf
12 |
13 | brew install jq &&
14 | brew install grc &&
15 | brew install thefuck &&
16 | omf install spark &&
17 | omf install license &&
18 | omf install battery &&
19 | omf install git-flow &&
20 | omf install await &&
21 | omf install hash &&
22 | omf install errno &&
23 | omf install brew &&
24 | omf install node-binpath &&
25 | omf install grc &&
26 | omf install pj &&
27 | omf install thefuck &&
28 | omf install osx &&
29 | omf install tab &&
30 | omf install z
--------------------------------------------------------------------------------
/fish/setup/update.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env fish
2 |
3 | echo 'start updating ...'
4 |
5 | echo 'updating homebrew'
6 | brew update
7 | brew upgrade
8 | brew cleanup
9 |
10 | echo 'updating fish shell'
11 | fisher up
12 | fish_update_completions
13 |
14 | echo 'updating npm'
15 | npm update -g
16 |
17 | echo 'checking Apple Updates'
18 | /usr/sbin/softwareupdate -ia
19 |
20 | exit 0
--------------------------------------------------------------------------------
/fish/theme:
--------------------------------------------------------------------------------
1 | default
2 |
--------------------------------------------------------------------------------
/git/gitconfig:
--------------------------------------------------------------------------------
1 | [alias]
2 | # View abbreviated SHA, description, and history graph of the latest 20 commits
3 | l = log --pretty=oneline -n 20 --graph --abbrev-commit
4 |
5 | # View the current working tree status using the short format
6 | s = status -s
7 |
8 | # Show the diff between the latest commit and the current state
9 | d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
10 |
11 | # `git di $number` shows the diff between the state `$number` revisions ago and the current state
12 | di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d"
13 |
14 | # Pull in remote changes for the current repository and all its submodules
15 | p = !"git pull; git submodule foreach git pull origin master"
16 |
17 | # Clone a repository including all submodules
18 | c = clone --recursive
19 |
20 | # Commit all changes
21 | ca = !git add -A && git commit -av
22 |
23 | # Switch to a branch, creating it if necessary
24 | go = "!f() { git checkout -b \"$1\" 2> /dev/null || git checkout \"$1\"; }; f"
25 |
26 | # Show verbose output about tags, branches or remotes
27 | tags = tag -l
28 | branches = branch -a
29 | remotes = remote -v
30 |
31 | # List aliases
32 | aliases = config --get-regexp alias
33 |
34 | # Amend the currently staged files to the latest commit
35 | amend = commit --amend --reuse-message=HEAD
36 |
37 | # Credit an author on the latest commit
38 | credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f"
39 |
40 | # Interactive rebase with the given number of latest commits
41 | reb = "!r() { git rebase -i HEAD~$1; }; r"
42 |
43 | # Remove the old tag with this name and tag the latest commit with it.
44 | retag = "!r() { git tag -d $1 && git push origin :refs/tags/$1 && git tag $1; }; r"
45 |
46 | # Find branches containing commit
47 | fb = "!f() { git branch -a --contains $1; }; f"
48 |
49 | # Find tags containing commit
50 | ft = "!f() { git describe --always --contains $1; }; f"
51 |
52 | # Find commits by source code
53 | fc = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short -S$1; }; f"
54 |
55 | # Find commits by commit message
56 | fm = "!f() { git log --pretty=format:'%C(yellow)%h %Cblue%ad %Creset%s%Cgreen [%cn] %Cred%d' --decorate --date=short --grep=$1; }; f"
57 |
58 | # Remove branches that have already been merged with master
59 | # a.k.a. ‘delete merged’
60 | dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
61 |
62 | # List contributors with number of commits
63 | contributors = shortlog --summary --numbered
64 |
65 | # Merge GitHub pull request on top of the current branch or,
66 | # if a branch name is specified, on top of the specified branch
67 | mpr = "!f() { \
68 | declare currentBranch=\"$(git symbolic-ref --short HEAD)\"; \
69 | declare branch=\"${2:-$currentBranch}\"; \
70 | if [ $(printf \"%s\" \"$1\" | grep '^[0-9]\\+$' > /dev/null; printf $?) -eq 0 ]; then \
71 | git fetch origin refs/pull/$1/head:pr/$1 && \
72 | git checkout -B $branch && \
73 | git rebase $branch pr/$1 && \
74 | git checkout -B $branch && \
75 | git merge pr/$1 && \
76 | git branch -D pr/$1 && \
77 | git commit --amend -m \"$(git log -1 --pretty=%B)\n\nCloses #$1.\"; \
78 | fi \
79 | }; f"
80 |
81 | [apply]
82 |
83 | # Detect whitespace errors when applying a patch
84 | whitespace = fix
85 |
86 | [core]
87 |
88 | # Use custom `.gitignore` and `.gitattributes`
89 | excludesfile = ~/.gitignore
90 | attributesfile = ~/.gitattributes
91 |
92 | # Treat spaces before tabs and all kinds of trailing whitespace as an error
93 | # [default] trailing-space: looks for spaces at the end of a line
94 | # [default] space-before-tab: looks for spaces before tabs at the beginning of a line
95 | whitespace = space-before-tab,-indent-with-non-tab,trailing-space
96 |
97 | # Make `git rebase` safer on macOS
98 | # More info:
99 | trustctime = false
100 |
101 | # Prevent showing files whose names contain non-ASCII symbols as unversioned.
102 | # http://michael-kuehnel.de/git/2014/11/21/git-mac-osx-and-german-umlaute.html
103 | precomposeunicode = false
104 |
105 | # Speed up commands involving untracked files such as `git status`.
106 | # https://git-scm.com/docs/git-update-index#_untracked_cache
107 | untrackedCache = true
108 |
109 | [color]
110 |
111 | # Use colors in Git commands that are capable of colored output when
112 | # outputting to the terminal. (This is the default setting in Git ≥ 1.8.4.)
113 | ui = auto
114 |
115 | [color "branch"]
116 |
117 | current = yellow reverse
118 | local = yellow
119 | remote = green
120 |
121 | [color "diff"]
122 |
123 | meta = yellow bold
124 | frag = magenta bold # line info
125 | old = red # deletions
126 | new = green # additions
127 |
128 | [color "status"]
129 |
130 | added = yellow
131 | changed = green
132 | untracked = cyan
133 |
134 | [commit]
135 |
136 | # https://help.github.com/articles/signing-commits-using-gpg/
137 | gpgsign = true
138 |
139 | [diff]
140 |
141 | # Detect copies as well as renames
142 | renames = copies
143 |
144 | [diff "bin"]
145 |
146 | # Use `hexdump` to diff binary files
147 | textconv = hexdump -v -C
148 |
149 | [help]
150 |
151 | # Automatically correct and execute mistyped commands
152 | autocorrect = 1
153 |
154 | [merge]
155 |
156 | # Include summaries of merged commits in newly created merge commit messages
157 | log = true
158 |
159 | [push]
160 |
161 | # https://git-scm.com/docs/git-config#git-config-pushdefault
162 | default = simple
163 | # Make `git push` push relevant annotated tags when pushing branches out.
164 | followTags = true
165 |
166 | # URL shorthands
167 |
168 | [url "git@github.com:"]
169 |
170 | insteadOf = "gh:"
171 | pushInsteadOf = "github:"
172 | pushInsteadOf = "git://github.com/"
173 |
174 | [url "git://github.com/"]
175 |
176 | insteadOf = "github:"
177 |
178 | [url "git@gist.github.com:"]
179 |
180 | insteadOf = "gst:"
181 | pushInsteadOf = "gist:"
182 | pushInsteadOf = "git://gist.github.com/"
183 |
184 | [url "git://gist.github.com/"]
185 |
186 | insteadOf = "gist:"
187 |
--------------------------------------------------------------------------------
/git/gitignore:
--------------------------------------------------------------------------------
1 | # Compiled Python files
2 | *.pyc
3 |
4 | w# Folder view configuration files
5 | .DS_Store
6 | Desktop.ini
7 |
8 | # Thumbnail cache files
9 | ._*
10 | Thumbs.db
11 |
12 | # Files that might appear on external disks
13 | .Spotlight-V100
14 | .Trashes
15 |
--------------------------------------------------------------------------------
/install.sh:
--------------------------------------------------------------------------------
1 | echo "🎁 Installing deps, tools & core apps"
2 | # brew bundle
3 | sudo spctl --master-disable
4 | # echo "🎁 Installing shell deps."
5 | source "${PWD}/shell_shell.sh"
6 | echo "🎁 Setting up shell enviroment."
7 | source "${PWD}/setup.sh"
8 |
--------------------------------------------------------------------------------
/install_shell.sh:
--------------------------------------------------------------------------------
1 | brew install zsh
2 |
3 | git clone https://github.com/tarjoilija/zgen.git "${HOME}/.zgen"
4 |
5 | curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
6 | https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
7 |
8 | brew install exa
9 | brew install neovim
10 | brew install stow
11 |
12 | # wget https://raw.github.com/trapd00r/LS_COLORS/master/LS_COLORS -O $HOME/.dircolors
13 | # echo 'eval $(dircolors -b $HOME/.dircolors)' >> $HOME/.zshrc
14 | # . $HOME/.zshrcx§
15 |
--------------------------------------------------------------------------------
/iterm/iterm-profile.json:
--------------------------------------------------------------------------------
1 | {
2 | "Guid" : "6FA27419-5BC7-4C05-B72D-4E3B3C7FE1E6",
3 | "Tags" : [
4 |
5 | ],
6 | "Ansi 12 Color" : {
7 | "Green Component" : 0.5733030673510271,
8 | "Red Component" : 0.00053359762918048226,
9 | "Blue Component" : 1
10 | },
11 | "Ansi 2 Color" : {
12 | "Green Component" : 0.88189995288848877,
13 | "Red Component" : 0.54928803443908691,
14 | "Blue Component" : 0.04123397171497345
15 | },
16 | "Normal Font" : "HackNerdFontComplete-Regular 14",
17 | "Bold Color" : {
18 | "Green Component" : 0.6100342869758606,
19 | "Red Component" : 0.61956524848937988,
20 | "Blue Component" : 0.60246169567108154
21 | },
22 | "Ansi 3 Color" : {
23 | "Green Component" : 0.72656995058059692,
24 | "Red Component" : 1,
25 | "Blue Component" : 0
26 | },
27 | "Link Color" : {
28 | "Red Component" : 0,
29 | "Color Space" : "sRGB",
30 | "Blue Component" : 0.73423302173614502,
31 | "Alpha Component" : 1,
32 | "Green Component" : 0.35916060209274292
33 | },
34 | "Right Option Key Sends" : 0,
35 | "Rows" : 40,
36 | "Default Bookmark" : "No",
37 | "Cursor Guide Color" : {
38 | "Red Component" : 0.70213186740875244,
39 | "Color Space" : "sRGB",
40 | "Blue Component" : 1,
41 | "Alpha Component" : 0.25,
42 | "Green Component" : 0.9268307089805603
43 | },
44 | "Non-ASCII Anti Aliased" : true,
45 | "Use Bright Bold" : true,
46 | "Ansi 10 Color" : {
47 | "Green Component" : 0.88189995290000001,
48 | "Red Component" : 0.67126059688058637,
49 | "Blue Component" : 0.35646489677720017
50 | },
51 | "Ambiguous Double Width" : false,
52 | "Jobs to Ignore" : [
53 | "rlogin",
54 | "ssh",
55 | "slogin",
56 | "telnet"
57 | ],
58 | "Ansi 15 Color" : {
59 | "Green Component" : 1,
60 | "Red Component" : 1,
61 | "Blue Component" : 1
62 | },
63 | "Foreground Color" : {
64 | "Green Component" : 0.98048108816146851,
65 | "Red Component" : 1,
66 | "Blue Component" : 0.95548701286315918
67 | },
68 | "Working Directory" : "\/Users\/deo",
69 | "Blinking Cursor" : false,
70 | "Disable Window Resizing" : true,
71 | "Sync Title" : false,
72 | "Prompt Before Closing 2" : false,
73 | "BM Growl" : true,
74 | "Command" : "",
75 | "Description" : "Default",
76 | "Smart Cursor Color" : true,
77 | "Mouse Reporting" : true,
78 | "Screen" : -1,
79 | "Selection Color" : {
80 | "Green Component" : 0.16498950123786926,
81 | "Red Component" : 0,
82 | "Blue Component" : 0.23076923191547394
83 | },
84 | "Only The Default BG Color Uses Transparency" : false,
85 | "Columns" : 80,
86 | "Idle Code" : 0,
87 | "Ansi 13 Color" : {
88 | "Green Component" : 0.37417232689266022,
89 | "Red Component" : 0.60504487800788187,
90 | "Blue Component" : 0.92307692307692313
91 | },
92 | "Custom Command" : "No",
93 | "ASCII Anti Aliased" : true,
94 | "Non Ascii Font" : "Monaco 12",
95 | "Vertical Spacing" : 1,
96 | "Use Bold Font" : true,
97 | "Option Key Sends" : 0,
98 | "Selected Text Color" : {
99 | "Green Component" : 1,
100 | "Red Component" : 1,
101 | "Blue Component" : 1
102 | },
103 | "Background Color" : {
104 | "Green Component" : 0.060920167714357376,
105 | "Red Component" : 0.0540635846555233,
106 | "Blue Component" : 0.097826063632965088
107 | },
108 | "Character Encoding" : 4,
109 | "Ansi 11 Color" : {
110 | "Green Component" : 0.82281720845913986,
111 | "Red Component" : 1,
112 | "Blue Component" : 0.25792301594327316
113 | },
114 | "Use Italic Font" : true,
115 | "Unlimited Scrollback" : false,
116 | "Keyboard Map" : {
117 | "0xf700-0x260000" : {
118 | "Text" : "[1;6A",
119 | "Action" : 10
120 | },
121 | "0x37-0x40000" : {
122 | "Text" : "0x1f",
123 | "Action" : 11
124 | },
125 | "0x32-0x40000" : {
126 | "Text" : "0x00",
127 | "Action" : 11
128 | },
129 | "0xf709-0x20000" : {
130 | "Text" : "[17;2~",
131 | "Action" : 10
132 | },
133 | "0xf70c-0x20000" : {
134 | "Text" : "[20;2~",
135 | "Action" : 10
136 | },
137 | "0xf729-0x20000" : {
138 | "Text" : "[1;2H",
139 | "Action" : 10
140 | },
141 | "0xf72b-0x40000" : {
142 | "Text" : "[1;5F",
143 | "Action" : 10
144 | },
145 | "0xf705-0x20000" : {
146 | "Text" : "[1;2Q",
147 | "Action" : 10
148 | },
149 | "0xf703-0x260000" : {
150 | "Text" : "[1;6C",
151 | "Action" : 10
152 | },
153 | "0xf700-0x220000" : {
154 | "Text" : "[1;2A",
155 | "Action" : 10
156 | },
157 | "0xf701-0x280000" : {
158 | "Text" : "0x1b 0x1b 0x5b 0x42",
159 | "Action" : 11
160 | },
161 | "0x38-0x40000" : {
162 | "Text" : "0x7f",
163 | "Action" : 11
164 | },
165 | "0x33-0x40000" : {
166 | "Text" : "0x1b",
167 | "Action" : 11
168 | },
169 | "0xf703-0x220000" : {
170 | "Text" : "[1;2C",
171 | "Action" : 10
172 | },
173 | "0xf701-0x240000" : {
174 | "Text" : "[1;5B",
175 | "Action" : 10
176 | },
177 | "0xf70d-0x20000" : {
178 | "Text" : "[21;2~",
179 | "Action" : 10
180 | },
181 | "0xf702-0x260000" : {
182 | "Text" : "[1;6D",
183 | "Action" : 10
184 | },
185 | "0xf729-0x40000" : {
186 | "Text" : "[1;5H",
187 | "Action" : 10
188 | },
189 | "0xf706-0x20000" : {
190 | "Text" : "[1;2R",
191 | "Action" : 10
192 | },
193 | "0x34-0x40000" : {
194 | "Text" : "0x1c",
195 | "Action" : 11
196 | },
197 | "0xf700-0x280000" : {
198 | "Text" : "0x1b 0x1b 0x5b 0x41",
199 | "Action" : 11
200 | },
201 | "0x2d-0x40000" : {
202 | "Text" : "0x1f",
203 | "Action" : 11
204 | },
205 | "0xf70e-0x20000" : {
206 | "Text" : "[23;2~",
207 | "Action" : 10
208 | },
209 | "0xf702-0x220000" : {
210 | "Text" : "[1;2D",
211 | "Action" : 10
212 | },
213 | "0xf703-0x280000" : {
214 | "Text" : "0x1b 0x1b 0x5b 0x43",
215 | "Action" : 11
216 | },
217 | "0xf700-0x240000" : {
218 | "Text" : "[1;5A",
219 | "Action" : 10
220 | },
221 | "0xf707-0x20000" : {
222 | "Text" : "[1;2S",
223 | "Action" : 10
224 | },
225 | "0xf70a-0x20000" : {
226 | "Text" : "[18;2~",
227 | "Action" : 10
228 | },
229 | "0x35-0x40000" : {
230 | "Text" : "0x1d",
231 | "Action" : 11
232 | },
233 | "0xf70f-0x20000" : {
234 | "Text" : "[24;2~",
235 | "Action" : 10
236 | },
237 | "0xf703-0x240000" : {
238 | "Text" : "[1;5C",
239 | "Action" : 10
240 | },
241 | "0xf701-0x260000" : {
242 | "Text" : "[1;6B",
243 | "Action" : 10
244 | },
245 | "0xf702-0x280000" : {
246 | "Text" : "0x1b 0x1b 0x5b 0x44",
247 | "Action" : 11
248 | },
249 | "0xf72b-0x20000" : {
250 | "Text" : "[1;2F",
251 | "Action" : 10
252 | },
253 | "0x36-0x40000" : {
254 | "Text" : "0x1e",
255 | "Action" : 11
256 | },
257 | "0xf708-0x20000" : {
258 | "Text" : "[15;2~",
259 | "Action" : 10
260 | },
261 | "0xf701-0x220000" : {
262 | "Text" : "[1;2B",
263 | "Action" : 10
264 | },
265 | "0xf70b-0x20000" : {
266 | "Text" : "[19;2~",
267 | "Action" : 10
268 | },
269 | "0xf702-0x240000" : {
270 | "Text" : "[1;5D",
271 | "Action" : 10
272 | },
273 | "0xf704-0x20000" : {
274 | "Text" : "[1;2P",
275 | "Action" : 10
276 | }
277 | },
278 | "Window Type" : 2,
279 | "Blur Radius" : 14.82292790291878,
280 | "Background Image Location" : "",
281 | "Blur" : true,
282 | "Badge Color" : {
283 | "Red Component" : 1,
284 | "Color Space" : "sRGB",
285 | "Blue Component" : 0,
286 | "Alpha Component" : 0.5,
287 | "Green Component" : 0.1491314172744751
288 | },
289 | "Scrollback Lines" : 1000,
290 | "Send Code When Idle" : false,
291 | "Close Sessions On End" : true,
292 | "Terminal Type" : "xterm-256color",
293 | "Visual Bell" : true,
294 | "Flashing Bell" : false,
295 | "Silence Bell" : false,
296 | "Ansi 14 Color" : {
297 | "Green Component" : 1,
298 | "Red Component" : 0.4042010611351281,
299 | "Blue Component" : 0.94094775504779782
300 | },
301 | "Name" : "default",
302 | "Cursor Text Color" : {
303 | "Green Component" : 0,
304 | "Red Component" : 1,
305 | "Blue Component" : 0.0940093994140625
306 | },
307 | "Shortcut" : "",
308 | "Cursor Color" : {
309 | "Green Component" : 0,
310 | "Red Component" : 1,
311 | "Blue Component" : 0.0940093994140625
312 | },
313 | "Transparency" : 0,
314 | "Ansi 1 Color" : {
315 | "Green Component" : 0,
316 | "Red Component" : 1,
317 | "Blue Component" : 0.058871746063232422
318 | },
319 | "Horizontal Spacing" : 1,
320 | "Custom Directory" : "No",
321 | "Ansi 4 Color" : {
322 | "Green Component" : 0.55481654405593872,
323 | "Red Component" : 0,
324 | "Blue Component" : 0.97294086217880249
325 | },
326 | "Ansi 5 Color" : {
327 | "Green Component" : 0.26314744353294373,
328 | "Red Component" : 0.42564234137535095,
329 | "Blue Component" : 0.65052211284637451
330 | },
331 | "Use Non-ASCII Font" : false,
332 | "Ansi 7 Color" : {
333 | "Green Component" : 1,
334 | "Red Component" : 1,
335 | "Blue Component" : 1
336 | },
337 | "Ansi 8 Color" : {
338 | "Green Component" : 0.26696832579185525,
339 | "Red Component" : 0.26696832579185525,
340 | "Blue Component" : 0.26696832579185525
341 | },
342 | "Ansi 9 Color" : {
343 | "Green Component" : 0.15470406080870669,
344 | "Red Component" : 1,
345 | "Blue Component" : 0.24923402424592656
346 | },
347 | "Ansi 6 Color" : {
348 | "Green Component" : 0.84575581550598145,
349 | "Red Component" : 0,
350 | "Blue Component" : 0.92260181903839111
351 | },
352 | "Ansi 0 Color" : {
353 | "Green Component" : 0.13574660633484159,
354 | "Red Component" : 0.13574660633484159,
355 | "Blue Component" : 0.13574660633484159
356 | }
357 | }
358 |
--------------------------------------------------------------------------------
/iterm/themes/default.itermcolors:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Ansi 0 Color
6 |
7 | Blue Component
8 | 0.13574660633484159
9 | Green Component
10 | 0.13574660633484159
11 | Red Component
12 | 0.13574660633484159
13 |
14 | Ansi 1 Color
15 |
16 | Blue Component
17 | 0.058871746063232422
18 | Green Component
19 | 0.0
20 | Red Component
21 | 1
22 |
23 | Ansi 10 Color
24 |
25 | Blue Component
26 | 0.35646489677720017
27 | Green Component
28 | 0.88189995290000001
29 | Red Component
30 | 0.67126059688058637
31 |
32 | Ansi 11 Color
33 |
34 | Blue Component
35 | 0.25792301594327316
36 | Green Component
37 | 0.82281720845913986
38 | Red Component
39 | 1
40 |
41 | Ansi 12 Color
42 |
43 | Blue Component
44 | 1
45 | Green Component
46 | 0.5733030673510271
47 | Red Component
48 | 0.00053359762918048226
49 |
50 | Ansi 13 Color
51 |
52 | Blue Component
53 | 0.92307692307692313
54 | Green Component
55 | 0.37417232689266022
56 | Red Component
57 | 0.60504487800788187
58 |
59 | Ansi 14 Color
60 |
61 | Blue Component
62 | 0.94094775504779782
63 | Green Component
64 | 1
65 | Red Component
66 | 0.4042010611351281
67 |
68 | Ansi 15 Color
69 |
70 | Blue Component
71 | 1
72 | Green Component
73 | 1
74 | Red Component
75 | 1
76 |
77 | Ansi 2 Color
78 |
79 | Blue Component
80 | 0.04123397171497345
81 | Green Component
82 | 0.88189995288848877
83 | Red Component
84 | 0.54928803443908691
85 |
86 | Ansi 3 Color
87 |
88 | Blue Component
89 | 0.0
90 | Green Component
91 | 0.72656995058059692
92 | Red Component
93 | 1
94 |
95 | Ansi 4 Color
96 |
97 | Blue Component
98 | 0.97294086217880249
99 | Green Component
100 | 0.55481654405593872
101 | Red Component
102 | 0.0
103 |
104 | Ansi 5 Color
105 |
106 | Blue Component
107 | 0.65052211284637451
108 | Green Component
109 | 0.26314744353294373
110 | Red Component
111 | 0.42564234137535095
112 |
113 | Ansi 6 Color
114 |
115 | Blue Component
116 | 0.92260181903839111
117 | Green Component
118 | 0.84575581550598145
119 | Red Component
120 | 0.0
121 |
122 | Ansi 7 Color
123 |
124 | Blue Component
125 | 1
126 | Green Component
127 | 1
128 | Red Component
129 | 1
130 |
131 | Ansi 8 Color
132 |
133 | Blue Component
134 | 0.26696832579185525
135 | Green Component
136 | 0.26696832579185525
137 | Red Component
138 | 0.26696832579185525
139 |
140 | Ansi 9 Color
141 |
142 | Blue Component
143 | 0.24923402424592656
144 | Green Component
145 | 0.15470406080870669
146 | Red Component
147 | 1
148 |
149 | Background Color
150 |
151 | Blue Component
152 | 0.097826063632965088
153 | Green Component
154 | 0.060920167714357376
155 | Red Component
156 | 0.0540635846555233
157 |
158 | Bold Color
159 |
160 | Blue Component
161 | 0.60246169567108154
162 | Green Component
163 | 0.6100342869758606
164 | Red Component
165 | 0.61956524848937988
166 |
167 | Cursor Color
168 |
169 | Blue Component
170 | 0.0940093994140625
171 | Green Component
172 | 0.0
173 | Red Component
174 | 1
175 |
176 | Cursor Text Color
177 |
178 | Blue Component
179 | 0.0940093994140625
180 | Green Component
181 | 0.0
182 | Red Component
183 | 1
184 |
185 | Foreground Color
186 |
187 | Blue Component
188 | 0.95548701286315918
189 | Green Component
190 | 0.98048108816146851
191 | Red Component
192 | 1
193 |
194 | Selected Text Color
195 |
196 | Blue Component
197 | 1
198 | Green Component
199 | 1
200 | Red Component
201 | 1
202 |
203 | Selection Color
204 |
205 | Blue Component
206 | 0.23076923191547394
207 | Green Component
208 | 0.16498950123786926
209 | Red Component
210 | 0.0
211 |
212 |
213 |
214 |
--------------------------------------------------------------------------------
/mac/app-configs/chrome.sh:
--------------------------------------------------------------------------------
1 |
2 | ###############################################################################
3 | # Google Chrome & Google Chrome Canary #
4 | ###############################################################################
5 |
6 | # Disable the all too sensitive backswipe on trackpads
7 | defaults write com.google.Chrome AppleEnableSwipeNavigateWithScrolls -bool false
8 | defaults write com.google.Chrome.canary AppleEnableSwipeNavigateWithScrolls -bool false
9 |
10 | # Disable the all too sensitive backswipe on Magic Mouse
11 | defaults write com.google.Chrome AppleEnableMouseSwipeNavigateWithScrolls -bool false
12 | defaults write com.google.Chrome.canary AppleEnableMouseSwipeNavigateWithScrolls -bool false
13 |
--------------------------------------------------------------------------------
/mac/app-configs/safari.sh:
--------------------------------------------------------------------------------
1 |
2 | # ----------------------------------------------------------------------------
3 | # Safari
4 | # ----------------------------------------------------------------------------
5 |
6 | # Privacy: don’t send search queries to Apple
7 | defaults write com.apple.Safari UniversalSearchEnabled -bool false
8 | defaults write com.apple.Safari SuppressSearchSuggestions -bool true
9 |
10 | # Show the full URL in the address bar (note: this still hides the scheme)
11 | defaults write com.apple.Safari ShowFullURLInSmartSearchField -bool true
12 |
13 | # Set Safari’s home page to `about:blank` for faster loading
14 | defaults write com.apple.Safari HomePage -string "about:blank"
15 |
16 | # Prevent Safari from opening ‘safe’ files automatically after downloading
17 | defaults write com.apple.Safari AutoOpenSafeDownloads -bool false
18 |
19 | # Enable the Develop menu and the Web Inspector in Safari
20 | defaults write com.apple.Safari IncludeDevelopMenu -bool true
21 | defaults write com.apple.Safari WebKitDeveloperExtrasEnabledPreferenceKey -bool true
22 | defaults write com.apple.Safari com.apple.Safari.ContentPageGroupIdentifier.WebKit2DeveloperExtrasEnabled -bool true
23 |
24 | # Enable Safari’s debug menu
25 | defaults write com.apple.Safari IncludeInternalDebugMenu -bool true
26 |
27 | # Add a context menu item for showing the Web Inspector in web views
28 | defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
29 |
--------------------------------------------------------------------------------
/mac/app-configs/transmission.sh:
--------------------------------------------------------------------------------
1 |
2 | ###############################################################################
3 | # Transmission.app #
4 | ###############################################################################
5 |
6 | # Use `~/Documents/Torrents` to store incomplete downloads
7 | defaults write org.m0k.transmission UseIncompleteDownloadFolder -bool true
8 | defaults write org.m0k.transmission IncompleteDownloadFolder -string "${HOME}/Documents/Torrents"
9 |
10 | # Use `~/Downloads` to store completed downloads
11 | defaults write org.m0k.transmission DownloadLocationConstant -bool true
12 |
13 | # Don’t prompt for confirmation before downloading
14 | defaults write org.m0k.transmission DownloadAsk -bool false
15 | defaults write org.m0k.transmission MagnetOpenAsk -bool false
16 |
17 | # Don’t prompt for confirmation before removing non-downloading active transfers
18 | defaults write org.m0k.transmission CheckRemoveDownloading -bool true
19 |
20 | # Trash original torrent files
21 | defaults write org.m0k.transmission DeleteOriginalTorrent -bool true
22 |
23 | # Hide the donate message
24 | defaults write org.m0k.transmission WarningDonate -bool false
25 | # Hide the legal disclaimer
26 | defaults write org.m0k.transmission WarningLegal -bool false
27 |
28 | # IP block list.
29 | # Source: https://giuliomac.wordpress.com/2014/02/19/best-blocklist-for-transmission/
30 | defaults write org.m0k.transmission BlocklistNew -bool true
31 | defaults write org.m0k.transmission BlocklistURL -string "http://john.bitsurge.net/public/biglist.p2p.gz"
32 | defaults write org.m0k.transmission BlocklistAutoUpdate -bool true
33 |
34 | # Randomize port on launch
35 | defaults write org.m0k.transmission RandomPort -bool true
36 |
37 | ###############################################################################
38 | # Twitter.app #
39 | ###############################################################################
40 |
41 | # Disable smart quotes as it’s annoying for code tweets
42 | defaults write com.twitter.twitter-mac AutomaticQuoteSubstitutionEnabled -bool false
43 |
44 | # Show the app window when clicking the menu bar icon
45 | defaults write com.twitter.twitter-mac MenuItemBehavior -int 1
46 |
47 | # Enable the hidden ‘Develop’ menu
48 | defaults write com.twitter.twitter-mac ShowDevelopMenu -bool true
49 |
50 | # Open links in the background
51 | defaults write com.twitter.twitter-mac openLinksInBackground -bool true
52 |
53 | # Allow closing the ‘new tweet’ window by pressing `Esc`
54 | defaults write com.twitter.twitter-mac ESCClosesComposeWindow -bool true
55 |
56 | # Show full names rather than Twitter handles
57 | defaults write com.twitter.twitter-mac ShowFullNames -bool true
58 |
59 | # Hide the app in the background if it’s not the front-most window
60 | defaults write com.twitter.twitter-mac HideInBackground -bool true
61 |
--------------------------------------------------------------------------------
/mac/settings-default.sh:
--------------------------------------------------------------------------------
1 | black='\033[0;30m'
2 |
3 | HOSTNAME="grayworm"
4 |
5 | # Close any open System Preferences panes
6 | osascript -e 'tell application "System Preferences" to quit'
7 |
8 | git config --global core.editor "code"
9 |
10 | sudo scutil --set ComputerName $HOSTNAME
11 | sudo scutil --set HostName $HOSTNAME
12 | sudo scutil --set LocalHostName $HOSTNAME
13 | sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.smb.server NetBIOSName -string $HOSTNAME
14 |
15 | # Expanding the save panel by default
16 | defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
17 | defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
18 | defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
19 |
20 | # Expanding the save panel by default
21 | defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
22 | defaults write NSGlobalDomain PMPrintingExpandedStateForPrint -bool true
23 | defaults write NSGlobalDomain PMPrintingExpandedStateForPrint2 -bool true
24 |
25 | # Check for software updates daily, not just once per week
26 | defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
27 |
28 | # Removing duplicates in the 'Open With' menu
29 | /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
30 |
31 | # Disable smart quotes and smart dashes
32 | defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
33 | defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
34 |
35 | # Disable Photos.app from starting everytime a device is plugged in
36 | defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true
37 |
38 | # Mojave font smooth fix
39 | defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO
40 |
41 | # Disabling the sudden motion sensor
42 | sudo pmset -a sms 0
43 |
44 | # Disabling the menubar transparency
45 | defaults write com.apple.universalaccess reduceTransparency -bool true
46 |
47 | # Set standby delay to 24 hours (default is 1 hour)
48 | sudo pmset -a standbydelay 86400
49 |
50 | # Disable the sound effects on boot
51 | sudo nvram SystemAudioVolume=" "
52 |
53 | # Always show scrollbars
54 | defaults write NSGlobalDomain AppleShowScrollBars -string "Always"
55 |
56 | # Expand save panel by default
57 | defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode -bool true
58 | defaults write NSGlobalDomain NSNavPanelExpandedStateForSaveMode2 -bool true
59 |
60 | # Save to disk (not to iCloud) by default
61 | defaults write NSGlobalDomain NSDocumentSaveNewDocumentsToCloud -bool false
62 |
63 | # Disable the \"Are you sure you want to open this application\" dialog
64 | defaults write com.apple.LaunchServices LSQuarantine -bool false
65 |
66 | # Remove duplicates in the “Open With” menu (also see `lscleanup` alias)
67 | /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user
68 |
69 | # Display ASCII control characters using caret notation in standard text views
70 | # Try e.g. `cd /tmp; unidecode "\x{0000}" > cc.txt; open -e cc.txt`
71 | defaults write NSGlobalDomain NSTextShowsControlCharacters -bool true
72 |
73 | # Disable the crash reporter"
74 | defaults write com.apple.CrashReporter DialogType -string "none"
75 |
76 | # Disable automatic capitalization as it’s annoying when typing code
77 | defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false
78 |
79 | # Disable smart dashes as they’re annoying when typing code
80 | defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false
81 |
82 | # Disable automatic period substitution as it’s annoying when typing code
83 | defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false
84 |
85 | # Disable smart quotes as they’re annoying when typing code
86 | defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false
87 |
88 | # Disable auto-correct
89 | defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false
90 |
91 | # Disable hibernation (speeds up entering sleep mode)
92 | sudo pmset -a hibernatemode 0
93 |
94 | # Trackpad: enable tap to click for this user and for the login screen
95 | defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
96 | defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
97 | defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
98 |
99 | # Increase sound quality for Bluetooth headphones/headsets
100 | defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" -int 40
101 |
102 | # Enable full keyboard access for all controls
103 | # (e.g. enable Tab in modal dialogs)
104 | defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
105 |
106 | # Disable press-and-hold for keys in favor of key repeat
107 | defaults write NSGlobalDomain ApplePressAndHoldEnabled -bool false
108 |
109 | # Set a blazingly fast keyboard repeat rate
110 | defaults write NSGlobalDomain KeyRepeat -int 1
111 | defaults write NSGlobalDomain InitialKeyRepeat -int 2
112 |
113 | # Save screenshots to the desktop
114 | defaults write com.apple.screencapture location -string "${HOME}/Desktop"
115 |
116 | # Save screenshots in PNG format (other options: BMP, GIF, JPG, PDF, TIFF)
117 | defaults write com.apple.screencapture type -string "png"
118 |
119 | # Disable shadow in screenshots
120 | defaults write com.apple.screencapture disable-shadow -bool true
121 |
122 | # Enable subpixel font rendering on non-Apple LCDs
123 | # Reference: https://github.com/kevinSuttle/macOS-Defaults/issues/17#issuecomment-266633501
124 | defaults write NSGlobalDomain AppleFontSmoothing -int 1
125 |
126 | # Enable HiDPI display modes (requires restart)
127 | sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool true
128 |
129 | # Finder: allow quitting via ⌘ + Q; doing so will also hide desktop icons
130 | defaults write com.apple.finder QuitMenuItem -bool true
131 |
132 | # Finder: disable window animations and Get Info animations
133 | defaults write com.apple.finder DisableAllAnimations -bool true
134 |
135 | # Set Home as the default location for new Finder windows
136 | defaults write com.apple.finder NewWindowTargetPath -string "file://${HOME}/"
137 |
138 | # Show icons for hard drives, servers, and removable media on the desktop
139 | defaults write com.apple.finder ShowExternalHardDrivesOnDesktop -bool true
140 | defaults write com.apple.finder ShowHardDrivesOnDesktop -bool true
141 | defaults write com.apple.finder ShowMountedServersOnDesktop -bool true
142 | defaults write com.apple.finder ShowRemovableMediaOnDesktop -bool true
143 |
144 | # Finder: show hidden files by default
145 | defaults write com.apple.finder AppleShowAllFiles -bool true
146 |
147 | # Finder: show all filename extensions
148 | defaults write NSGlobalDomain AppleShowAllExtensions -bool true
149 |
150 | # Finder: show status bar
151 | defaults write com.apple.finder ShowStatusBar -bool true
152 |
153 | # Finder: show path bar
154 | defaults write com.apple.finder ShowPathbar -bool true
155 |
156 | # Display full POSIX path as Finder window title
157 | defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
158 |
159 | # Keep folders on top when sorting by name
160 | defaults write com.apple.finder _FXSortFoldersFirst -bool true
161 |
162 | # When performing a search, search the current folder by default
163 | defaults write com.apple.finder FXDefaultSearchScope -string "SCcf"
164 |
165 | # Disable the warning when changing a file extension
166 | defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false
167 |
168 | # Enable spring loading for directories
169 | defaults write NSGlobalDomain com.apple.springing.enabled -bool true
170 |
171 | # Remove the spring loading delay for directories
172 | defaults write NSGlobalDomain com.apple.springing.delay -float 0
173 |
174 | # Avoid creating .DS_Store files on network or USB volumes
175 | defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
176 | defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
177 |
178 | # Disable disk image verification
179 | defaults write com.apple.frameworks.diskimages skip-verify -bool true
180 | defaults write com.apple.frameworks.diskimages skip-verify-locked -bool true
181 | defaults write com.apple.frameworks.diskimages skip-verify-remote -bool true
182 |
183 | # Automatically open a new Finder window when a volume is mounted
184 | defaults write com.apple.frameworks.diskimages auto-open-ro-root -bool true
185 | defaults write com.apple.frameworks.diskimages auto-open-rw-root -bool true
186 | defaults write com.apple.finder OpenWindowForNewRemovableDisk -bool true
187 |
188 | # Show item info near icons on the desktop and in other icon views
189 | /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
190 | /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
191 | /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:showItemInfo true" ~/Library/Preferences/com.apple.finder.plist
192 |
193 | # Show item info to the right of the icons on the desktop
194 | /usr/libexec/PlistBuddy -c "Set DesktopViewSettings:IconViewSettings:labelOnBottom false" ~/Library/Preferences/com.apple.finder.plist
195 |
196 | # Enable snap-to-grid for icons on the desktop and in other icon views
197 | /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
198 | /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
199 | /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:arrangeBy grid" ~/Library/Preferences/com.apple.finder.plist
200 |
201 | # Increase grid spacing for icons on the desktop and in other icon views
202 | /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
203 | /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
204 | /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:gridSpacing 100" ~/Library/Preferences/com.apple.finder.plist
205 |
206 | # Increase the size of icons on the desktop and in other icon views
207 | /usr/libexec/PlistBuddy -c "Set :DesktopViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
208 | /usr/libexec/PlistBuddy -c "Set :FK_StandardViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
209 | /usr/libexec/PlistBuddy -c "Set :StandardViewSettings:IconViewSettings:iconSize 80" ~/Library/Preferences/com.apple.finder.plist
210 |
211 | # Use list view in all Finder windows by default
212 | # Four-letter codes for the other view modes: `icnv`, `clmv`, `Flwv`
213 | defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"
214 |
215 | # Disable the warning before emptying the Trash
216 | defaults write com.apple.finder WarnOnEmptyTrash -bool false
217 |
218 | # Enable AirDrop over Ethernet and on unsupported Macs running Lion
219 | defaults write com.apple.NetworkBrowser BrowseAllInterfaces -bool true
220 |
221 | # Show the ~/Library folder
222 | chflags nohidden ~/Library
223 |
224 | # Show the /Volumes folder
225 | sudo chflags nohidden /Volumes
226 |
227 | # Remove Dropbox’s green checkmark icons in Finder
228 | file=/Applications/Dropbox.app/Contents/Resources/emblem-dropbox-uptodate.icns
229 | [ -e "${file}" ] && mv -f "${file}" "${file}.bak"
230 |
231 | # Expand the following File Info panes:
232 | # “General”, “Open with”, and “Sharing & Permissions”
233 | defaults write com.apple.finder FXInfoPanesExpanded -dict \
234 | General -bool true \
235 | OpenWith -bool true \
236 | Privileges -bool true
237 |
238 | # Enable highlight hover effect for the grid view of a stack (Dock)
239 | defaults write com.apple.dock mouse-over-hilite-stack -bool true
240 |
241 | # Set Dock to auto-hide and remove the auto-hiding delay
242 | defaults write com.apple.dock autohide -bool false
243 | defaults write com.apple.dock autohide-delay -float 0
244 | defaults write com.apple.dock autohide-time-modifier -float 0
245 |
246 | # Set the icon size of Dock items to 36 pixels
247 | defaults write com.apple.dock tilesize -int 36
248 |
249 | # Change minimize/maximize window effect
250 | defaults write com.apple.dock mineffect -string "suck"
251 |
252 | # Minimize windows into their application’s icon
253 | defaults write com.apple.dock minimize-to-application -bool true
254 |
255 | # Enable spring loading for all Dock items
256 | defaults write com.apple.dock enable-spring-load-actions-on-all-items -bool true
257 |
258 | # Show indicator lights for open applications in the Dock
259 | defaults write com.apple.dock show-process-indicators -bool true
260 |
261 | # Don’t animate opening applications from the Dock
262 | defaults write com.apple.dock launchanim -bool false
263 |
264 | # Speed up Mission Control animations
265 | defaults write com.apple.dock expose-animation-duration -float 0.1
266 |
267 | # Don’t group windows by application in Mission Control
268 | # (i.e. use the old Exposé behavior instead)
269 | defaults write com.apple.dock expose-group-by-app -bool false
270 |
271 | # Don’t show Dashboard as a Space
272 | defaults write com.apple.dock dashboard-in-overlay -bool true
273 |
274 | # Don’t automatically rearrange Spaces based on most recent use
275 | defaults write com.apple.dock mru-spaces -bool false
276 |
277 | # Remove the auto-hiding Dock delay
278 | defaults write com.apple.dock autohide-delay -float 0
279 |
280 | # Remove the animation when hiding/showing the Dock
281 | defaults write com.apple.dock autohide-time-modifier -float 0
282 |
283 | # Automatically hide and show the Dock
284 | defaults write com.apple.dock autohide -bool true
285 |
286 | # Make Dock icons of hidden applications translucent
287 | defaults write com.apple.dock showhidden -bool true
288 |
289 | # Some etc
290 | defaults write com.apple.dock static-only -bool true
291 | defaults write com.apple.Dock showhidden -bool yes
292 | defaults write com.apple.dock mru-spaces -bool false
293 | defaults write com.apple.dock "show-recents" -int 0
294 | killall Dock
295 |
296 | # Disable Dashboard
297 | defaults write com.apple.dashboard mcx-disabled -bool true
298 |
299 | # Only use UTF-8 in Terminal.app
300 | defaults write com.apple.terminal StringEncodings -array 4
301 |
302 | # Enable Secure Keyboard Entry in Terminal.app
303 | # See: https://security.stackexchange.com/a/47786/8918
304 | defaults write com.apple.terminal SecureKeyboardEntry -bool true
305 |
306 | # Disable the annoying line marks
307 | defaults write com.apple.Terminal ShowLineMarks -int 0
308 |
309 | # Install the Solarized Dark theme for iTerm
310 | open "${HOME}/iterm/themes/default.itermcolors"
311 |
312 | # Don’t display the annoying prompt when quitting iTerm
313 | defaults write com.googlecode.iterm2 PromptOnQuit -bool false
314 |
315 | # Prevent Time Machine from prompting to use new hard drives as backup volume
316 | defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true
317 |
318 | # Disable local Time Machine backups
319 | hash tmutil &> /dev/null && sudo tmutil disablelocal
320 |
321 | # Show the main window when launching Activity Monitor
322 | defaults write com.apple.ActivityMonitor OpenMainWindow -bool true
323 |
324 | # Visualize CPU usage in the Activity Monitor Dock icon
325 | defaults write com.apple.ActivityMonitor IconType -int 5
326 |
327 | # Show all processes in Activity Monitor
328 | defaults write com.apple.ActivityMonitor ShowCategory -int 0
329 |
330 | # Sort Activity Monitor results by CPU usage
331 | defaults write com.apple.ActivityMonitor SortColumn -string "CPUUsage"
332 | defaults write com.apple.ActivityMonitor SortDirection -int 0
333 |
334 | # Use plain text mode for new TextEdit documents
335 | defaults write com.apple.TextEdit RichText -int 0
336 |
337 | # Open and save files as UTF-8 in TextEdit
338 | defaults write com.apple.TextEdit PlainTextEncoding -int 4
339 | defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4
340 |
341 | # Enable the WebKit Developer Tools in the Mac App Store
342 | defaults write com.apple.appstore WebKitDeveloperExtras -bool true
343 |
344 | # Enable Debug Menu in the Mac App Store
345 | defaults write com.apple.appstore ShowDebugMenu -bool true
346 |
347 | # Enable the automatic update check
348 | defaults write com.apple.SoftwareUpdate AutomaticCheckEnabled -bool true
349 |
350 | # Check for software updates daily, not just once per week
351 | defaults write com.apple.SoftwareUpdate ScheduleFrequency -int 1
352 |
353 | # Download newly available updates in background
354 | defaults write com.apple.SoftwareUpdate AutomaticDownload -int 1
355 |
356 | # Install System data files & security updates
357 | defaults write com.apple.SoftwareUpdate CriticalUpdateInstall -int 1
358 |
359 | # Automatically download apps purchased on other Macs
360 | defaults write com.apple.SoftwareUpdate ConfigDataInstall -int 1
361 |
362 | # Turn on app auto-update
363 | defaults write com.apple.commerce AutoUpdate -bool true
364 |
365 | # Allow the App Store to reboot machine on macOS updates
366 | defaults write com.apple.commerce AutoUpdateRestartRequired -bool true
367 |
368 | # Prevent Photos from opening automatically when devices are plugged in
369 | defaults -currentHost write com.apple.ImageCapture disableHotPlug -bool true
370 |
371 | # Disable automatic emoji substitution (i.e. use plain text smileys)
372 | defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticEmojiSubstitutionEnablediMessage" -bool false
373 |
374 | # Disable smart quotes as it’s annoying for messages that contain code
375 | defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "automaticQuoteSubstitutionEnabled" -bool false
376 |
377 | # Disable continuous spell checking
378 | defaults write com.apple.messageshelper.MessageController SOInputLineSettings -dict-add "continuousSpellCheckingEnabled" -bool false
379 |
380 | # Create a nice last-change git log message, from https://twitter.com/elijahmanor/status/697055097356943360
381 | git config --global alias.lastchange 'log -p --follow -n 1'
382 |
--------------------------------------------------------------------------------
/nvim/init.vim:
--------------------------------------------------------------------------------
1 | let mapleader = " "
2 |
3 | " Install vundle
4 | let shouldInstallBundles = 0
5 |
6 | if !filereadable($HOME . "/.config/nvim/autoload/plug.vim")
7 | echo "~≥ Installing vim-plug \n"
8 | silent !curl -fLo $HOME/.config/nvim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
9 | let shouldInstallBundles = 1
10 | endif
11 |
12 | " Plugins
13 | call plug#begin('~/.config/nvim/plugged')
14 | Plug 'tpope/vim-vinegar'
15 | Plug 'tpope/vim-surround'
16 | Plug 'tpope/vim-commentary'
17 | Plug 'tpope/vim-repeat'
18 | Plug 'tpope/vim-fugitive'
19 | Plug 'tpope/vim-projectionist'
20 | Plug 'tpope/vim-bundler', { 'for': 'ruby' }
21 | Plug 'tpope/vim-rake', { 'for': 'ruby' }
22 | Plug 'vim-ruby/vim-ruby', { 'for': 'ruby' }
23 | Plug 'airblade/vim-gitgutter'
24 | Plug 'nelstrom/vim-textobj-rubyblock', { 'for': 'ruby' } | Plug 'kana/vim-textobj-user'
25 | Plug 'vim-scripts/matchit.zip'
26 | Plug 'benekastah/neomake', { 'on': 'Neomake' }
27 | Plug 'fatih/vim-go', { 'for': 'go' }
28 | Plug 'christoomey/vim-tmux-navigator'
29 | Plug 'christoomey/vim-tmux-runner'
30 | Plug 'wincent/terminus'
31 | Plug 'kurkale6ka/vim-pairs'
32 | Plug 'w0ng/vim-hybrid'
33 | Plug 'janko-m/vim-test', { 'for': ['ruby', 'javascript'] }
34 | Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
35 | Plug 'junegunn/fzf.vim'
36 | Plug 'elzr/vim-json', {'for' : 'json'}
37 | Plug 'hail2u/vim-css3-syntax', { 'for': [ 'css', 'scss', 'sass'] }
38 | Plug 'ervandew/supertab'
39 | " Plug 'Shougo/deoplete.nvim'
40 | Plug 'SirVer/ultisnips'
41 | " Plug 'zchee/deoplete-go', { 'do': 'make'}
42 | Plug 'Shougo/neoinclude.vim'
43 | Plug 'Raimondi/delimitMate' "must be before vim-endwise
44 | Plug 'tpope/vim-endwise' "must be after delimitMate
45 | Plug 'tpope/vim-markdown', { 'for': 'markdown' }
46 | Plug 'jgdavey/tslime.vim'
47 | Plug 'ekalinin/Dockerfile.vim', { 'for': ['dockerfile', 'Dockerfile'] }
48 | Plug 'tpope/vim-rails', { 'for': 'ruby' }
49 | Plug 'mattn/emmet-vim'
50 | Plug 'mattn/gist-vim' | Plug 'mattn/webapi-vim'
51 | Plug 'junegunn/vim-easy-align'
52 | Plug 'nicholaides/words-to-avoid.vim'
53 | Plug 'chrisbra/Colorizer'
54 | Plug 'thinca/vim-ref'
55 | Plug 'ngmy/vim-rubocop', { 'for': 'ruby' }
56 | Plug 'pangloss/vim-javascript', { 'for': 'javascript' }
57 | Plug 'maxmellon/vim-jsx-pretty', { 'for': 'javascript' }
58 | " Plug 'carlitux/deoplete-ternjs', { 'do': 'yarn global add tern' }
59 | Plug 'ternjs/tern_for_vim', { 'for': 'javascript' }
60 | Plug 'editorconfig/editorconfig-vim'
61 | " Plug 'dracula/vim', { 'as': 'dracula' }
62 | " Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
63 | " Plug 'leafgarland/typescript-vim'
64 | " Plug 'mhartington/nvim-typescript'
65 | Plug 'prettier/vim-prettier', {
66 | \ 'do': 'npm install',
67 | \ 'for': ['javascript', 'typescript', 'css', 'less', 'scss'] }
68 | Plug 'haishanh/night-owl.vim'
69 | call plug#end()
70 |
71 | if shouldInstallBundles == 1
72 | echo "~> Installing plugs\n"
73 | :PlugInstall
74 | endif
75 |
76 | " Vim Config
77 | filetype plugin indent on
78 | syntax enable
79 |
80 | let g:python3_host_prog = '/usr/bin/python3'
81 |
82 | " General
83 | set ruler
84 | set autowrite
85 | set noswapfile nowritebackup nobackup
86 | set number relativenumber
87 | set history=1000
88 | set ttimeout ttimeoutlen=1 timeoutlen=500
89 | set wildmenu wildmode=list:full
90 | set wildignore=*.o,*.obj,tmp,.git,node_modules,bower_components,.DS_Store,build
91 | set visualbell
92 | set fileformats+=mac
93 | set display+=lastline
94 | set nofoldenable
95 | set splitright splitbelow
96 | set cursorline
97 | set pumheight=10
98 | set nowrap
99 | set inccommand=nosplit
100 | set showcmd
101 | set termguicolors
102 |
103 | " Indendation
104 | set autoindent smarttab expandtab
105 | set shiftround tabstop=2 shiftwidth=2
106 | set pastetoggle=
107 |
108 | " Search
109 | set gdefault
110 | set ignorecase smartcase
111 |
112 | set list
113 | set listchars=tab:▸\ ,trail:•,extends:»,precedes:«,nbsp:¬
114 | set scrolloff=1 sidescrolloff=5
115 |
116 | colorscheme dracula
117 | set bg=dark
118 | syntax on
119 | color dracula
120 |
121 | " Mappings
122 |
123 | inoremap u
124 | noremap so :w :so ~/.config/nvim/init.vim
125 | noremap vi :tabe ~/.config/nvim/init.vim
126 | noremap pi :w :so ~/.config/nvim/init.vim :PlugInstall
127 | noremap h :nohl
128 | noremap sp :UltiSnipsEdit
129 | vnoremap "+y
130 | vnoremap // y/\V"
131 | vnoremap ag y:Ag "
132 | nnoremap ag :Ag
133 |
134 | nnoremap
135 |
136 | nmap k gk
137 | nmap j gj
138 | map Q
139 | map K
140 |
141 | inoremap jk
142 |
143 | command! Q q
144 | command! Qa qa
145 |
146 | " Do not show stupid q: window
147 | map q: :q
148 |
149 | " tmux-runner
150 | let g:VtrUseVtrMaps = 1
151 | let g:VtrGitCdUpOnOpen = 0
152 | let g:VtrPercentage = 30
153 | let g:vtr_filetype_runner_overrides = {
154 | \ 'go': 'go run {file}',
155 | \ 'php': 'hhvm {file}'
156 | \ }
157 |
158 | " Neomake
159 | autocmd! BufWritePost * Neomake
160 | let g:neomake_scss_enabled_checkers = ['sass-lint']
161 |
162 | " vim-test
163 | let test#strategy = "vtr"
164 | " let test#strategy = "tslime"
165 | "
166 | nmap s :TestNearest
167 | nmap r :TestFile
168 | nmap a :TestSuite
169 | nmap l :TestLast
170 |
171 | " tmux-navigator
172 | let g:tmux_navigator_no_mappings = 1
173 | nnoremap :TmuxNavigateLeft
174 | nnoremap :TmuxNavigateDown
175 | nnoremap :TmuxNavigateUp
176 | nnoremap :TmuxNavigateRight
177 |
178 | " Ultisnips
179 | let g:UltiSnipsExpandTrigger = ''
180 | let g:UltiSnipsJumpForwardTrigger = ''
181 | let g:UltiSnipsJumpBackwardTrigger = ''
182 | let g:UltiSnipsEditSplit = 'vertical'
183 |
184 | let g:UltiSnipsSnippetsDir='~/.config/nvim/UltiSnips'
185 | let g:UltiSnipsSnippetDirectories=['UltiSnips']
186 | " delimitMate
187 | let g:delimitMate_expand_space = 1
188 | let g:delimitMate_expand_cr = 1
189 | let g:delimitMate_smart_quotes = 1
190 | let g:delimitMate_expand_inside_quotes = 0
191 | let g:delimitMate_smart_matchpairs = '^\%(\w\|\$\)'
192 |
193 | " Fzf
194 | nnoremap :FZF
195 | nnoremap b :Buffers
196 |
197 | " neomake
198 | let g:neomake_javascript_enabled_makers = ['eslint']
199 |
200 | " vim-jsx
201 | let g:jsx_ext_required = 0
202 |
203 | " Enable Emmet just for HTML/CSS/ERB
204 | let g:user_emmet_install_global = 0
205 | autocmd FileType html,css,eruby,eco,javascript.jsx,javascript,md EmmetInstall
206 |
207 | " Align GitHub-flavored Markdown tables
208 | au FileType markdown vmap :EasyAlign*
209 |
210 | " Allow project-specific `vimrc`s:
211 | " http://andrew.stwrt.ca/posts/project-specific-vimrc/
212 | set exrc
213 |
214 | autocmd FileType ruby,javascript,javascript.jsx,css,scss,html autocmd BufWritePre :%s/\s\+$//e
215 | autocmd BufRead,BufNewFile .eslintrc,.jscsrc,.jshintrc,.babelrc,.tern-project set ft=json
216 |
217 | " json
218 | let g:vim_json_syntax_conceal = 0
219 |
220 | " let g:deoplete#enable_smart_case = 1
221 | " let g:deoplete#enable_at_startup = 1
222 | " let g:deoplete#file#enable_buffer_path = 1
223 | " let g:deoplete#omni#input_patterns = {}
224 |
225 | if has('persistent_undo')
226 | set undofile
227 | set undodir=~/.config/nvim/tmp/undo//
228 | endif
229 |
230 | " go
231 | let g:go_fmt_command = 'goimports'
232 | let g:go_highlight_types = 1
233 | let g:go_auto_type_info = 1
234 | au FileType go nmap gd (go-doc)
235 | au FileType go nmap r (go-test)
236 | au FileType go nmap s (go-test-func)
237 | au FileType go nmap gr (go-run)
238 | au FileType go nmap c (go-coverage-toggle)
239 | au FileType go command! -bang A call go#alternate#Switch(0, '')
240 | au FileType go command! -bang AV call go#alternate#Switch(0, "vsplit")
241 | au FileType go command! -bang AS call go#alternate#Switch(0, "split")
242 | au FileType go set colorcolumn=80
243 |
244 | " EasyAlign
245 | nmap ga (EasyAlign)
246 | xmap ga (EasyAlign)
247 |
248 | " Rubocop
249 | let g:vimrubocop_keymap = 0
250 | nmap ra :RuboCop -a
251 |
252 | " ==================================================
253 | " Spell check configuration
254 | " ==================================================
255 | let g:myLangList=["nospell","es_es","en_us"]
256 | function! ToggleSpell()
257 | if !exists( "b:myLang" )
258 | if &spell
259 | let b:myLang=index(g:myLangList, &spelllang)
260 | else
261 | let b:myLang=0
262 | endif
263 | endif
264 | let b:myLang=b:myLang+1
265 | if b:myLang>=len(g:myLangList) | let b:myLang=0 | endif
266 | if b:myLang==0
267 | setlocal nospell
268 | else
269 | execute "setlocal spell spelllang=".get(g:myLangList, b:myLang)
270 | endif
271 | echo "spell checking language:" g:myLangList[b:myLang]
272 | endfunction
273 |
274 | nmap :call ToggleSpell()
275 |
276 | set statusline=""
277 | set statusline+=%{exists('g:loaded_fugitive')?fugitive#statusline():''}
278 | set statusline+=%{exists('g:loaded_fugitive')?'\ ':''}
279 | set statusline+=%f\ [ASCII=\%03.3b]
280 | set statusline+=[COL=\%c]
281 |
282 | if has("autocmd")
283 | au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
284 | endif
285 |
286 | " let g:nvim_typescript#max_completion_detail=100
287 |
288 | let g:tern_request_timeout = 1
289 |
290 | let g:tern#command = ["tern"]
291 | let g:tern#arguments = ["--persistent"]
292 |
293 | nmap mp (Prettier)
294 | let g:prettier#config#tab_width = 4
295 | let g:prettier#config#jsx_bracket_same_line = 'false'
296 | let g:prettier#config#bracket_spacing = 'true'
297 |
298 | function! ParseJiraFromBranch()
299 | let branch = system('git rev-parse --abbrev-ref HEAD 2&>1')
300 | return substitute(branch, '.*\(OBK433-[0-9]\+\).*', '\1', '')
301 | endfunction
302 |
303 | function! JiraIdCommitMessage()
304 | let jira_id = ParseJiraFromBranch()
305 | return jira_id.' '
306 | endfunction
307 |
308 | function! InsertJiraId()
309 | if getline(1) =~# 'OBK433'
310 | return
311 | endif
312 |
313 | let message = JiraIdCommitMessage()
314 | execute "normal ggO".message
315 | startinsert!
316 | endfunction
317 |
318 | au FileType gitcommit au! BufEnter COMMIT_EDITMSG call setpos('.', [0, 1, 1, 0])
319 | au FileType gitcommit au! BufEnter COMMIT_EDITMSG call InsertJiraId()
320 |
321 | " let g:deoplete#enable_at_startup = 1
--------------------------------------------------------------------------------
/scripts/iterm-colors-install.sh:
--------------------------------------------------------------------------------
1 | git clone https://github.com/mbadolato/iTerm2-Color-Schemes ~/dotfiles/iterm-color-schemes
--------------------------------------------------------------------------------
/scripts/zsh-antigen.sh:
--------------------------------------------------------------------------------
1 | export LANG=en_US.UTF-8
2 | export LC_ALL=en_US.UTF-8
3 | export PATH=/usr/local/bin:/usr/local/sbin:$PATH
4 |
5 | # Antigen
6 | source ./antigen.zsh
7 |
8 | antigen use oh-my-zsh
9 |
10 | antigen bundle colorize
11 | antigen bundle command-not-found
12 | antigen bundle git
13 | antigen bundle pip
14 | antigen bundle jump
15 | antigen bundle yarn
16 | antigen bundle lein
17 | antigen bundle common-aliases
18 | antigen bundle autojump
19 | antigen bundle docker
20 | antigen bundle gitfast
21 | antigen bundle git-extras
22 | antigen bundle git-flow
23 | antigen bundle history
24 | antigen bundle lol
25 | antigen bundle osx
26 | antigen bundle tmux
27 | antigen bundle vscode
28 | antigen bundle z
29 | antigen bundle brew
30 | antigen bundle chucknorris
31 | antigen bundle command-not-found
32 | antigen bundle Composer
33 | antigen bundle common-aliases
34 | antigen bundle copyfile
35 | antigen bundle encode64
36 | antigen bundle compleat
37 | antigen bundle dircycle
38 | antigen bundle dirhistory
39 |
40 | antigen bundle arialdomartini/oh-my-git
41 | antigen theme arialdomartini/oh-my-git-themes oppa-lana-style
42 | #antigen bundle robbyrussell/oh-my-zsh plugins/gitfast
43 | #antigen bundle robbyrussell/oh-my-zsh plugins/git-flow
44 | antigen bundle robbyrussell/oh-my-zsh plugins/npm
45 | antigen bundle robbyrussell/oh-my-zsh plugins/pip
46 | # antigen bundle robbyrussell/oh-my-zsh plugins/autoenv
47 | antigen bundle robbyrussell/oh-my-zsh plugins/virtualenvwrapper
48 |
49 | antigen bundle zsh-users/zsh-completions
50 | antigen bundle zsh-users/zsh-syntax-highlighting
51 | antigen bundle zsh-users/zsh-history-substring-search
52 | antigen bundle zsh-users/zsh-autosuggestions
53 | antigen bundle chrissicool/zsh-256color
54 | antigen bundle pawelad/honukai-iterm-zsh
55 | antigen theme pawelad/honukai-iterm-zsh honukai
56 |
57 | antigen bundle unixorn/rake-completion.zshplugin
58 | antigen bundle unixorn/autoupdate-zgen
59 | antigen bundle unixorn/jpb.zshplugin
60 | antigen bundle unixorn/warhol.plugin.zsh
61 | antigen bundle unixorn/tumult.plugin.zsh
62 | antigen bundle djui/alias-tips
63 | antigen bundle unixorn/git-extra-commands
64 | antigen bundle unixorn/bitbucket-git-helpers.plugin.zsh
65 | antigen bundle skx/sysadmin-util
66 | antigen bundle peterhurford/git-it-on.zsh
67 | antigen bundle StackExchange/blackbox
68 | antigen bundle supercrabtree/k
69 | antigen bundle b4b4r07/enhancd
70 | antigen bundle fcambus/ansiweather
71 | antigen bundle iam4x/zsh-iterm-touchbar
72 | antigen bundle lukechilds/zsh-better-npm-completion
73 | antigen bundle g-plane/zsh-yarn-autocompletions
74 | antigen bundle djui/alias-tips
75 |
76 | antigen theme bhilburn/powerlevel9k powerlevel9k
77 | antigen theme denysdovhan/spaceship-prompt spaceship
78 |
79 | antigen apply
--------------------------------------------------------------------------------
/scripts/zsh-zgen.sh:
--------------------------------------------------------------------------------
1 | export LANG=en_US.UTF-8
2 | export LC_ALL=en_US.UTF-8
3 |
4 | source ~/zgen/zgen.zsh
5 | zgen oh-my-zsh
6 |
7 | zgen oh-my-zsh plugins/colorize
8 | zgen oh-my-zsh plugins/command-not-found
9 | zgen oh-my-zsh plugins/git
10 | zgen oh-my-zsh plugins/pip
11 | zgen oh-my-zsh plugins/jump
12 | zgen oh-my-zsh plugins/yarn
13 | zgen oh-my-zsh plugins/lein
14 | zgen oh-my-zsh plugins/common-aliases
15 | zgen oh-my-zsh plugins/autojump
16 | zgen oh-my-zsh plugins/docker
17 | zgen oh-my-zsh plugins/gitfast
18 | zgen oh-my-zsh plugins/git-extras
19 | zgen oh-my-zsh plugins/git-flow
20 | zgen oh-my-zsh plugins/history
21 | zgen oh-my-zsh plugins/lol
22 | zgen oh-my-zsh plugins/osx
23 | zgen oh-my-zsh plugins/tmux
24 | zgen oh-my-zsh plugins/vscode
25 | zgen oh-my-zsh plugins/z
26 | zgen oh-my-zsh plugins/brew
27 | # zgen oh-my-zsh plugins/chucknorris
28 | zgen oh-my-zsh plugins/command-not-found
29 | zgen oh-my-zsh plugins/Composer
30 | zgen oh-my-zsh plugins/common-aliases
31 | zgen oh-my-zsh plugins/copyfile
32 | zgen oh-my-zsh plugins/encode64
33 | zgen oh-my-zsh plugins/compleat
34 | zgen oh-my-zsh plugins/dircycle
35 | zgen oh-my-zsh plugins/dirhistory
36 | zgen oh-my-zsh plugins/npm
37 |
38 | # zgen load bhilburn/powerlevel9k powerlevel9k
39 | zgen load denysdovhan/spaceship-prompt spaceship
40 |
41 | zgen load arialdomartini/oh-my-git
42 | zgen load arialdomartini/oh-my-git-themes oppa-lana-style
43 |
44 | zgen load zsh-users/zsh-completions
45 | zgen load zsh-users/zsh-syntax-highlighting
46 | zgen load zsh-users/zsh-history-substring-search
47 | zgen load zsh-users/zsh-autosuggestions
48 | zgen load chrissicool/zsh-256color
49 | zgen load pawelad/honukai-iterm-zsh
50 | zgen load pawelad/honukai-iterm-zsh honukai
51 |
52 | zgen load unixorn/rake-completion.zshplugin
53 | zgen load unixorn/autoupdate-zgen
54 | # zgen load unixorn/jpb.zshplugin
55 | zgen load unixorn/warhol.plugin.zsh
56 | zgen load unixorn/tumult.plugin.zsh
57 | zgen load djui/alias-tips
58 | zgen load unixorn/git-extra-commands
59 | zgen load unixorn/bitbucket-git-helpers.plugin.zsh
60 | zgen load skx/sysadmin-util
61 | zgen load peterhurford/git-it-on.zsh
62 | zgen load StackExchange/blackbox
63 | zgen load supercrabtree/k
64 | zgen load b4b4r07/enhancd
65 | zgen load fcambus/ansiweather
66 | zgen load iam4x/zsh-iterm-touchbar
67 | zgen load lukechilds/zsh-better-npm-completion
68 | zgen load g-plane/zsh-yarn-autocompletions
69 | zgen load djui/alias-tips
70 |
71 |
72 | zgen save
73 |
--------------------------------------------------------------------------------
/setup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo "🍓 Installing Mac hacks..."
4 | # source ~/install.sh
5 | source ~/mac/default-settings.sh
6 |
7 |
8 | HOMEWORLD=~/.dotfiles
9 |
10 | echo "🎁 Your configuration word will be stored at ${HOMEWORLD}"
11 |
12 | echo "🚀 Copying ${PWD}"
13 | echo "👇 To ~/.dotfiles"
14 |
15 | cp -rf ./Desktop/code/dotfiles ~/.dotfiles
16 |
17 | echo "🔪 Backuping pervous setup to ~/backup"
18 | mkdir ~/backup
19 |
20 | echo "🌩😩 It's okay if something fails here."
21 |
22 | sudo mv -f ~/.zshrc ~/backup
23 | sudo mv -f ~/.zsh_aliases ~/backup
24 | sudo mv -f ~/.vimrc ~/.aliases ~/backup
25 | sudo mv -f ~/.zgen_setup ~/backup
26 | sudo mv -f ~/.inputrc ~/backup
27 | sudo mv -f ~/.screenrc ~/backup
28 | sudo mv -f ~/.exports ~/backup
29 | sudo mv -f ~/.zsh_functions ~/backup
30 | sudo mv -f ~/.exports ~/backup
31 | sudo mv -f ~/.bash_prompt ~/backup
32 | sudo mv -f ~/.bashrc ~/backup
33 | sudo mv -f ~/.bash_profile ~/backup
34 |
35 | echo "🔪 Removing prevous config..."
36 | echo "😩 It's okay."
37 |
38 | rm -rf ~/.zshrc
39 | rm -rf ~/.zsh_aliases
40 | rm -rf ~/.vimrc
41 | rm -rf ~/.aliases
42 | rm -rf ~/.zgen_setup
43 | rm -rf ~/.inputrc
44 | rm -rf ~/.screenrc
45 | rm -rf ~/.exports
46 | rm -rf ~/.zsh_functions
47 | rm -rf ~/.exports
48 | rm -rf ~/.bash_prompt
49 | rm -rf ~/.bashrc
50 | rm -rf ~/.bash_profile
51 |
52 | echo "🍆 Setting up Everything."
53 | echo "👉👈 Linking all your configs with ${HOMEWORLD}"
54 |
55 | ln -s ~/dotfiles/zsh/zshrc.zsh ~/.zshrc
56 | ln -s ~/.dotfiles/zsh/zsh_aliases.zsh ~/.zsh_aliases
57 | ln -s ~/.dotfiles/zsh/zsh_functions.zsh ~/.zsh_functions
58 | ln -s ~/.dotfiles/powerlevel9/defaulttheme.zsh ~/.powerlevel9
59 |
60 | ln -s ~/.zgen_setup ~/.dotfiles/zsh/zgen_setup.zsh
61 | ln -s ~/.dotfiles/vimrc.js/vimrc /.vimrc
62 | ln -s ~/.dotfiles/vimrc.js ~/.vimrc.js
63 | ln -s ~/.dotfiles/.bashrc ~/.bashrc
64 | ln -s ~/.dotfiles/.bash_profile ~/.bash_profile
65 | ln -s ~/.dotfiles/.bash_prompt ~/.bash_prompt
66 | ln -s ~/.dotfiles/.exports ~/.exports
67 | ln -s ~/.dotfiles/.inputrc ~/.inputrc
68 | ln -s ~/.dotfiles/.screenrc ~/.screenrc
69 | ln -s ~/.dotfiles/.aliases ~/.aliases
70 |
71 | mkdir -p ~/.config
72 | mkdir -p ~/.config/nvim
73 |
74 | ln -s ~/.dotfiles/nvim/init.vim ~/.config/nvim/init.vim
75 |
76 | # ln -s ~/.dotfiles/colorls ~/.config/colorlsx
77 |
78 | echo "💣 Enjoy that. Now zsh install all 🍓 plugins."
79 |
80 | zsh
81 |
82 | echo "💣 🔪🔪🔪 Done. Enjoy that."
83 |
--------------------------------------------------------------------------------
/vimrc.js/.gitignore:
--------------------------------------------------------------------------------
1 | *.local
2 |
--------------------------------------------------------------------------------
/vimrc.js/.vimrc.swp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/andreystarkov/dotfiles/27f7f41c44df39cf5e239ec6cc66506f2bd864f0/vimrc.js/.vimrc.swp
--------------------------------------------------------------------------------
/vimrc.js/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as
6 | contributors and maintainers pledge to making participation in our project and
7 | our community a harassment-free experience for everyone, regardless of age, body
8 | size, disability, ethnicity, gender identity and expression, level of experience,
9 | nationality, personal appearance, race, religion, or sexual identity and
10 | orientation.
11 |
12 | ## Our Standards
13 |
14 | Examples of behavior that contributes to creating a positive environment
15 | include:
16 |
17 | * Using welcoming and inclusive language
18 | * Being respectful of differing viewpoints and experiences
19 | * Gracefully accepting constructive criticism
20 | * Focusing on what is best for the community
21 | * Showing empathy towards other community members
22 |
23 | Examples of unacceptable behavior by participants include:
24 |
25 | * The use of sexualized language or imagery and unwelcome sexual attention or
26 | advances
27 | * Trolling, insulting/derogatory comments, and personal or political attacks
28 | * Public or private harassment
29 | * Publishing others' private information, such as a physical or electronic
30 | address, without explicit permission
31 | * Other conduct which could reasonably be considered inappropriate in a
32 | professional setting
33 |
34 | ## Our Responsibilities
35 |
36 | Project maintainers are responsible for clarifying the standards of acceptable
37 | behavior and are expected to take appropriate and fair corrective action in
38 | response to any instances of unacceptable behavior.
39 |
40 | Project maintainers have the right and responsibility to remove, edit, or
41 | reject comments, commits, code, wiki edits, issues, and other contributions
42 | that are not aligned to this Code of Conduct, or to ban temporarily or
43 | permanently any contributor for other behaviors that they deem inappropriate,
44 | threatening, offensive, or harmful.
45 |
46 | ## Scope
47 |
48 | This Code of Conduct applies both within project spaces and in public spaces
49 | when an individual is representing the project or its community. Examples of
50 | representing a project or community include using an official project e-mail
51 | address, posting via an official social media account, or acting as an appointed
52 | representative at an online or offline event. Representation of a project may be
53 | further defined and clarified by project maintainers.
54 |
55 | ## Enforcement
56 |
57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be
58 | reported by contacting the project team at zach.perrault+vimrc@gmail.com. All
59 | complaints will be reviewed and investigated and will result in a response that
60 | is deemed necessary and appropriate to the circumstances. The project team is
61 | obligated to maintain confidentiality with regard to the reporter of an incident.
62 | Further details of specific enforcement policies may be posted separately.
63 |
64 | Project maintainers who do not follow or enforce the Code of Conduct in good
65 | faith may face temporary or permanent repercussions as determined by other
66 | members of the project's leadership.
67 |
68 | ## Attribution
69 |
70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71 | available at [http://contributor-covenant.org/version/1/4][version]
72 |
73 | [homepage]: http://contributor-covenant.org
74 | [version]: http://contributor-covenant.org/version/1/4/
75 |
--------------------------------------------------------------------------------
/vimrc.js/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | Hello! I'm excited that you're interested in contributing to this
4 | project. I wish there was more information for you in this file but as
5 | the project is quite new I haven't quite gotten to it yet.
6 |
7 | That being said contributions are more than welcome! For now the only
8 | requirement is that you follow the [Code of Conduct](CODE_OF_CONDUCT.md).
9 |
10 | ## Code of Conduct
11 |
12 | All maintainers and contributors are required to follow this project
13 | [Code of Conduct](CODE_OF_CONDUCT.md)
14 |
--------------------------------------------------------------------------------
/vimrc.js/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2016 Zach Perrault
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/vimrc.js/README.md:
--------------------------------------------------------------------------------
1 | # vimrc.js
2 |
3 | A vimrc that Just Works™ for modern JavaScript development.
4 |
5 | ## Installing
6 |
7 | ### The easy way
8 |
9 | First, install [`neovim`](https://neovim.io/) with [Python3 support](https://github.com/neovim/python-client).
10 | If you're on ~OS X~ macOS and have [homebrew](https://brew.sh) installed,
11 | you can issue this command: `brew install python3 neovim/neovim/neovim; pip3 install neovim`.
12 |
13 | While most of the features available in this project will work in
14 | regular vim, neovim's asynchronous plugin support means the editor is
15 | much faster even when dealing with complex tasks like FlowType
16 | autocomplete and linting.
17 |
18 | The easiest way to download and use this configuration is to issue the
19 | following command.
20 |
21 | ```
22 | curl -o- https://raw.githubusercontent.com/zperrault/vimrc.js/master/install.sh | bash
23 | ```
24 |
25 | This command will download the [installation script](install.sh) and run it
26 | through BASH. This script will detect if you have neovim installed, install
27 | vim-plug, clone this repo into `~/.vimrc.js`, backup your existing vim or
28 | neovim configuration, symlink `~/.vimrc.js/vimrc` to the appropriate path,
29 | and install plugins with vim-plug.
30 |
31 | I understand that `curl`-ing and executing random shell scripts can be scary.
32 | You are encouraged to view the source of this file (and tell me how it can
33 | be better).
34 |
35 | Once installed, you can add your own plugins to `~/.vimrc.js/vimrc.plugs.local` and
36 | your own settings to `~/.vimrc.js/vimrc.local`.
37 |
38 | ### The DIY way
39 |
40 | You are by no means required to use the automated installer. All used plugins
41 | are listed in [`vimrc.plugs`](vimrc.plugs) and all settings for these plugins
42 | are listed in [`vimrc`](vimrc). Feel free to copy and paste pieces of these
43 | files into your own vimrc.
44 |
45 | Once installed, you can add your own plugins to `~/.vimrc.js/vimrc.plugs.local` and
46 | your own settings to `~/.vimrc.js/vimrc.local`.
47 |
48 | ## Updating
49 |
50 | If you've only modified the `*.local` files, you can update to the
51 | latest version at any time by running the following:
52 |
53 | ```
54 | cd ~/.vimrc.js
55 | git pull origin master
56 | command $(which nvim || which vim) +PlugUpdate +qall
57 | ```
58 |
59 | ## Usage
60 |
61 | ### Keybindings
62 |
63 | - ``- open project tree viewer
64 | - `` - start fuzzy file finding
65 | - keybindings provided by [vim-commentary](https://github.com/tpope/vim-commentary#commentaryvim) and [vim-surround](https://github.com/tpope/vim-surround#surroundvim)
66 |
67 | ## What's in the box?
68 |
69 | ### JavaScript, es6+, FlowType, and JSX syntax highlighting and indentation
70 |
71 | Unfortunately there isn't a single plugin out there that provides proper
72 | syntax highlighting for modern JavaScript development. This project uses
73 | a combination of three plugins to achieve syntax highlighting bliss.
74 |
75 | * pangloss/vim-javascript
76 | * mxw/vim-jsx
77 | * gavocanov/vim-js-indent
78 |
79 | 
80 |
81 | ### Intelligent and fast autocomplete
82 |
83 | A combination of deoplete and tern means that you'll get smart
84 | completion suggestions as you type.
85 |
86 | 
87 |
88 | ### Eslint and FlowType errors on save
89 |
90 | Errors reported by eslint and flow are displayed inside vim so you can
91 | jump straight to the problem.
92 |
93 | ### Fuzzy file searching
94 |
95 | Fuzzy finding is provided by `fzf`. Open the fuzzy searcher using ``
96 | (like Atom)
97 |
98 | 
99 |
100 | ### File tree viewing
101 |
102 | NERDTree provides a project viewer. Toggle it using `` (also
103 | similar to Atom).
104 |
105 | 
106 |
107 | ### Git diff markers in the gutter
108 |
109 | [vim-gitgutter](https://github.com/airblade/vim-gitgutter)
110 |
--------------------------------------------------------------------------------
/vimrc.js/install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -e
3 |
4 | VIMRC=~/.vimrc
5 | AUTOLOAD=~/.vim/autoload
6 | VIMEXE=vim
7 |
8 | if (which nvim > /dev/null); then
9 | VIMRC=~/.config/nvim/init.vim
10 | AUTOLOAD=~/.config/nvim/autoload
11 | VIMEXE=nvim
12 | fi
13 |
14 | cat <.
32 |
33 | WhatWillHappen
34 |
35 | read THROW_AWAY
36 |
37 | echo -n "Installing vim-plug... "
38 | curl -sfLo $AUTOLOAD/plug.vim --create-dirs \
39 | https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
40 | echo "done."
41 |
42 | echo -n "Installing vimrc.js... "
43 | git clone --quiet https://github.com/zperrault/vimrc.js.git ~/.vimrc.js
44 | echo "done."
45 |
46 | if [[ -f $VIMRC ]]; then
47 | echo -n "Backing up existing vimrc... "
48 | mv $VIMRC $VIMRC.bak
49 | echo "done."
50 | fi
51 |
52 | echo -n "Linking vimrc... "
53 | ln -s ~/.vimrc.js/vimrc $VIMRC
54 | echo "done."
55 |
56 | echo -n "Installing plugins... "
57 | command $VIMEXE +PlugInstall +qall
58 | echo "done."
59 |
60 |
61 | cat < :FZF
72 | inoremap :FZFi
73 |
74 | " == scrooloose/nerdtree ==
75 | nnoremap :NERDTreeToggle
76 | inoremap :NERDTreeToggle
77 |
78 | try
79 | source ~/.vimrc.js/vimrc.local
80 | catch
81 | endtry
82 |
--------------------------------------------------------------------------------
/vimrc.js/vimrc.plugs:
--------------------------------------------------------------------------------
1 | " == General editor plugins ==
2 | Plug 'tpope/vim-surround'
3 | Plug 'tpope/vim-commentary'
4 | Plug 'scrooloose/nerdtree'
5 | Plug 'tpope/vim-repeat'
6 | Plug 'jiangmiao/auto-pairs'
7 | Plug 'airblade/vim-gitgutter'
8 | Plug 'nathanaelkane/vim-indent-guides'
9 | Plug 'itchyny/lightline.vim'
10 | Plug 'terryma/vim-multiple-cursors'
11 | Plug 'editorconfig/editorconfig-vim'
12 | Plug 'airblade/vim-gitgutter'
13 | Plug 'mhinz/vim-signify'
14 | Plug 'vim-airline/vim-airline'
15 | Plug 'vim-airline/vim-airline-themes'
16 | Plug 'Shougo/unite.vim'
17 | Plug 'devjoe/vim-codequery'
18 | Plug 'tpope/vim-dispatch'
19 | Plug 'mileszs/ack.vim'
20 | Plug 'wsdjeg/FlyGrep.vim'
21 | Plug 'pangloss/vim-javascript'
22 | Plug 'psychollama/further.vim''
23 | Plug 'plasticboy/vim-markdown'
24 | Plug 'vim-pandoc/vim-pandoc'
25 | Plug 'sidofc/mkdx'
26 | Plug 'shougo/deoplete.nvim'
27 | " Plug 'cocopon/iceberg.vim'
28 | Plug 'scrooloose/nerdtree'
29 | Plug 'tpope/vim-fugitive'
30 | Plug 'tpope/vim-surround'
31 | Plug 'scrooloose/syntastic'
32 | Plug 'scrooloose/nerdcommenter'
33 | Plug 'flazz/vim-colorschemes'
34 | Plug 'mxw/vim-jsx'
35 | Plug 'majutsushi/tagbar'
36 | Plug 'ervandew/supertab'
37 | Plug 'BufOnly.vim'
38 | Plug 'wesQ3/vim-windowswap'
39 | Plug 'SirVer/ultisnips'
40 | Plug 'godlygeek/tabular'
41 | Plug 'benmills/vimux'
42 | " == Autocomplete plugins ==
43 | Plug 'ervandew/supertab'
44 | if has('nvim')
45 | Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
46 | Plug 'carlitux/deoplete-ternjs', { 'do': 'npm install -g tern' }
47 | Plug 'steelsojka/deoplete-flow'
48 | else
49 | Plug 'Valloric/YouCompleteMe', { 'do': './install.py --tern-completer' }
50 | endif
51 |
52 | " == JavaScript syntax highlighting ==
53 | Plug 'othree/yajs.vim'
54 | Plug 'othree/es.next.syntax.vim'
55 | Plug 'mxw/vim-jsx'
56 | Plug 'othree/javascript-libraries-syntax.vim'
57 |
58 | " == SCSS and CSS syntax highlighting ==
59 | if v:version < 704
60 | Plug 'JulesWang/css.vim'
61 | endif
62 | Plug 'cakebaker/scss-syntax.vim'
63 |
64 | " == JavaScript tools integration ==
65 | if has('nvim')
66 | Plug 'neomake/neomake'
67 | else
68 | Plug 'scrooloose/syntastic'
69 | Plug 'flowtype/vim-flow'
70 | endif
71 |
72 |
--------------------------------------------------------------------------------
/vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "2gua.rainbow-brackets",
4 | "editorconfig.editorconfig",
5 | "joaomoreno.github-sharp-theme",
6 | "prisma.vscode-graphql",
7 | "anseki.vscode-color",
8 | "fallenwood.viml",
9 | "jock.svg",
10 | "rafamel.subtle-brackets",
11 | "atishay-jain.all-autocomplete",
12 | "ormulahendry.auto-close-tag",
13 | "jpoissonnier.vscode-styled-components",
14 | "rastikerdar.vscode-seedling-icon-theme",
15 | "blanu.vscode-styled-jsx",
16 | "formulahendry.auto-complete-tag",
17 | "juanblanco.solidity-0.0.49sdras.night-owl",
18 | "capaj.vscode-standardjs-snippets",
19 | "formulahendry.auto-rename-tag",
20 | "kumar-harsh.graphql-for-vscode",
21 | "shardulm94.trailing-spaces",
22 | "christian-kohler.npm-intellisense",
23 | "gaulomatic.vscode-icontheme-nomo-dark-macos",
24 | "leizongmin.node-module-intellisense",
25 | "sourcegraph.javascript-typescript",
26 | "coenraads.bracket-pair-colorizer",
27 | "henoc.svgeditor",
28 | "lxspandora.vscode-styled-components-snippets",
29 | "visualstudioexptteam.vscodeintellicode",
30 | "cssho.vscode-svgviewer",
31 | "ibm.xmllanguagesupport",
32 | "mgmcdermott.vscode-language-babel",
33 | "1yzhang.markdown-all-in-one",
34 | "davidbwaters.macos-modern-theme",
35 | "idleberg.svg-icons",
36 | "mquandalle.graphql",
37 | "dotjoshjohnson.xml",
38 | "ikuyadeu.lucario",
39 | "ms-vscode.atom-keybindings",
40 | "dsznajder.es7-react-js-snippets",
41 | "jaredkent.laserwave",
42 | "naumovs.color-highlight"
43 | ]
44 | }
45 |
--------------------------------------------------------------------------------
/vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "editor.fontFamily": "Fira Code",
3 | "editor.fontLigatures": true,
4 | "editor.fontSize": 15,
5 | "editor.lineHeight": 23,
6 | "editor.tabSize": 2,
7 | "editor.renderWhitespace": "all",
8 | "editor.minimap.enabled": false,
9 | "editor.renderIndentGuides": false,
10 | "editor.formatOnPaste": false,
11 | "editor.formatOnSave": false,
12 | "editor.renderLineHighlight": "line",
13 | "editor.hideCursorInOverviewRuler": true,
14 | "editor.scrollBeyondLastLine": false,
15 | "editor.matchBrackets": true,
16 | "editor.occurrencesHighlight": false,
17 | "editor.overviewRulerBorder": false,
18 | "editor.overviewRulerLanes": 0,
19 | "editor.folding": false,
20 | "editor.snippetSuggestions": "top",
21 | "editor.lightbulb.enabled": false,
22 | "editor.lineNumbers": "on",
23 | "editor.cursorBlinking": "solid",
24 | "editor.cursorStyle": "line",
25 | "editor.accessibilitySupport": "off",
26 | "editor.codeLens": true,
27 | "editor.colorDecorators": true,
28 | "editor.dragAndDrop": false,
29 | "editor.glyphMargin": true,
30 | "cSpell.language": "en,ru,en-GB,en-US",
31 | "cSpell.showStatus": false,
32 | "debug.allowBreakpointsEverywhere": true,
33 |
34 | "workbench.tree.horizontalScrolling": true,
35 | "workbench.statusBar.feedback.visible": false,
36 | "workbench.fontAliasing": "antialiased",
37 | "workbench.activityBar.visible": true,
38 | "workbench.settings.editor": "json",
39 | "workbench.colorTheme": "lucy",
40 | "workbench.editor.showIcons": true,
41 | "workbench.iconTheme": "vscode-great-icons",
42 | "workbench.settings.enableNaturalLanguageSearch": false,
43 | "workbench.editor.labelFormat": "short",
44 | "workbench.startupEditor": "none",
45 | "workbench.tips.enabled": false,
46 | // "workbench.colorCustomizations": {
47 | // "gitDecoration.modifiedResourceForeground": "#d4cb68"
48 | // },
49 |
50 | "search.showLineNumbers": true,
51 | "search.smartCase": true,
52 | "search.exclude": {
53 | "**/*/__snapshots__": true
54 | },
55 | "search.location": "panel",
56 |
57 | "window.clickThroughInactive": false,
58 | "window.zoomLevel": 0,
59 | "window.restoreWindows": "all",
60 | "window.title": "${activeEditorMedium}${separator}${rootName}",
61 | "window.newWindowDimensions": "maximized",
62 |
63 | "debug.openDebug": "neverOpen",
64 | "debug.showInStatusBar": "never",
65 | "debug.toolBarLocation": "hidden",
66 |
67 | "terminal.integrated.copyOnSelection": true,
68 | // "terminal.integrated.env.osx": {
69 | // },
70 |
71 | "files.trimTrailingWhitespace": true,
72 | "files.insertFinalNewline": true,
73 |
74 | "breadcrumbs.enabled": true,
75 |
76 | "explorer.confirmDelete": false,
77 | "explorer.decorations.badges": false,
78 | "explorer.openEditors.visible": 0,
79 |
80 | "extensions.ignoreRecommendations": true,
81 |
82 | "code-runner.runInTerminal": false,
83 |
84 | "eslint.autoFixOnSave": false,
85 | "eslint.enable": true,
86 |
87 | "prettier.printWidth": 110,
88 | "prettier.singleQuote": true,
89 | "prettier.trailingComma": "none",
90 | "prettier.jsxBracketSameLine": true,
91 | "prettier.semi": false,
92 | "prettier.useTabs": false,
93 | "prettier.eslintIntegration": true,
94 |
95 | // Settings Sync extension
96 | "sync.gist": "c5e523ad67b6f416fe2fab36007aad59",
97 | "sync.removeExtensions": true,
98 | "sync.syncExtensions": true,
99 | "sync.autoDownload": false,
100 | "sync.autoUpload": true,
101 | "sync.forceDownload": false,
102 | "sync.quietSync": false,
103 | "sync.askGistName": false,
104 |
105 | "git.showInlineOpenFileAction": false,
106 | "git.enabled": true,
107 | "git.autorefresh": true,
108 | "git.autofetch": true,
109 |
110 | "gitlens.menus": {
111 | "editor": {
112 | "blame": false,
113 | "clipboard": true,
114 | "compare": true,
115 | "details": true,
116 | "history": false,
117 | "remote": true
118 | },
119 | "editorGroup": {
120 | "blame": true,
121 | "compare": true,
122 | "history": false,
123 | "remote": false
124 | },
125 | "editorTab": {
126 | "compare": false,
127 | "history": false,
128 | "remote": true
129 | }
130 | },
131 | "gitlens.codeLens.recentChange.enabled": false,
132 | "gitlens.codeLens.authors.enabled": false,
133 | "gitlens.codeLens.enabled": false,
134 | "gitlens.currentLine.enabled": false,
135 | "gitlens.hovers.currentLine.over": "line",
136 | "gitlens.keymap": "chorded", // "alternate",
137 | "gitlens.mode.statusBar.enabled": false,
138 | "gitlens.mode.active": "zen",
139 | "gitlens.statusBar.enabled": false,
140 | "gitlens.views.fileHistory.enabled": true,
141 | "gitlens.views.lineHistory.enabled": true,
142 | "gitlens.codeLens.scopes": ["containers", "document"],
143 | "gitlens.advanced.messages": {
144 | "suppressCommitHasNoPreviousCommitWarning": false,
145 | "suppressCommitNotFoundWarning": false,
146 | "suppressFileNotUnderSourceControlWarning": false,
147 | "suppressGitVersionWarning": false,
148 | "suppressLineUncommittedWarning": false,
149 | "suppressNoRepositoryWarning": false,
150 | "suppressResultsExplorerNotice": false,
151 | "suppressShowKeyBindingsNotice": true,
152 | "suppressUpdateNotice": true,
153 | "suppressWelcomeNotice": false
154 | },
155 | "emmet.syntaxProfiles": {
156 | "javascript": "jsx"
157 | },
158 | "trailing-spaces.trimOnSave": true,
159 | "javascript.updateImportsOnFileMove.enabled": "never",
160 |
161 | // "todo-tree.defaultHighlight": {
162 | // "foreground": "green",
163 | // "type": "none"
164 | // },
165 | // "todo-tree.customHighlight": {
166 | // "TODO": {},
167 | // "FIXME": {}
168 | // }
169 | // "workbench.colorCustomizations": {
170 | // "editor.background": "#201f22",
171 | // "sideBar.background": "#1a1a1d"
172 | // },
173 |
174 | "files.associations": {
175 | ".babelrc": "jsonc",
176 | ".eslintrc": "jsonc",
177 | ".zshrc": "shell",
178 |
179 | },
180 | "files.exclude": {
181 | "**/*.pyc": true,
182 | "**/*.a": true,
183 | "**/*.class": true,
184 | "**/*.db": true,
185 | "**/*.dll": true,
186 | "**/*.dylib": true,
187 | "**/*.egg-info": true,
188 | "**/*.exe": true,
189 | "**/*.idb": true,
190 | "**/*.lib": true,
191 | "**/*.ncb": true,
192 | "**/*.o": true,
193 | "**/*.obj": true,
194 | "**/*.pdb": true,
195 | "**/*.psd": true,
196 | "**/*.pyo": true,
197 | "**/*.sdf": true,
198 | "**/*.so": true,
199 | "**/*.sublime-workspace": true,
200 | "**/*.suo": true,
201 | "**/.bundle": true,
202 | "**/.coverage": true,
203 | "**/.DS_Store": true,
204 | "**/.expo": true,
205 | "**/.git": true,
206 | "**/.githooks": true,
207 | "**/.hg": true,
208 | "**/.pygments-cache": true,
209 | "**/.sass-cache": true,
210 | "**/.svn": true,
211 | "**/.tox": true,
212 | "**/.vagrant": true,
213 | "**/.venv": true,
214 | "**/.virtualenv": true,
215 | "**/__pycache__": true,
216 | "**/_build": true,
217 | "**/_deploy": true,
218 | "**/_site": true,
219 | "**/backstop_data": true,
220 | "**/build": true,
221 | "**/coverage": true,
222 | "**/css_regression_data": true,
223 | "**/CVS": true,
224 | "**/db.sqlite3": true,
225 | "**/dist": true,
226 | "**/env": true,
227 | "**/es5": true,
228 | "**/node_modules*": true,
229 | "**/npm-debug.log*": true,
230 | "**/npm-shrinkwrap.json": true,
231 | "**/static/**/*.css": false,
232 | "**/static/**/*.js": false,
233 | "**/static/wagtailadmin": true,
234 | "**/tmp": true,
235 | "**/var": true,
236 | "**/venv": true,
237 | "**/www": true,
238 | "**/yarn.lock": true,
239 | },
240 |
241 | }
242 |
--------------------------------------------------------------------------------
/vscode/vscode-setup.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo "
4 | Checking if VisualStudioCode is currently installed...
5 | "
6 |
7 | install() {
8 | if [ ! -z "$BASH_VERSION" ]; then
9 | source $HOME/.bashrc
10 | fi
11 |
12 | if [ ! -z "$ZSH_VERSION" ]; then
13 | source $HOME/.zshrc
14 | fi
15 |
16 | cp $(pwd)/vscode/extensions.json $HOME/Library/Application\ Support/Code/User/extensions.json
17 | echo " Copied VisualStudioCode Extensions JSON"
18 |
19 | # cp $(pwd)/vscode/keybindings.json $HOME/Library/Application\ Support/Code/User/keybindings.json
20 | # echo " Copied VisualStudioCode Keybindings JSON"
21 |
22 | cp $(pwd)/vscode/settings.json $HOME/Library/Application\ Support/Code/User/settings.json
23 | echo " Copied VisualStudioCode Settings JSON"
24 |
25 | EXTENSIONS=($(code --list-extensions))
26 | for extension in "${EXTENSIONS[@]}"
27 | do
28 | printf "\e[1;32m\nInstalling \e[1;34m$extension\e[0m\n"
29 | code --install-extension ${extension}
30 | echo ""
31 | done
32 |
33 | echo "All done! installed ${#EXTENSIONS[@]} packages."
34 | sleep 1
35 | code
36 | }
37 |
38 | if hash code 2>/dev/null; then
39 | install
40 | else
41 | brew cask install visual-studio-code
42 | install
43 | fi
44 |
45 |
46 | # DIR=$(dirname "$0")
47 | # cd "$DIR"
48 |
49 | # . ../scripts/functions.sh
50 |
51 | # SOURCE="$(realpath .)"
52 | # DESTINATION="$(realpath ~/Library/Application\ Support/Code/User)"
53 |
54 | # info "Setting up Visual Studio Code..."
55 |
56 | # substep_info "Creating Visual Studio Code folders..."
57 | # mkdir -p "$DESTINATION"
58 |
59 | # find * -not -name "$(basename ${0})" -type f | while read fn; do
60 | # symlink "$SOURCE/$fn" "$DESTINATION/$fn"
61 | # done
62 |
63 | # success "Finished setting up Visual Studio Code"
64 |
65 |
--------------------------------------------------------------------------------
/zsh/powerlevel9/defaulttheme.zsh:
--------------------------------------------------------------------------------
1 |
2 | zgen load bhilburn/powerlevel9k powerlevel9k
3 |
4 | POWERLEVEL9K_MODE='awesome-patched'
5 |
6 | POWERLEVEL9K_PROMPT_ON_NEWLINE=true
7 | POWERLEVEL9K_RPROMPT_ON_NEWLINE=true
8 | POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
9 |
10 | POWERLEVEL9K_SHORTEN_STRATEGY="truncate_middle"
11 | POWERLEVEL9K_VCS_STAGED_ICON="\u00b1"
12 | POWERLEVEL9K_VCS_UNTRACKED_ICON="\u25CF"
13 | POWERLEVEL9K_VCS_UNSTAGED_ICON="\u00b1"
14 | POWERLEVEL9K_VCS_INCOMING_CHANGES_ICON="\u2193"
15 | POWERLEVEL9K_VCS_OUTGOING_CHANGES_ICON="\u2191"
16 | POWERLEVEL9K_SHOW_CHANGESET="true"
17 | POWERLEVEL9K_CHANGESET_HASH_LENGTH="12"
18 | POWERLEVEL9K_DIR_HOME_SUBFOLDER_BACKGROUND="clear"
19 | POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND="blue"
20 | POWERLEVEL9K_DIR_DEFAULT_BACKGROUND="clear"
21 | POWERLEVEL9K_DIR_DEFAULT_FOREGROUND="white"
22 | POWERLEVEL9K_ROOT_INDICATOR_BACKGROUND="red"
23 | POWERLEVEL9K_ROOT_INDICATOR_FOREGROUND="white"
24 | POWERLEVEL9K_TODO_BACKGROUND="clear"
25 | POWERLEVEL9K_TODO_FOREGROUND="green"
26 | POWERLEVEL9K_OS_ICON_BACKGROUND="clear"
27 | POWERLEVEL9K_OS_ICON_FOREGROUND="white"
28 | POWERLEVEL9K_HISTORY_BACKGROUND="clear"
29 | POWERLEVEL9K_HISTORY_FOREGROUND="blue"
30 | POWERLEVEL9K_STATUS_OK_BACKGROUND="clear"
31 | POWERLEVEL9K_STATUS_OK_FOREGROUND="green"
32 | POWERLEVEL9K_STATUS_ERROR_BACKGROUND="clear"
33 | POWERLEVEL9K_STATUS_ERROR_FOREGROUND="red"
34 | POWERLEVEL9K_LOAD_CRITICAL_BACKGROUND="clear"
35 | POWERLEVEL9K_LOAD_WARNING_BACKGROUND="clear"
36 | POWERLEVEL9K_LOAD_NORMAL_BACKGROUND="clear"
37 | POWERLEVEL9K_LOAD_CRITICAL_FOREGROUND="red"
38 | POWERLEVEL9K_LOAD_WARNING_FOREGROUND="yellow"
39 | POWERLEVEL9K_LOAD_NORMAL_FOREGROUND="green"
40 | POWERLEVEL9K_LOAD_CRITICAL_VISUAL_IDENTIFIER_COLOR="red"
41 | POWERLEVEL9K_LOAD_WARNING_VISUAL_IDENTIFIER_COLOR="yellow"
42 | POWERLEVEL9K_LOAD_NORMAL_VISUAL_IDENTIFIER_COLOR="green"
43 | POWERLEVEL9K_RAM_BACKGROUND="clear"
44 | POWERLEVEL9K_RAM_FOREGROUND="green"
45 | POWERLEVEL9K_RAM_ELEMENTS="ram_free"
46 |
47 | # fc01 - gun
48 | POWERLEVEL9K_LOAD_ICON="\ue238" #"\ufd2a" # "\uf608" # "\uf8c7 " # '\ue7ba' # '\uf20e'
49 | POWERLEVEL9K_DISK_USAGE_ICON='\uf2c7' # '\uf20e'
50 | POWERLEVEL9K_RAM_ICON="\uf85a" # "\ue238" # '\ue28c' # # '\uf20e'
51 | POWERLEVEL9K_TIME_ICON="\uf64f"
52 | POWERLEVEL9K_VCS_MODIFIED_BACKGROUND="clear"
53 | POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND="clear"
54 | POWERLEVEL9K_BATTERY_BACKGROUND="clear"
55 | POWERLEVEL9K_VCS_MODIFIED_FOREGROUND="yellow"
56 | POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND="yellow"
57 | POWERLEVEL9K_DIR_HOME_BACKGROUND="clear"
58 | POWERLEVEL9K_DIR_HOME_FOREGROUND="blue"
59 | POWERLEVEL9K_DIR_WRITABLE_FORBIDDEN_BACKGROUND="clear"
60 | POWERLEVEL9K_DIR_WRITABLE_FORBIDDEN_FOREGROUND="red"
61 | POWERLEVEL9K_TIME_BACKGROUND="clear"
62 | POWERLEVEL9K_TIME_FOREGROUND="cyan"
63 | POWERLEVEL9K_COMMAND_EXECUTION_TIME_BACKGROUND='clear'
64 | POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND='magenta'
65 | POWERLEVEL9K_BACKGROUND_JOBS_BACKGROUND='clear'
66 | POWERLEVEL9K_BACKGROUND_JOBS_FOREGROUND='green'
67 |
68 | ICON_ATOM='\ufc66' # '\ue62e' # e764
69 | ICON_CONNECTED='\uf20e'
70 | ICON_GIT_FOLDER='\ue5fb'
71 | ICON_PIED_PIPER='\uf1a8'
72 | ICON_SPACE_SHUTTLE='\uf197'
73 | ICON_MJ='\ufca4'
74 | ICON_THERMO='\uf2c7'
75 |
76 | POWERLEVEL9K_PROMPT_ON_NEWLINE=true
77 | POWERLEVEL9K_RPROMPT_ON_NEWLINE=true
78 |
79 | # POWERLEVEL9K_HOME_ICON='\ufd25'
80 | POWERLEVEL9K_FOLDER_ICON='\uf114' # f07b
81 | POWERLEVEL9K_HOME_ICON='\uf643'
82 | POWERLEVEL9K_HOME_SUB_ICON=''
83 | POWERLEVEL9K_ETC_ICON=''
84 |
85 | POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR=''
86 | POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR=''
87 | POWERLEVEL9K_LEFT_SUBSEGMENT_SEPARATOR=''
88 | POWERLEVEL9K_RIGHT_SUBSEGMENT_SEPARATOR=''
89 | POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX="%F{green1}\ufca4%F{white}"
90 | POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX="%F{mediumspringgreen}\uf197%F{white} "
91 | POWERLEVEL9K_RAM_ELEMENTS=(ram_free)
92 | POWERLEVEL9K_BATTERY_ICON='\uf0e7'
93 | POWERLEVEL9K_BATTERY_BACKGROUND='clear'
94 |
95 | POWERLEVEL9K_PUBLIC_IP_ICON='\uf530'
96 | POWERLEVEL9K_PUBLIC_IP_BACKGROUND='clear'
97 | POWERLEVEL9K_NODE_VERSION_ICON='\ue718'
98 | POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(time load ram battery public_ip rspec_stats vpn_ip docker_machine nodeenv newline root_indicator dir dir_writable_joined vcs rspec_stats)
99 | POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=()
100 |
101 | POWERLEVEL9K_VCS_GIT_HOOKS=(vcs-detect-changes git-untracked git-aheadbehind git-remotebranch git-tagname)
102 |
--------------------------------------------------------------------------------
/zsh/zgen_setup.zsh:
--------------------------------------------------------------------------------
1 | if [[ -z "$ZGEN_PARENT_DIR" ]]; then
2 | ZGEN_PARENT_DIR=$HOME
3 | fi
4 | if [[ ! -f $ZGEN_PARENT_DIR/.zgen/zgen.zsh ]]; then
5 | if [[ ! -d "$ZGEN_PARENT_DIR" ]]; then
6 | mkdir -p "$ZGEN_PARENT_DIR"
7 | fi
8 | pushd $ZGEN_PARENT_DIR
9 | git clone https://github.com/tarjoilija/zgen ~/.zgen
10 | popd
11 | fi
12 |
13 | source $ZGEN_PARENT_DIR/.zgen/zgen.zsh
14 | unset ZGEN_PARENT_DIR
15 |
16 | load-starter-plugin-list() {
17 | echo "Creating a zgen save"
18 | ZGEN_LOADED=()
19 | ZGEN_COMPLETIONS=()
20 |
21 | zgen oh-my-zsh
22 |
23 | zmodload zsh/terminfo
24 | bindkey "$terminfo[kcuu1]" history-substring-search-up
25 | bindkey "$terminfo[kcud1]" history-substring-search-down
26 |
27 | # zgen oh-my-zsh plugins/colorize
28 | # zgen oh-my-zsh plugins/command-not-found
29 | # zzgen oh-my-zsh plugins/git
30 | # zzgen oh-my-zsh plugins/github
31 | # zgen oh-my-zsh plugins/pip
32 | # zgen oh-my-zsh plugins/node
33 | # zgen oh-my-zsh plugins/sudo
34 | # zgen oh-my-zsh plugins/jump
35 | # zgen oh-my-zsh plugins/yarn
36 | # zgen oh-my-zsh plugins/lein
37 | # zgen oh-my-zsh plugins/common-aliases
38 | # zgen oh-my-zsh plugins/colored-man-pages
39 | # zgen oh-my-zsh plugins/autojump
40 | # zzgen oh-my-zsh plugins/docker
41 | # zzgen oh-my-zsh plugins/docker-compose
42 | # zzgen oh-my-zsh plugins/gitfast
43 | # zzgen oh-my-zsh plugins/git-extras
44 | # zgen oh-my-zsh plugins/git-flow
45 | zgen oh-my-zsh plugins/history
46 | # zgen load peterhurford/git-it-on.zsh
47 | # zgen oh-my-zsh plugins/lol
48 | # zgen oh-my-zsh plugins/tmux
49 | # zgen oh-my-zsh plugins/vscode
50 | # zgen oh-my-zsh plugins/z
51 | # zgen oh-my-zsh plugins/chucknorris
52 | # zgen oh-my-zsh plugins/Composer
53 | # zgen oh-my-zsh plugins/copyfile
54 | # zgen oh-my-zsh plugins/encode64
55 | # zgen oh-my-zsh plugins/compleat
56 | # zgen oh-my-zsh plugins/dircycle
57 | # zgen oh-my-zsh plugins/dirhistory
58 | zgen oh-my-zsh plugins/npm
59 | # zgen oh-my-zsh plugins/aws
60 | # zgen oh-my-zsh plugins/python
61 | # zgen oh-my-zsh plugins/screen
62 | # zgen oh-my-zsh plugins/vagrant
63 | # zgen oh-my-zsh plugins/rsync
64 | zgen load zsh-users/zsh-completions
65 | # zgen load RobSis/zsh-completion-generator
66 | zgen load zsh-users/zsh-syntax-highlighting
67 | zgen load zsh-users/zsh-history-substring-search
68 | zgen load zsh-users/zsh-autosuggestions
69 | zgen load chrissicool/zsh-256color
70 | # zgen load unixorn/rake-completion.zshplugin
71 | zgen load unixorn/autoupdate-zgen
72 | # zgen load unixorn/jpb.zshplugin
73 | # zgen load unixorn/tumult.plugin.zsh
74 | zgen load djui/alias-tips
75 | # zgen load unixorn/git-extra-commands
76 | # zgen load unixorn/bitbucket-git-helpers.plugin.zsh
77 | # zgen load skx/sysadmin-util
78 | # zgen load StackExchange/blackbox
79 | # zgen load supercrabtree/k
80 | # zgen load b4b4r07/enhancd
81 | # zgen load fcambus/ansiweather
82 | zgen load iam4x/zsh-iterm-touchbar
83 | zgen load lukechilds/zsh-better-npm-completion
84 | zgen load g-plane/zsh-yarn-autocompletions
85 | zgen load unixorn/tumult.plugin.zsh
86 | # zgen load srijanshetty/docker-zsh
87 | zgen load zdharma/fast-syntax-highlighting
88 | zgen load oldratlee/hacker-quotes
89 | zgen load tysonwolker/iterm-tab-colors
90 | zgen load b4b4r07/emoji-cli
91 | zgen load Tarrasch/zsh-autoenv
92 |
93 | # zgen load denysdovhan/spaceship-prompt spaceship
94 | # zgen oh-my-zsh plugins/chucknorris
95 | if [ $(uname -a | grep -ci Darwin) = 1 ]; then
96 | zgen oh-my-zsh plugins/brew
97 | # zgen oh-my-zsh plugins/brew-cask
98 | zgen oh-my-zsh plugins/osx
99 | zgen load mkwmms/zsh-osx
100 | fi
101 |
102 | GENCOMPL_FPATH=$HOME/.zsh/complete
103 |
104 | zgen save
105 | }
106 |
107 | setup-zgen-repos() {
108 | if [[ -f ~/.zgen-local-plugins ]]; then
109 | source ~/.zgen-local-plugins
110 | else
111 | load-starter-plugin-list
112 | fi
113 | }
114 |
115 | # https://stackoverflow.com/questions/17878684/best-way-to-get-file-modified-time-in-seconds
116 | if [[ $(uname | grep -ci -e Darwin -e BSD) = 1 ]]; then
117 | get_file_modification_time() {
118 | modified_time=$(stat -f %m "$1" 2> /dev/null) || modified_time=0
119 | echo "${modified_time}"
120 | }
121 |
122 | elif [[ $(uname | grep -ci Linux) = 1 ]]; then
123 | get_file_modification_time() {
124 | modified_time=$(stat -c %Y "$1" 2> /dev/null) || modified_time=0
125 | echo "${modified_time}"
126 | }
127 | fi
128 |
129 | if ! zgen saved; then
130 | setup-zgen-repos
131 | fi
132 |
133 | if [[ -f ~/.zgen_setup ]]; then
134 | REAL_ZGEN_SETUP=~/.zgen_setup
135 | fi
136 |
137 | if [[ -L ~/.zgen_setup ]]; then
138 | REAL_ZGEN_SETUP="$(readlink ~/.zgen_setup)"
139 | fi
140 |
141 | if [[ -f ~/.zgen-local-plugins ]]; then
142 | REAL_ZGEN_SETUP=~/.zgen-local-plugins
143 | fi
144 | if [[ -L ~/.zgen-local-plugins ]]; then
145 | REAL_ZGEN_SETUP="${HOME}/$(readlink ~/.zgen-local-plugins)"
146 | fi
147 |
148 | # If .zgen_setup is newer than init.zsh, regenerate init.zsh
149 | if [ $(get_file_modification_time ${REAL_ZGEN_SETUP}) -gt $(get_file_modification_time ~/.zgen/init.zsh) ]; then
150 | echo "$(basename ${REAL_ZGEN_SETUP}) updated; creating a new init.zsh"
151 | setup-zgen-repos
152 | fi
153 | unset REAL_ZGEN_SETUP
154 |
--------------------------------------------------------------------------------
/zsh/zsh_aliases.zsh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | #
3 | # Only including a shebang to trigger Sublime Text to use shell syntax highlighting
4 | #
5 | # Copyright 2006-2018 Joseph Block
6 | #
7 | # BSD licensed, see LICENSE.txt in this repository.
8 |
9 | if [[ -d ~/gocode ]]; then
10 | export GOPATH=~/gocode
11 | fi
12 |
13 | # Sublime
14 | if [[ -x /usr/local/bin/subl ]]; then
15 | alias s="subl"
16 | fi
17 |
18 | # yes, these tests are ugly. They do however, work.
19 | if [[ "$(uname -s)" == "Darwin" ]]; then
20 | # do OS X specific things
21 |
22 | alias top="TERM=vt100 top"
23 | else
24 | alias cputop="top -o cpu"
25 | alias l-d="ls -lad"
26 | alias l="ls -la"
27 | alias ll="ls -la | less"
28 | fi
29 |
30 | if [[ "$(uname -s)" == "Linux" ]]; then
31 | # we're on linux
32 | alias l-d="ls -lFad"
33 | alias l="ls -laF"
34 | alias ll="ls -lFa | TERM=vt100 less"
35 | fi
36 |
37 | export CVS_RSH=ssh
38 |
39 | alias historysummary="history | awk '{a[\$2]++} END{for(i in a){printf \"%5d\t%s\n\",a[i],i}}' | sort -rn | head"
40 |
41 | if [ -x /bin/vim ]; then
42 | alias vi="/bin/vim"
43 | alias vim="/bin/vim"
44 | export EDITOR="/bin/vim"
45 | fi
46 |
47 | if [ -x /usr/bin/vim ]; then
48 | alias vi="/usr/bin/vim"
49 | alias vim="/usr/bin/vim"
50 | export EDITOR="/usr/bin/vim"
51 | fi
52 |
53 | # MacPorts has a newer vim than Apple ships
54 | if [ -x /opt/local/bin/vim ]; then
55 | alias vim="/opt/local/bin/vim"
56 | alias vi="/opt/local/bin/vim"
57 | export EDITOR="/opt/local/bin/vim"
58 | fi
59 |
60 | # So does brew
61 | if [ -x /usr/local/bin/vim ]; then
62 | alias vim="/usr/local/bin/vim"
63 | alias vi="/usr/local/bin/vim"
64 | export EDITOR="/usr/local/bin/vim"
65 | fi
66 | # Clearly, I really like vim.
67 |
68 | export VISUAL=${EDITOR}
69 |
70 | # Clean up files that have the wrong line endings
71 | alias mac2unix="tr '\015' '\012'"
72 | alias unix2mac="tr '\012' '\015'"
73 |
74 | # A couple of different external IP lookups depending on which is down.
75 | alias external_ip="curl -s icanhazip.com"
76 | alias myip="dig +short myip.opendns.com @resolver1.opendns.com"
77 |
78 | # Show laptop's IP addresses
79 | alias ips="ifconfig -a | perl -nle'/(\d+\.\d+\.\d+\.\d+)/ && print $1'"
80 |
81 | alias reattach="screen -r"
82 |
83 | # SSH stuff
84 | # Pass our credentials by default
85 | alias ssh='ssh -A'
86 | alias sshA='ssh -A'
87 | alias ssh-A='ssh -A'
88 | alias ssh_unkeyed='/usr/bin/ssh'
89 |
90 | alias scp_no_hostchecks='scp -o UserKnownHostsFile=/dev/null -o GlobalKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
91 | alias ssh_no_hostchecks='ssh -A -o UserKnownHostsFile=/dev/null -o GlobalKnownHostsFile=/dev/null -o StrictHostKeyChecking=no'
92 |
93 | # Set up even more shortcuts because I am that lazy a typist.
94 | alias nh_scp=scp_no_hostchecks
95 | alias nh_ssh=ssh_no_hostchecks
96 | alias nhscp=scp_no_hostchecks
97 | alias nhssh=ssh_no_hostchecks
98 |
99 | # Strip color codes from commands that insist on spewing them so we can
100 | # pipe them into files cleanly.
101 | alias stripcolors='sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g"'
102 |
103 | # On the rare occasions I don't want to continue an interrupted download
104 | # I can always delete the incomplete fragment explicitly. I usually just
105 | # want to complete it.
106 | alias wget="wget -c"
107 |
108 | # Dump the last 20 history entries to make !number more convenient to use.
109 | alias zh="fc -l -d -D"
110 |
111 | # My typical tyops.
112 | alias gerp="grep"
113 | alias grep-i="grep -i"
114 | alias grep='GREP_COLOR="1;37;41" LANG=C grep --color=auto'
115 | alias grepi="grep -i"
116 | alias knfie="knife"
117 | alias maek="make"
118 | alias psax="ps ax"
119 | alias pswax="ps wax"
120 | alias psxa="ps ax"
121 | alias raek="rake"
122 | alias tartvf="tar tvf"
123 | alias tartvzf="tar tvzf"
124 | alias tarxvf="tar xvf"
125 |
126 | # Deal with various stupidities.
127 |
128 | # Thanks so much for breaking ldapsearch, fink
129 | if [ -x /sw/bin/ldapsearch ];then
130 | # At least the stale version Apple ships actually works.
131 | alias ldapsearch=/usr/bin/ldapsearch
132 | fi
133 |
134 | if [ -x /usr/bin/vagrant ]; then
135 | alias vagrant="/usr/bin/vagrant"
136 | fi
137 |
138 | # Use brew versions if present
139 | if [ -x /usr/local/bin/mysql/bin/mysql ]; then
140 | alias mysql="/usr/local/mysql/bin/mysql"
141 | fi
142 |
143 | if [ -x /usr/local/bin/mysql/bin/mysqladmin ]; then
144 | alias mysqladmin="/usr/local/mysql/bin/mysqladmin"
145 | fi
146 |
147 | # Help the lazy typists again.
148 | alias ..="cd .."
149 | alias ...="cd ../.."
150 |
151 | # Honor old .zsh_aliases.local customizations, but print depecation warning.
152 | if [ -f ~/.zsh_aliases.local ]; then
153 | source ~/.zsh_aliases.local
154 | echo ".zsh_aliases.local is deprecated. Make entries in files in ~/.zshrc.d instead."
155 | fi
156 |
157 | alias weather="curl -4 http://wttr.in/Moscow"
158 | alias ls="exa"
159 | alias lc='colorls -lA --sd'
160 | alias l='colorls'
161 |
162 | alias mr='cd ~/Desktop/dao/dc-monorepo'
163 | alias plt='cd ~/Desktop/dao/dc-monorepo/sites/platform'
164 | alias dt='cd ~/Desktop'
165 |
166 | alias cmr='code-insiders ~/Desktop/dao/dc-monorepo'
--------------------------------------------------------------------------------
/zsh/zsh_functions.zsh:
--------------------------------------------------------------------------------
1 | #!/bin/zsh
2 | #
3 | # Only including a shebang to trigger Sublime Text to use shell syntax highlighting
4 | #
5 | # Copyright 2006-2016 Joseph Block
6 | #
7 | # BSD licensed, see LICENSE.txt
8 |
9 | function exists() {
10 | if (( $+commands[$1] )); then return 0; else return 1; fi
11 | }
12 |
13 | # from cads@ooyala.com
14 | function ff() {
15 | find . -type f -iname '*'$@'*' -ls
16 | }
17 |
18 | # Find things in that enormous command history file
19 | function hgrep40 {
20 | history | egrep --color -i "$@" | tail -40
21 | }
22 |
23 | function hgrep {
24 | history | grep -i "$@" | tail -20
25 | }
26 |
27 | function hgrep_full {
28 | history | egrep --color -i "$@"
29 | }
30 |
31 | function envgrep() {
32 | printenv | grep -i "$@"
33 | }
34 |
35 | # From Dan Ryan's blog - http://danryan.co/using-antigen-for-zsh.html
36 | man() {
37 | env \
38 | LESS_TERMCAP_mb=$(printf "\e[1;31m") \
39 | LESS_TERMCAP_md=$(printf "\e[1;31m") \
40 | LESS_TERMCAP_me=$(printf "\e[0m") \
41 | LESS_TERMCAP_se=$(printf "\e[0m") \
42 | LESS_TERMCAP_so=$(printf "\e[1;44;33m") \
43 | LESS_TERMCAP_ue=$(printf "\e[0m") \
44 | LESS_TERMCAP_us=$(printf "\e[1;32m") \
45 | man "$@"
46 | }
47 |
48 | # From commandlinefu.com
49 | function watch() { t=$1; shift; while test :; do clear; date=$(date); echo -e "Every $ts: $@ \t\t\t\t $date"; $@; sleep $t; done }
50 |
51 | # scp file to machine you're sshing into this machine from
52 | function mecp () {
53 | scp "$@" ${SSH_CLIENT%% *}:~/Downloads/;
54 | }
55 |
56 | function calc() {
57 | awk "BEGIN{ print $* }" ;
58 | }
59 |
60 | function procs_for_path() {
61 | for pid in $(lsof "$@" | cut -d' ' -f 3 | sort | uniq)
62 | do
63 | ps -f -p $pid
64 | done
65 | }
66 |
67 | # Begin sysadvent2011 functions
68 | function _awk_col() {
69 | echo "$1" | egrep -v '^[0-9]+$' || echo "\$$1"
70 | }
71 |
72 | function sum() {
73 | [ "${1#-F}" != "$1" ] && SP=${1} && shift
74 | [ "$#" -eq 0 ] && set -- 0
75 | key="$(_awk_col "$1")"
76 | awk $SP "{ x+=$key } END { printf(\"%d\n\", x) }"
77 | }
78 |
79 | function sumby() {
80 | [ "${1#-F}" != "$1" ] && SP=${1} && shift
81 | [ "$#" -lt 0 ] && set -- 0 1
82 | key="$(_awk_col "$1")"
83 | val="$(_awk_col "$2")"
84 | awk $SP "{ a[$key] += $val } END { for (i in a) { printf(\"%d %s\\n\", a[i], i) } }"
85 | }
86 |
87 | function countby() {
88 | [ "${1#-F}" != "$1" ] && SP=${1} && shift
89 | [ "$#" -eq 0 ] && set -- 0
90 | key="$(_awk_col "$1")"
91 | awk $SP "{ a[$key]++ } END { for (i in a) { printf(\"%d %s\\n\", a[i], i) } }"
92 | }
93 | # end sysadvent
94 |
95 | # ssh helper
96 | function rmhost () {
97 | perl -i -ne "print unless $1 .. $1" ~/.ssh/known_hosts;
98 | }
99 |
100 | get_nr_jobs() {
101 | jobs | wc -l
102 | }
103 |
104 | get_load() {
105 | uptime | awk '{print $11}' | tr ',' ' '
106 | }
107 |
108 | function bash_repeat() {
109 | n=$1
110 | shift
111 | while [ $(( n -= 1 )) -ge 0 ]
112 | do
113 | "$@"
114 | done
115 | }
116 |
117 | function authme {
118 | ssh "$1" 'mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys' < ~/.ssh/id_dsa.pub
119 | }
120 |
121 | function mtr_url {
122 | host=$(ruby -ruri -e "puts (URI.parse('$1').host or '$1')")
123 | sudo mtr -t $host
124 | }
125 |
126 | function jsoncurl() {
127 | curl "$@" | python -m json.tool
128 | }
129 |
130 | # Recursively touch, e.g. touch + mkdir -p
131 | # so files can easily be created at depth
132 | #
133 | canhaz() {
134 | mkdir -p -- "${1%/*}" && touch -- "$1"
135 | }
136 |
137 | canhaz-script() {
138 | canhaz "${1}" && chmod +x "$1"
139 | }
140 |
141 | pong() {
142 | ping -c 10 "$@"
143 | }
144 |
145 | fix_tmux_ssh_agent() {
146 | for key in SSH_AUTH_SOCK SSH_CONNECTION SSH_CLIENT; do
147 | if (tmux show-environment | grep "^${key}" > /dev/null); then
148 | value=$(tmux show-environment | grep "^${key}" | sed -e "s/^[A-Z_]*=//")
149 | export ${key}="${value}"
150 | fi
151 | done
152 | }
153 |
154 | show_terminal_colors() {
155 | for i in {0..255} ; do
156 | printf "\x1b[38;5;${i}mcolour${i}\n"
157 | done
158 | }
159 |
160 | # Batch change extension from $1 to $2
161 | function chgext {
162 | for file in *.$1
163 | do
164 | mv $file $(echo $file | sed "s/\(.*\.\)$1/\1$2/")
165 | done
166 | }
167 |
168 | # Probe a /24 for hosts
169 | scan24() {
170 | nmap -sP ${1}/24
171 | }
172 |
173 | # Netjoin - Block until a network connection is obtained.
174 | # Originally from https://github.com/bamos/dotfiles/blob/master/.funcs
175 | nj() {
176 | while true; do
177 | ping -c 1 8.8.8.8 &> /dev/null && break
178 | sleep 1
179 | done
180 | }
181 |
182 | # Pretty JSON
183 | # from: https://coderwall.com/p/hwu5uq?i=9&p=1&q=sort%3Ascore+desc&t%5B%5D=zsh
184 | function pjson {
185 | if [ $# -gt 0 ];
186 | then
187 | for arg in $@
188 | do
189 | if [ -f $arg ];
190 | then
191 | less $arg | python -m json.tool
192 | else
193 | echo "$arg" | python -m json.tool
194 | fi
195 | done
196 | fi
197 | }
198 |
199 | # lists zombie processes
200 | function zombie() {
201 | ps aux | awk '{if ($8=="Z") { print $2 }}'
202 | }
203 |
204 | # get the content type of an http resource
205 | # from https://github.com/jleclanche/dotfiles/blob/master/.zshrc
206 | function htmime {
207 | if [[ -z $1 ]]; then
208 | print "USAGE: htmime "
209 | return 1
210 | fi
211 | mime=$(curl -sIX HEAD $1 | sed -nr "s/Content-Type: (.+)/\1/p")
212 | print $mime
213 | }
214 |
215 | # Start an HTTP server from a directory, optionally specifying the port
216 | function httpserver() {
217 | local port="${1:-8000}";
218 | sleep 1 && open "http://localhost:${port}/" &
219 | # Set the default Content-Type to `text/plain` instead of `application/octet-stream`
220 | # And serve everything as UTF-8 (although not technically correct, this doesn’t break anything for binary files)
221 | python -c $'import SimpleHTTPServer;\nmap = SimpleHTTPServer.SimpleHTTPRequestHandler.extensions_map;\nmap[""] = "text/plain";\nfor key, value in map.items():\n\tmap[key] = value + ";charset=UTF-8";\nSimpleHTTPServer.test();' "$port";
222 | }
223 |
224 | # Honor old .zsh_functions.local customizations, but print depecation warning.
225 | if [ -f ~/.zsh_functions.local ]; then
226 | source .zsh_functions.local
227 | echo ".zsh_functions.local is deprecated. Make entries in ~/.zshrc.d instead."
228 | fi
229 |
--------------------------------------------------------------------------------
/zsh/zshrc.zsh:
--------------------------------------------------------------------------------
1 | export LANG=en_US.UTF-8
2 | export LC_ALL=en_US.UTF-8
3 | TERM="xterm-256color"
4 |
5 | source "${HOME}/.zgen/zgen.zsh"
6 |
7 | if [[ -r ~/.powerlevel9k_font_mode ]]; then
8 | POWERLEVEL9K_MODE=$(head -1 ~/.powerlevel9k_font_mode)
9 | fi
10 |
11 | # Uncomment following line if you want red dots to be displayed while waiting for completion
12 | export COMPLETION_WAITING_DOTS="true"
13 |
14 | # Correct spelling for commands
15 | setopt correct
16 |
17 | # turn off the infernal correctall for filenames
18 | unsetopt correctall
19 |
20 | # Base PATH
21 | PATH=/usr/local/bin:/usr/local/sbin:/sbin:/usr/sbin:/bin:/usr/bin
22 |
23 | # Conditional PATH additions
24 | for path_candidate in /opt/local/sbin \
25 | /Applications/Xcode.app/Contents/Developer/usr/bin \
26 | /opt/local/bin \
27 | /usr/local/share/npm/bin \
28 | ~/.cabal/bin \
29 | ~/.cargo/bin \
30 | ~/.rbenv/bin \
31 | ~/bin \
32 | ~/src/gocode/bin
33 | do
34 | if [ -d ${path_candidate} ]; then
35 | export PATH=${PATH}:${path_candidate}
36 | fi
37 | done
38 |
39 | # Yes, these are a pain to customize. Fortunately, Geoff Greer made an online
40 | # tool that makes it easy to customize your color scheme and keep them in sync
41 | # across Linux and OS X/*BSD at http://geoff.greer.fm/lscolors/
42 |
43 | # export LSCOLORS='Exfxcxdxbxegedabagacad'
44 | # export LS_COLORS='di=1;34;40:ln=35;40:so=32;40:pi=33;40:ex=31;40:bd=34;46:cd=34;43:su=0;41:sg=0;46:tw=0;42:ow=0;43:'
45 |
46 | # Fun with SSH
47 | # if [ $(ssh-add -l | grep -c "The agent has no identities." ) -eq 1 ]; then
48 | # if [[ "$(uname -s)" == "Darwin" ]]; then
49 | # # We're on OS X. Try to load ssh keys using pass phrases stored in
50 | # # the OSX keychain.
51 | # #
52 | # # You can use ssh-add -K /path/to/key to store pass phrases into
53 | # # the OSX keychain
54 | # ssh-add -k
55 | # fi
56 | # fi
57 |
58 | # for key in $(find ~/.ssh -type f -a \( -name id_rsa -o -name id_dsa -name id_ecdsa \))
59 | # do
60 | # if [ -f ${key} -a $(ssh-add -l | grep -c "${key//$HOME\//}" ) -eq 0 ]; then
61 | # ssh-add ${key}
62 | # fi
63 | # done
64 |
65 | # Now that we have $PATH set up and ssh keys loaded, configure zgen.
66 |
67 | # start zgen
68 | if [ -f ~/.zgen_setup ]; then
69 | source ~/.zgen_setup
70 | fi
71 | # end zgen
72 |
73 | # set some history options
74 | setopt append_history
75 | setopt extended_history
76 | setopt hist_expire_dups_first
77 | setopt hist_ignore_all_dups
78 | setopt hist_ignore_dups
79 | setopt hist_ignore_space
80 | setopt hist_reduce_blanks
81 | setopt hist_save_no_dups
82 | setopt hist_verify
83 |
84 | # Share your history across all your terminal windows
85 | setopt share_history
86 | #setopt noclobber
87 |
88 | # set some more options
89 | setopt pushd_ignore_dups
90 | #setopt pushd_silent
91 |
92 | # Keep a ton of history.
93 | HISTSIZE=1000
94 | SAVEHIST=1000
95 | HISTFILE=~/.zsh_history
96 | export HISTIGNORE="ls:cd:cd -:pwd:exit:date:* --help"
97 |
98 | # Long running processes should return time after they complete. Specified
99 | # in seconds.
100 | REPORTTIME=2
101 | TIMEFMT="%U user %S system %P cpu %*Es total"
102 |
103 | # Expand aliases inline - see http://blog.patshead.com/2012/11/automatically-expaning-zsh-global-aliases---simplified.html
104 | # globalias() {
105 | # if [[ $LBUFFER =~ ' [A-Z0-9]+$' ]]; then
106 | # zle _expand_alias
107 | # zle expand-word
108 | # fi
109 | # zle self-insert
110 | # }
111 |
112 | # zle -N globalias
113 |
114 | # bindkey " " globalias
115 | # bindkey "^ " magic-space # control-space to bypass completion
116 | # bindkey -M isearch " " magic-space # normal space during searches
117 |
118 | # Customize to your needs...
119 | # Stuff that works on bash or zsh
120 | if [ -r ~/.sh_aliases ]; then
121 | source ~/.sh_aliases
122 | fi
123 |
124 | # Stuff only tested on zsh, or explicitly zsh-specific
125 | if [ -r ~/.zsh_aliases ]; then
126 | source ~/.zsh_aliases
127 | fi
128 |
129 | if [ -r ~/.zsh_functions ]; then
130 | source ~/.zsh_functions
131 | fi
132 |
133 | export LOCATE_PATH=/var/db/locate.database
134 |
135 | # Load AWS credentials
136 | # if [ -f ~/.aws/aws_variables ]; then
137 | # source ~/.aws/aws_variables
138 | # fi
139 |
140 | # JAVA setup - needed for iam-* tools
141 | # if [ -d /Library/Java/Home ];then
142 | # export JAVA_HOME=/Library/Java/Home
143 | # fi
144 |
145 | if [[ "$(uname -s)" == "Darwin" ]]; then
146 | # We're on osx
147 | [ -f ~/.osx_aliases ] && source ~/.osx_aliases
148 | if [ -d ~/.osx_aliases.d ]; then
149 | for alias_file in ~/.osx_aliases.d/*
150 | do
151 | source $alias_file
152 | done
153 | fi
154 | fi
155 |
156 | # deal with screen, if we're using it - courtesy MacOSXHints.com
157 | # Login greeting ------------------
158 | # if [ "$TERM" = "screen" -a ! "$SHOWED_SCREEN_MESSAGE" = "true" ]; then
159 | # detached_screens=$(screen -list | grep Detached)
160 | # if [ ! -z "$detached_screens" ]; then
161 | # echo "+---------------------------------------+"
162 | # echo "| Detached screens are available: |"
163 | # echo "$detached_screens"
164 | # echo "+---------------------------------------+"
165 | # fi
166 | # fi
167 |
168 | # if [ -f /usr/local/etc/grc.bashrc ]; then
169 | # source "$(brew --prefix)/etc/grc.bashrc"
170 |
171 | # function ping5(){
172 | # grc --color=auto ping -c 5 "$@"
173 | # }
174 | # else
175 | # alias ping5='ping -c 5'
176 | # fi
177 |
178 | # Speed up autocomplete, force prefix mapping
179 | zstyle ':completion:*' accept-exact '*(N)'
180 | zstyle ':completion:*' use-cache on
181 | zstyle ':completion:*' cache-path ~/.zsh/cache
182 | zstyle -e ':completion:*:default' list-colors 'reply=("${PREFIX:+=(#bi)($PREFIX:t)*==34=34}:${(s.:.)LS_COLORS}")';
183 |
184 | # Load any custom zsh completions we've installed
185 | if [ -d ~/.zsh-completions ]; then
186 | for completion in ~/.zsh-completions/*
187 | do
188 | source "$completion"
189 | done
190 | fi
191 |
192 | # echo
193 | # echo "Current SSH Keys:"
194 | # ssh-add -l
195 | # echo
196 |
197 | # Honor old .zshrc.local customizations, but print deprecation warning.
198 | if [ -f ~/.zshrc.local ]; then
199 | source ~/.zshrc.local
200 | echo '~/.zshrc.local is deprecated - use files in ~/.zshrc.d instead. Future versions of zsh-quickstart-kits will no longer load it'
201 | fi
202 |
203 | # Make it easy to append your own customizations that override the above by
204 | # loading all files from the ~/.zshrc.d directory
205 | mkdir -p ~/.zshrc.d
206 | if [ -n "$(/bin/ls ~/.zshrc.d)" ]; then
207 | for dotfile in ~/.zshrc.d/*
208 | do
209 | if [ -r "${dotfile}" ]; then
210 | source "${dotfile}"
211 | fi
212 | done
213 | fi
214 |
215 | # In case a plugin adds a redundant path entry, remove duplicate entries
216 | # from PATH
217 | #
218 | # This snippet is from Mislav Marohnić 's
219 | # dotfiles repo at https://github.com/mislav/dotfiles
220 | # dedupe_path() {
221 | # typeset -a paths result
222 | # paths=($path)
223 |
224 | # while [[ ${#paths} -gt 0 ]]; do
225 | # p="${paths[1]}"
226 | # shift paths
227 | # [[ -z ${paths[(r)$p]} ]] && result+="$p"
228 | # done
229 |
230 | # export PATH=${(j+:+)result}
231 | # }
232 |
233 | # dedupe_path
234 |
235 | # If desk is installed, load the Hook for desk activation
236 | [[ -n "$DESK_ENV" ]] && source "$DESK_ENV"
237 |
238 | test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"
239 |
240 | source "${HOME}/.dotfiles/zsh/powerlevel9/defaulttheme.zsh"
241 |
242 | [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
243 |
244 | # zsh-iterm-touchbar config
245 | # https://github.com/iam4x/zsh-iterm-touchbar
246 |
247 | TOUCHBAR_GIT_ENABLED=true
248 |
249 | # ENV variables for git icons:
250 |
251 | GIT_UNCOMMITTED="+"
252 | GIT_UNSTAGED="!"
253 | GIT_UNTRACKED="?"
254 | GIT_STASHED="$"
255 | GIT_UNPULLED="⇣"
256 | GIT_UNPUSHED="⇡"
257 |
258 | # ENV variables to enable or disable yarn:
259 |
260 | YARN_ENABLED=true
261 | # eval $(dircolors -b $HOME/.dircolors)
262 | bash ~/.dotfiles/zsh/powerlevel9/defaulttheme.zsh
263 |
264 | export NVM_DIR="$HOME/.nvm"
265 | [ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm
266 | [ -s "/usr/local/opt/nvm/etc/bash_completion" ] && . "/usr/local/opt/nvm/etc/bash_completion" # This loads nvm bash_completion
267 |
--------------------------------------------------------------------------------