개요
- 투입된 사이트의 vscode > git bash의 응답이 너무 느려서 터미널을 powershell로 사용해 보기로 함.
- 관리의 편의를 위해, 기본 프로파일 파일 위치가 아닌 별도의 위치에 프로파일용 파일을 생성함. (e.g. C:\Tool\powershell_alias.ps1)
방법
vscode > settings.json 수정
- vscode 에서 ctrl + shift + p > open user settings (json) 으로 settings.json open.
- 아래의 항목에 맞게 수정/추가
{
"terminal.integrated.defaultProfile.windows": "PowerShell Custom",
"terminal.integrated.profiles.windows": {
"PowerShell Custom": {
"source": "PowerShell",
"icon": "terminal-powershell",
"args": ["-NoExit", "-File", "C:\\Tool\\powershell_alias.ps1"]
}
},
...
}
powershell_alias.ps1
# 인코딩 설정
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
# 프로파일 파일 경로
$PROFILE_FILE = 'C:\Tool\powershell_alias.ps1'
# 프롬프트 경로를 짧게 하는 설정
function prompt {
$p = Split-Path -Leaf $pwd
"[이모지 적당히] $p> "
}
# ll
Set-Alias ll ls
# 상위폴더 이동
function .. { cd .. }
function ... { cd ../.. }
function .... { cd ../../.. }
# 현재 폴더를 탐새끼로 열기
function e { explorer . }
# alias 목록 보기 (그냥 이 파일 보여주기)
function funclist { Get-Content $PROFILE_FILE }
function st { git status }
function add { git add . }
function commit { git commit -m $args }
function fetch { git fetch origin }
function push { git push }
function pull { git pull }
function gcd { git checkout dev }
function gcc { git checkout [내 브랜치] }
function pd {
cd [monorepo 의 내 프로젝트 경로]
pnpm run dev
}