3 次代码提交 70d116328f ... 8dc75ab5d7

作者 SHA1 备注 提交日期
  Kyle P Davis 8dc75ab5d7 feat: add node-print-table 2 年之前
  Kyle P Davis 6ea5882564 feat: add theme for bat 2 年之前
  Kyle P Davis b33ceec64a feat: add all python installs to PATH 2 年之前
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      .profile

+ 7 - 1
.profile

@@ -9,7 +9,9 @@ export PATH="$PATH:$HOME/.local/bin:$HOME/bin"
 
 # Setup user-specific Python overrides
 if [ "$OS" = "Darwin" ]; then
-	export PATH="$HOME/Library/Python/2.7/bin:$PATH:$HOME/bin"
+	for PY_DIR in "$HOME/Library/Python/"*/; do
+		export PATH="$PY_DIR/bin:$PATH"
+	done
 fi
 
 # Homebrew
@@ -97,6 +99,7 @@ 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-table="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.table,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\""
@@ -108,6 +111,9 @@ alias ts-node-print="env-ts-node node-print"
 # color json
 ! command -v json >/dev/null  ||  alias json="json -o inspect"
 
+# color theme setup for bat (not aliased to cat directly because it's a bit slow)
+command -v bat >/dev/null  ||  export BAT_THEME="$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo 'Visual Studio Dark+' || echo GitHub)"
+
 # MacVim shell aliases
 if [ "$OS" = "Darwin" ]; then
 	alias gvim="mvim"