Skip to content

Commit 8d229cd

Browse files
committed
Global ecmascript snippets
1 parent 3314df9 commit 8d229cd

7 files changed

Lines changed: 98 additions & 71 deletions

File tree

.bash_profile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ export KEY_SUFFIX=grandrounds.com
2323

2424
#test -e "${HOME}/.iterm2_shell_integration.bash" && source "${HOME}/.iterm2_shell_integration.bash"
2525

26+
if [ -e /Users/andrewray/.nix-profile/etc/profile.d/nix.sh ]; then . /Users/andrewray/.nix-profile/etc/profile.d/nix.sh; fi # added by Nix installer

.bashrc

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ dbash() {
284284

285285
deadbash() {
286286
local iid=`docker images | grep $1 | awk '{print $3}'`
287-
echo "docker run -it ${iid} /bin/bash"
287+
echo "docker run --rm -it ${iid} /bin/bash"
288288
docker run -it ${iid} /bin/bash
289289
}
290290

@@ -1056,39 +1056,6 @@ function releaseCommits() {
10561056
echo " https://github.com/ConsultingMD/jarvis/compare/${lastReleaseBranchWithoutRemote}...${currentReleaseBranchWithoutRemote}"
10571057
}
10581058

1059-
function pvault() {
1060-
production && \
1061-
echo '🌐 Opening SSH tunnel named "my-vault-tunnel" in background...' && \
1062-
HOST=$(ec2-find -l stone-worker 2> /dev/null | tail -1 | awk '{print $1}') && \
1063-
ssh -M -S my-vault-tunnel -fnNT -L "1234:vault.grandrounds.com:443" "$GR_USERNAME@$HOST" && \
1064-
ssh -S my-vault-tunnel -O check "$GR_USERNAME@$HOST" && \
1065-
sleep 5 && \
1066-
echo '🔐 Use this token to log in:' && \
1067-
(aws-environment infra-production developer && \
1068-
VAULT_ADDR=https://localhost:1234 vault login -tls-skip-verify -token-only -method=aws role=developer) && \
1069-
open 'https://localhost:1234/ui/vault/auth?with=token' && \
1070-
echo '✅ Run kvault this command to close the tunnel'
1071-
}
1072-
1073-
function uvault() {
1074-
uat && \
1075-
echo '🌐 Opening SSH tunnel named "my-vault-tunnel" in background...' && \
1076-
HOST=$(ec2-find -l stone-worker 2> /dev/null | tail -1 | awk '{print $1}') && \
1077-
ssh -M -S my-vault-tunnel -fnNT -L "1234:vault.$(aws-environment).grandrounds.com:443" "$GR_USERNAME@$HOST" && \
1078-
ssh -S my-vault-tunnel -O check "$GR_USERNAME@$HOST" && \
1079-
sleep 5 && \
1080-
echo '🔐 Use this token to log in:' && \
1081-
(aws-environment infra-uat developer && \
1082-
VAULT_ADDR=https://localhost:1234 vault login -tls-skip-verify -token-only -method=aws role=developer) && \
1083-
open 'https://localhost:1234/ui/vault/auth?with=token' && \
1084-
echo '✅ Run kvault this command to close the tunnel'
1085-
}
1086-
1087-
function kvault() {
1088-
echo "💀 Killing my-vault-tunnel tunnel at $GR_USERNAME@$HOST"
1089-
ssh -S my-vault-tunnel -O exit "$GR_USERNAME@$HOST"
1090-
}
1091-
10921059
function jgrep() {
10931060
#bundle exec rake routes > ~/dev/rake-routes
10941061
cat ~/dev/rake-routes | grep "$1"

.vimrc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,7 @@ vnoremap <silent> <Leader>t; :'.t.<cr>
316316
" in this file
317317
nnoremap Y y$
318318
319+
319320
" In command line mode use ctrl-direction to move instead of arrow keys. Super
320321
" useful.
321322
cnoremap <C-j> <t_kd>
@@ -367,8 +368,10 @@ nnoremap <Leader>ff ?^func\\|^[a-zA-Z].*func<CR>,/
367368
368369
" Faster tab switching. I never use these cause macvim lets me use
369370
" command-shift-[ which is way nicer
370-
nnoremap <C-l> gt
371-
nnoremap <C-h> gT
371+
"nnoremap <C-l> gt
372+
"nnoremap <C-h> gT
373+
374+
nnoremap <C-L> <C-w>l
372375
373376
" experimental - enter to go into command mode (otherwise useless shortcut).
374377
" See clickable_maps for preventing vim clickable from messing this up. Also

code/settings.json

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Place your settings in this file to overwrite the default settings
22
{
3-
"workbench.colorTheme": "Visual Studio Light",
43
"eslint.enable": true,
54
"javascript.validate.enable": false,
65
"editor.rulers": [80],
@@ -13,27 +12,22 @@
1312
"**/tmp": true
1413
},
1514
"git.autofetch": false,
16-
"editor.minimap.enabled": false,
15+
"editor.minimap.enabled": true,
1716
// NOOOOOOOO
1817
"workbench.editor.enablePreview": true,
1918
"workbench.editor.enablePreviewFromQuickOpen": false,
2019
"workbench.colorTheme": "rainbow",
21-
"indentRainbow.error_color": "",
2220

2321
"editor.renderWhitespace": "none",
24-
"workbench.panel.location": "right",
2522
"gitlens.advanced.messages": {
2623
"suppressShowKeyBindingsNotice": true
2724
},
28-
"cSpell.userWords": ["kase", "kases", "mixpanel"],
2925
"window.title": "${activeEditorMedium}${separator}${rootName}",
3026
"javascript.updateImportsOnFileMove.enabled": "always",
3127
"typescript.updateImportsOnFileMove.enabled": "always",
32-
"workbench.panel.location": "bottom",
3328
"breadcrumbs.enabled": true,
3429
"editor.formatOnSave": true,
3530
"editor.tabSize": 2,
36-
"editor.tabCompletion": true,
3731
"editor.snippetSuggestions": "top",
3832
"terminal.integrated.rendererType": "dom",
3933
"editor.tokenColorCustomizations": {
@@ -46,9 +40,43 @@
4640
}
4741
},
4842
"workbench.sideBar.location": "left",
49-
"workbench.settings.editor": "json",
50-
"[json]": {
51-
"editor.defaultFormatter": "esbenp.prettier-vscode"
43+
"gitlens.menus": {
44+
"editor": {
45+
"blame": false,
46+
"clipboard": true,
47+
"compare": true,
48+
"details": false,
49+
"history": false,
50+
"remote": false
51+
},
52+
"editorGroup": {
53+
"blame": true,
54+
"compare": true
55+
},
56+
"editorTab": {
57+
"clipboard": true,
58+
"compare": true,
59+
"history": true,
60+
"remote": true
61+
},
62+
"explorer": {
63+
"clipboard": true,
64+
"compare": true,
65+
"history": true,
66+
"remote": true
67+
},
68+
"scmGroup": {
69+
"compare": true,
70+
"openClose": true,
71+
"stash": true,
72+
"stashInline": true
73+
}
5274
},
53-
// "files.autoSave": "onFocusChange"
75+
"gitlens.currentLine.enabled": false,
76+
"gitlens.hovers.currentLine.over": "line",
77+
"gitlens.codeLens.enabled": false,
78+
"errorLens.gutterIconsEnabled": true,
79+
"[javascript]": {
80+
"editor.defaultFormatter": "esbenp.prettier-vscode"
81+
}
5482
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
3+
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
4+
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
5+
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
6+
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
7+
// Placeholders with the same ids are connected.
8+
// Example:
9+
// "Print to console": {
10+
// "scope": "javascript,typescript",
11+
// "prefix": "log",
12+
// "body": [
13+
// "console.log('$1');",
14+
// "$2"
15+
// ],
16+
// "description": "Log output to console"
17+
// }
18+
"Console Log": {
19+
"scope": "javascript,typescript",
20+
"prefix": "c",
21+
"body": [
22+
"console.log($1)",
23+
],
24+
"description": "Console log string"
25+
},
26+
"Console Log String": {
27+
"scope": "javascript,typescript",
28+
"prefix": "c'",
29+
"body": [
30+
"console.log('$1')",
31+
],
32+
"description": "Console log string"
33+
},
34+
"Console Log Descriptor Then Thing": {
35+
"scope": "javascript,typescript",
36+
"prefix": "ct",
37+
"body": [
38+
"console.log('$1 ${2}', ${2})",
39+
],
40+
"description": "Console log descriptor then thing"
41+
},
42+
"Console Log value name and value": {
43+
"scope": "javascript,typescript",
44+
"prefix": "c,",
45+
"body": [
46+
"console.log('$1', ${1})",
47+
],
48+
"description": "Console log value name and value"
49+
},
50+
}

code/snippets/javascript.json

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
32
// Place your snippets for JavaScript here. Each snippet is defined under a snippet name and has a prefix, body and
43
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
54
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
@@ -15,27 +14,6 @@
1514
],
1615
"description": "For Loop"
1716
},
18-
"Console Log": {
19-
"prefix": "c",
20-
"body": [
21-
"console.log($1)",
22-
],
23-
"description": "Console log string"
24-
},
25-
"Console Log Text": {
26-
"prefix": "c'",
27-
"body": [
28-
"console.log('$1')",
29-
],
30-
"description": "Console log text"
31-
},
32-
"Console Log String": {
33-
"prefix": "c,",
34-
"body": [
35-
"console.log('$1', ${1})",
36-
],
37-
"description": "Console log string"
38-
},
3917
"React Constructor": {
4018
"prefix": "rc",
4119
"body": [
@@ -53,4 +31,4 @@
5331
],
5432
"description": "Function body"
5533
}
56-
}
34+
}

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ if [[ -d "$vsCodeDir" ]]; then
9797
# putting these here for easy working with later
9898
#ln -fs /Users/andrewray/configs/code/settings.json /Users/andrewray/Library/Application\ Support/Code/User/
9999
#ln -fs /Users/andrewray/configs/code/snippets/javascript.json "/Users/andrewray/Library/Application Support/Code/User/snippets/javascript.json"
100+
#ln -fs /Users/andrewray/configs/code/snippets/ecmascript.code-snippets.json "/Users/andrewray/Library/Application Support/Code/User/snippets/ecmascript.code-snippets.json"
100101

101102
let "symlinks+=1"
102103
fi
@@ -165,5 +166,4 @@ git config --global core.editor /usr/local/bin/vim
165166
#sudo ./.osx
166167
echo $COLOR_RESET
167168

168-
# Toilets!
169169
echo $COLOR_GREEN"Done!"$COLOR_LIGHT_GREEN $symlinks$COLOR_GREEN symlinks were created.$COLOR_RESET

0 commit comments

Comments
 (0)