Upgrade to Pro — share decks privately, control downloads, hide ads and more …

No CUI, No Life

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for mozumasu mozumasu
December 16, 2024
260

No CUI, No Life

今日から始めるCUI

Avatar for mozumasu

mozumasu

December 16, 2024
Tweet

Transcript

  1. 準備 参照 https://formulae.brew.sh/formula/gh https://formulae.brew.sh/formula/ghq https://formulae.brew.sh/formula/fzf https://formulae.brew.sh/formula/bat https://github.com/jesseduffield/lazygit?tab=readme-ov-file#homebrew CUI生活を快適にするツールをインストール brew install

    gh # GitHub CLI brew install ghq # ローカルでのリポジトリ管理 brew install bat # cat をより便利にカラフルに brew install jesseduffield/lazygit/lazygit # git 管理をクールに brew install fzf # ファジーファインダー: 曖昧検索して選択 brew install zoxide # ディレクトリ移動の履歴を保存・移動
  2. 準備 Control + g でプロジェクトに移動できる 設定を反映 クローンしたリポジトリに爆速移動できるようにしよう # ~/.zshrc function

    ghq-fzf() { local src=$(ghq list | fzf --preview "bat --color=always --style=header,grid --line-range :80 $(ghq root)/{}/README.*" if [ -n "$src" ]; then BUFFER="cd $(ghq root)/$src" zle accept-line fi zle -R -c } zle -N ghq-fzf bindkey '^g' ghq-fzf exec $SHELL -l
  3. aliasで短く aliasの設定 こういうふうにもかける # alias 設定前 git rev-parse --show-toplevel #

    alias 設定後 proot # ~/.zshrc abbr -S proot='cd $(git rev-parse --show-toplevel)' >>/dev/null abbr -S -qq proot='cd $(git rev-parse --show-toplevel)'
  4. ~/.ssh/config before after エイリアスでssh接続できて楽ちん # ~/.ssh/config HOST __hoge_prod HOSTNAME 127.0.0.1

    User hoge-user Port 22 IdentityFile ~/.ssh/hoge-key ssh -i ~/.ssh/hoge-key [email protected] -p 22 ssh __hoge_prod
  5. 案件ごとにファイルを分けて管理 Step1. configファイルを分割 Step2. Includeで読み込む .ssh └── config .ssh ├──

    config └── conf.d └── hosts ├── 案件1 └── 案件2 # ~/.ssh/config HOST __hoge_prod HOSTNAME 127.0.0.1 User hoge-user Port 22 IdentityFile ~/.ssh/hoge-key