|
@@ -92,10 +92,16 @@ alias d="l"
|
|
|
alias tree="tree -C -F"
|
|
|
alias grep="grep --color --exclude-dir={.svn,.git,node_modules}"
|
|
|
alias man='LESS_TERMCAP_md=$(tput bold && tput setaf 4 || :) LESS_TERMCAP_me=$(tput sgr0 || :) LESS_TERMCAP_mb=$(tput blink || :) LESS_TERMCAP_us=$(tput setaf 2 || :) LESS_TERMCAP_ue=$(tput sgr0 || :) LESS_TERMCAP_so=$(tput smso || :) LESS_TERMCAP_se=$(tput rmso || :) PAGER="${commands[less]:-$PAGER}" man'
|
|
|
-alias node-print="node -e 'let [,f=\".\",e=\"this\"]=process.argv,ctx; try{ctx=require(f)}catch{ctx=require(path.resolve(f))}; eval(\`(async function(){ with(this) return (\${e}); })\`).call(ctx).then(console.log,console.error)'"
|
|
|
-alias ts-node-print="TS_NODE_FILES=true node -r ts-node/register -e 'let [,f=\".\",e=\"this\"]=process.argv,ctx; try{ctx=require(f)}catch{ctx=require(path.resolve(f))} eval(\`(async function(){ with(this) return (\${e}); })\`).call(ctx).then(console.log,console.error)'"
|
|
|
alias vi=vim
|
|
|
|
|
|
+# aliases for node
|
|
|
+alias node-print="node -e 'let [,f=\".\",e=\"this\"]=process.argv,ctx; try{ctx=require(f)}catch{ctx=require(path.resolve(f))}; eval(\`(async function(){ with(this) return (\${e}); })\`).call(ctx).then(console.log,e=>{console.error(e);process.exit(1)})'"
|
|
|
+alias node-print-json="node -e 'let [,f=\".\",e=\"this\"]=process.argv,ctx; try{ctx=require(f)}catch{ctx=require(path.resolve(f))}; eval(\`(async function(){ with(this) return (\${e}); })\`).call(ctx).then(o=>console.log(JSON.stringify(o,null,2)),e=>{console.error(e);process.exit(1)})'"
|
|
|
+alias node-print-deep="node -e 'let [,f=\".\",e=\"this\"]=process.argv,ctx; try{ctx=require(f)}catch{ctx=require(path.resolve(f))}; eval(\`(async function(){ with(this) return (\${e}); })\`).call(ctx).then(o=>console.log(require(\"util\").inspect(o,{depth:process.env.DEPTH||Infinity})),e=>{console.error(e);process.exit(1)})'"
|
|
|
+alias node-print-repl="node -e 'let [,f=\".\",e=\"this\"]=process.argv,ctx; try{ctx=require(f)}catch{ctx=require(path.resolve(f))}; eval(\`(async function(){ with(this) return (\${e}); })\`).call(ctx).then((r)=>(console.log(r,\`\n = \\\$1\`),repl.start().context.\$1=r),e=>{console.error(e);process.exit(1)})'"
|
|
|
+alias env-ts-node="TS_NODE_FILES=true NODE_OPTIONS=\"-r ts-node/register \$NODE_OPTIONS\""
|
|
|
+alias ts-node-print="env-ts-node node-print"
|
|
|
+
|
|
|
# color diffs
|
|
|
! command -v colordiff >/dev/null || alias diff="colordiff"
|
|
|
|
|
@@ -174,7 +180,7 @@ if [ "$TERM_PROGRAM" = "vscode" ]; then
|
|
|
ABS_HOME="$(cd "$HOME" && pwd -P)"
|
|
|
if [ "$ABS_HOME" != "$HOME" ]; then
|
|
|
if [[ "$PWD" =~ $ABS_HOME* ]]; then
|
|
|
- cd "$HOME${PWD##$ABS_HOME}" || :
|
|
|
+ cd "$HOME${PWD##"$ABS_HOME"}" || :
|
|
|
fi
|
|
|
fi
|
|
|
fi
|