A New Function For Vscode Refresh In Current Folder

Pavol Kutaj
1 min readDec 3, 2020

--

usecase

The concern is documenting the need to just open the editor with the scope of the current folder — it makes the search much faster and I need to constraint the git sidebar only to the single repo.

1. CODE

  • changes the path in the terminal
  • kills all instances of the editor
  • refreshes the context to the given path this is used solely for very much used path like a knowledge base
# C:\Users\Admin\Documents\PowerShell\Microsoft.PowerShell_profile.ps1function open-vsc-here {
kill -n code -ErrorAction Ignore
code .
}
Function open-blog {
$wlogPath = "C:\Users\$env:USERNAME\Documents\workspace\work.log\kb\"
Push-Location -Path $wlogPath
vsc
}
Set-Alias vsc open-vsc-here
Set-Alias kb open-blog

--

--

No responses yet