Skip to content

Commit b5edd47

Browse files
committed
Merge branch 'master' of github.com:DelvarWorld/configs
2 parents 0ebbc44 + 216788d commit b5edd47

4 files changed

Lines changed: 112 additions & 28 deletions

File tree

.bashrc

Lines changed: 51 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/bin/bash
2+
13
# Colors for prompt
24
COLOR_RED=$(tput sgr0 && tput setaf 1)
35
COLOR_GREEN=$(tput sgr0 && tput setaf 2)
@@ -11,6 +13,9 @@ COLOR_LIGHT_RED=$(tput sgr0 && tput bold && tput setaf 1)
1113
COLOR_LIGHT_CYAN=$(tput sgr0 && tput bold && tput setaf 6)
1214
COLOR_RESET=$(tput sgr0)
1315

16+
# shellcheck disable=SC1091
17+
source ~/.iterm2_shell_integration.bash
18+
1419
pathadd() {
1520
newelement=${1%/}
1621
if [ -d "$1" ] && ! echo "$PATH" | grep -E -q "(^|:)$newelement($|:)" ; then
@@ -60,22 +65,22 @@ function gsync() {
6065
gitBranch=$(git rev-parse --abbrev-ref HEAD)
6166
if [[ -z "$1" ]]; then
6267
echo -n "${COLOR_YELLOW}Sync ${COLOR_BLUE}${gitBranch}${COLOR_YELLOW}? (Enter/y to confirm, n to cancel)${COLOR_RESET} "
63-
read confirm
68+
read -r confirm
6469
fi
6570

66-
hasOrigin=`cat .git/config | grep origin`
67-
hasUpstream=`cat .git/config | grep upstream`
71+
hasOrigin=$(grep origin < .git/config)
72+
hasUpstream=$(grep upstream < .git/config)
6873

6974
if [[ -z "$hasOrigin" || -z "$hasUpstream" ]]; then
7075
echo "${COLOR_RED}Error: ${COLOR_PINK}The command syncdev expects an ${COLOR_RED}origin${COLOR_PINK} and ${COLOR_RED}upstream${COLOR_PINK} remote${COLOR_RESET}"
7176
return 1
7277
fi
7378

7479
if [[ "$confirm" == "" || "$confirm" == "y" ]]; then
75-
git checkout ${gitBranch}
80+
git checkout "$gitBranch"
7681
git fetch --all
77-
git reset --hard upstream/${gitBranch}
78-
git push origin ${gitBranch}
82+
git reset --hard "upstream/$gitBranch"
83+
git push origin "$gitBranch"
7984
echo "${COLOR_YELLOW}Complete!${COLOR_RESET}"
8085
fi
8186

@@ -300,7 +305,7 @@ function audiosize() {
300305

301306
mroot="/Users/andrewray/Music/Extended Mixes"
302307
# Find all system config files that aren't vim swap files and loop through them
303-
for file in `ls "$mroot"`
308+
for file in $mroot
304309
do
305310
# Show them in a list with a counter
306311
xx=`expr $xx + 1`
@@ -564,6 +569,9 @@ git_purge() {
564569
git_purge_remote_branches $branch
565570
}
566571

572+
# Replacement for st?
573+
alias gs="git status --untracked-files=no"
574+
567575
#######################################
568576
# distributed version control section #
569577
#######################################
@@ -905,6 +913,19 @@ function ding() {
905913
afplay /System/Library/Sounds/Glass.aiff
906914
}
907915

916+
# Python development, requires pyenv from homebrew
917+
# Needs to go before GR stuff to
918+
if [[ $(command -v pyenv) ]]; then
919+
export PYENV_ROOT="$HOME/.pyenv"
920+
921+
eval "$(pyenv init -)"
922+
923+
# Requires homebrew pyenv-virtualenv
924+
if [[ -f "${PYENV_ROOT}/shims/virtualenv" ]]; then
925+
eval "$(pyenv virtualenv-init -)"
926+
fi
927+
fi
928+
908929
# Grand rounds stuff
909930
export GR_HOME=${HOME}/dev
910931
export GR_USERNAME=andrew.ray
@@ -987,18 +1008,6 @@ if [[ -d "${HOME}/c" ]]; then
9871008
source ~/c/c_recent_branches_completer
9881009
fi
9891010

990-
# Python development, requires pyenv from homebrew
991-
if [[ $(command -v pyenv) ]]; then
992-
export PYENV_ROOT="$HOME/.pyenv"
993-
994-
eval "$(pyenv init -)"
995-
996-
# Requires homebrew pyenv-virtualenv
997-
if [[ -f "${PYENV_ROOT}/shims/virtualenv" ]]; then
998-
eval "$(pyenv virtualenv-init -)"
999-
fi
1000-
fi
1001-
10021011
# legacy line? testing removing for new laptop setup and not linux
10031012
# export IPSEC_SECRETS_FILE=/etc/ipsec.secrets
10041013
export KEY_SUFFIX=grandrounds.com
@@ -1031,7 +1040,8 @@ function releaseCommits() {
10311040
}
10321041

10331042
function jgrep() {
1034-
#{ rake routes > ~/dev/rake-routes & } 2>/dev/null
1043+
# Run this to regenerate
1044+
# bundle exec rake routes > ~/dev/rake-routes
10351045
cat ~/dev/rake-routes | grep "$1"
10361046
}
10371047

@@ -1138,6 +1148,22 @@ if [ -d "$TRACKER_FLOW_PATH" ]; then
11381148
. "$TRACKER_FLOW_PATH/tracker_completion.bash"
11391149
fi
11401150

1151+
# Kill stanky Rails Console
1152+
function kc() {
1153+
ps aux | grep -E 'bin/rails c|rails_console' | grep -v 'grep' | awk '{print $2}' | xargs kill -9
1154+
}
1155+
1156+
# Check out file to branch and unstage it
1157+
function fb() {
1158+
if [[ -z "$1" || -z "$2" ]]; then
1159+
echo 'Usage: filebranch branchname filename'
1160+
fi
1161+
dqt='"'
1162+
echo "git checkout ${dbq}${1}${dbq} -- ${dbq}${2}${dbq} && git reset HEAD ${dbq}${2}${dbq}"
1163+
git checkout "$1" -- "$2" && git reset HEAD "$2"
1164+
git status --untracked-files=no
1165+
}
1166+
11411167
# Chruby
11421168
CHRUBY_PATH="/usr/local/share/chruby/"
11431169
if [ -d "$CHRUBY_PATH" ]; then
@@ -1153,6 +1179,11 @@ if [ -d "$MINI_CONDA_PATH" ]; then
11531179
pathadd "$MINI_CONDA_PATH"
11541180
fi
11551181

1182+
BAZEL_COMPLETION="${HOME}/usr/local/etc/bash_completion.d/bazel-complete.bash"
1183+
if [ -s "$BAZEL_COMPLETION" ]; then
1184+
source "${HOME}/usr/local/etc/bash_completion.d/bazel-complete.bash"
1185+
fi
1186+
11561187
pathadd /Users/aray/miniconda3/bin:$PATH
11571188

11581189
# loads nvm bash_completion

.pryrc

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,34 @@
11
#require 'awesome_print' # Removing because bad colors and can't configure
22
#AwesomePrint.pry!
33

4+
5+
url = 'https://vonk.fire.ly'
6+
if defined? GrFhir
7+
client = GrFhir::Client.build(url)
8+
else
9+
client = Gr::Fhir::Client.build(url)
10+
end
11+
puts "Client ready at #{url}"
12+
413
begin
514
require 'colorize'
615
puts "#{'require'.light_red} #{"'colorize'".cyan}"
7-
rescue LoadError
16+
rescue StandardError
817
puts "Warning: colorize gem not found"
918
end
1019

1120
begin
1221
require 'factory_bot_rails'
1322
puts "#{'require'.light_red} #{"'factory_bot_rails'".cyan}"
14-
rescue LoadError
23+
rescue StandardError
1524
puts "Warning: factory_bot_rails gem not found"
1625
end
1726

1827
# Gives domestic_phone_number for creating factories that use phone numbers
1928
begin
2029
require './spec/support/faker_phones.rb'
2130
puts "#{'require'.light_red} #{"'./spec/support/faker_phones.rb'".cyan}"
22-
rescue LoadError
31+
rescue StandardError
2332
puts "Warning: ./spec/support/faker_phones.rb not found"
2433
end
2534

code/keybindings.json

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,52 @@
1212
// terrible defaults for "rails run specs"
1313
{ "key": "shift+cmd+t", "command": "workbench.action.reopenClosedEditor" },
1414
{ "key": "cmd+k cmd+f", "command": "extension.runFileSpecs" },
15+
16+
// Jump around in vim
17+
{
18+
"key": "cmd+]",
19+
"command": "workbench.action.editor.nextChange",
20+
"when": "editorTextFocus"
21+
},
1522
{
16-
"key": "alt+cmd+n",
17-
"command": "workbench.action.compareEditor.nextChange",
23+
"key": "cmd+[",
24+
"command": "workbench.action.editor.previousChange",
1825
"when": "editorTextFocus"
26+
},
27+
28+
// From https://stackoverflow.com/a/46087295/743464, note it applies to
29+
// splits with tabs which sucks
30+
{
31+
"key": "cmd+1",
32+
"command": "workbench.action.openEditorAtIndex1"
33+
},
34+
{
35+
"key": "cmd+2",
36+
"command": "workbench.action.openEditorAtIndex2"
37+
},
38+
{
39+
"key": "cmd+3",
40+
"command": "workbench.action.openEditorAtIndex3"
41+
},
42+
{
43+
"key": "cmd+4",
44+
"command": "workbench.action.openEditorAtIndex4"
45+
},
46+
{
47+
"key": "cmd+5",
48+
"command": "workbench.action.openEditorAtIndex5"
49+
},
50+
{
51+
"key": "cmd+6",
52+
"command": "workbench.action.openEditorAtIndex6"
53+
},
54+
{
55+
"key": "cmd+7",
56+
"command": "workbench.action.openEditorAtIndex7"
57+
},
58+
{
59+
"key": "cmd+8",
60+
"command": "workbench.action.openEditorAtIndex8"
1961
}
2062
]
2163

code/settings.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Place your settings in this file to overwrite the default settings
22
{
3-
"workbench.colorTheme": "Visual Studio Light",
3+
"workbench.colorTheme": "Abyss",
44
"eslint.enable": true,
55
"javascript.validate.enable": false,
66
"editor.rulers": [80],
@@ -45,5 +45,7 @@
4545
"editor.background": "#000"
4646
}
4747
},
48-
"workbench.sideBar.location": "left"
49-
}
48+
"workbench.sideBar.location": "left",
49+
"workbench.settings.editor": "json",
50+
"files.autoSave": "onFocusChange"
51+
}

0 commit comments

Comments
 (0)