Skip to content
View hiro-oh's full-sized avatar

Highlights

  • Pro

Block or report hiro-oh

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 250 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
hiro-oh/README.md

Hi there 👋

trophy

My favorite Markdown referencing style

## References
<!-- Inline links -->
- [Ref1: ][Ref1]
<!-- - [Ref: ][Ref] -->
<!-- - [Ref: ][Ref] -->

<!-- Reference-style links -->
[Ref1]:  ""
<!-- [Ref]:  "" -->
<!-- [Ref]:  "" -->

My favorite PS prompt function

function prompt {
    $path = (Get-Location).Path
    $gitBranch = ""

    # Gitリポジトリならブランチ名を取得
    if (git rev-parse --is-inside-work-tree 2>$null) {
        $branchName = git branch --show-current 2>$null
        if ($branchName) {
            $gitBranch = " (" + $branchName + ")"
        }
    }

    # パスの最後のディレクトリだけ色を変える
    $pathParts = $path -split '\\'  # Windowsのパス用
    if ($pathParts.Count -gt 1) {
        $basePath = ($pathParts[0..($pathParts.Count - 2)] -join "\") + "\"
        $currentDir = $pathParts[-1]
    } else {
        $basePath = ""
        $currentDir = $path
    }

    # プロンプトの表示(色付き)
    Write-Host "PS " -NoNewline -ForegroundColor Green
    Write-Host $basePath -NoNewline -ForegroundColor Blue  # 途中のパスは青
    Write-Host $currentDir -ForegroundColor Yellow  # 最後のディレクトリだけ黄色
    # ブランチ情報を改行して表示
    if ($gitBranch -ne "") {
        Write-Host $gitBranch -NoNewline -ForegroundColor Magenta # Gitブランチ名はマゼンタ
    }
    Write-Host "> " -NoNewline -ForegroundColor Cyan  # 入力プロンプトはシアン

    return " "
}

Popular repositories Loading

  1. git-study git-study Public

  2. prime_factorization prime_factorization Public

    C++

  3. git_test git_test Public

    CMake

  4. turtlesim_task turtlesim_task Public

    CMake

  5. hiro-oh hiro-oh Public

  6. Fuzz4B Fuzz4B Public

    Forked from Ryu-Miyaki/Fuzz4B

    Python