<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                [TOC] # oh-my-zsh ?? 開源:https://github.com/robbyrussell/oh-my-zsh 默認的 Bash 是黑白的,沒有色彩。而 Oh My Zsh 可以帶你進入彩色時代。Oh My Zsh 同時提供一套插件和工具,可以簡化命令行操作。后面我們會看到很多介紹,你會看到我愛死這家伙了。 **Oh My Zsh 使用了 Z shell(zsh),一個和 Bash 相似的 Shell,而非 Bash。** 在 Z shell 中,`~/.zshrc`是最重要的配置文件。 # 安裝 **curl** 方式: ``` sh -c "$(curl -fsSL https://raw.fastgit.org/ohmyzsh/ohmyzsh/master/tools/install.sh)" ``` Set Zsh as your default shell: ~~~ chsh -s $(which zsh) ~~~ > [oh-my-zsh 手動安裝方法](https://github.com/ohmyzsh/ohmyzsh#manual-installation) ## 系統內置的 shell unix 衍生系統的默認 shell 都是 bash 以mac 為例,我們看下系統內置了幾種shell ~~~ ? /Users/XXX > cat /etc/shells # List of acceptable shells for chpass(1). # Ftpd will not allow users to connect who are not using # one of these shells. /bin/bash /bin/csh /bin/ksh /bin/sh /bin/tcsh /bin/zsh ~~~ ## `~/.zshrc`重置 ~~~ cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc ~~~ # antigen(個人覺得沒必要??) oh-my-zsh 的管理工具:[antigen](https://github.com/zsh-users/antigen) ## oh-my-zsh 主題設置 1. 可以到~/oh-my-zsh/themes/中查看現有的主題。推薦agnoster。 2. 設置主題為agnoster:編輯`~/.zshrc`,將 ZSH-THEME 項替換為 agnoster 3. 注意agnoster主題需要幾個特殊字體的支持(要不然會顯示.叉叉),可以從這里下載:https://gist.github.com/qrush/1595572 ## 設置 Powerline 效果 下載 https://github.com/powerline/fonts 里面的一種字體即可,然后安裝字體! [Source Code Pro for Powerline](https://github.com/powerline/fonts/tree/master/SourceCodePro) 我自己喜歡自備的 Operator Mono Lig 字體,選中即可; # powerlevel10k Powerlevel10k 是 Zsh 的一個主題。它強調速度、靈活性和開箱即用的體驗。 ~~~ brew install romkatv/powerlevel10k/powerlevel10k echo "source $(brew --prefix)/opt/powerlevel10k/powerlevel10k.zsh-theme" >>~/.zshrc ~~~ ## 字體圖標 ``` brew tap homebrew/cask-fonts ``` # 常用插件 ## 配置 ``` vim ~/.zshrc // 啟用插件,多插件空格分開 plugins=( git z sudo zsh-autosuggestions zsh-syntax-highlighting zsh-better-npm-completion ) source $ZSH/oh-my-zsh.sh // 查看配置的 .oh-my-zsh 插件 ls ~/.oh-my-zsh/custom/plugins ``` ## 推薦插件 * [zsh-history-substring-search](https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/history-substring-search) * [zsh-syntax-highlighting](https://github.com/zsh-users/zsh-syntax-highlighting) * [zsh-autosuggestions](https://github.com/zsh-users/zsh-autosuggestions) * [zsh-better-npm-completion](https://github.com/lukechilds/zsh-better-npm-completion) ## 更多插件可參考 * [github.com/robbyrussel…](https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins) * [github.com/unixorn/awe…](https://github.com/unixorn/awesome-zsh-plugins) * [github.com/robbyrussel…](https://github.com/robbyrussell/oh-my-zsh/wiki/Plugins-Overview) # 卸載 卸載 **oh my zsh** 可運行 `uninstall_oh_my_zsh`; 自動更新 **oh my zsh** 可在 **.zshrc** 中添加 `DISABLE_UPDATE_PROMPT=true`; 自動更新 **oh my zsh** 可運行 `upgrade_oh_my_zsh`; # 技巧 按住 ? 鍵: 1. 可以拖拽選中的字符串; 2. 點擊 url:調用默認瀏覽器訪問該網址; 3. 點擊文件:調用默認程序打開文件; 4. 如果文件名是 filename:42,且默認文本編輯器是 Mac vim將會直接打開到這一行; 5. 點擊文件夾:在 finder 中打開該文件夾; 6. 同時按住 opt 鍵,可以以矩形選中。 # 快捷鍵 | 快捷鍵 | 描述 | | --- | --- | | `ctrl + u ` | 清除當前行 | | `ctrl + h` | 刪除光標之前的字符 | | `ctrl + k` | 刪除到文本末尾 | | `? + t` | 水平分屏 | | `? + shift + t` | 垂直分屏 | | `? + shift + h` | 列出剪切板歷史 | | `ctrl + a` | 切換到行首 | | `ctrl + e` | 切換到行尾 | | `? + arrow`/`?+shift + [` | Tab 切換 | | `? + shift + arrow` | 改變 Tab 的順序 | | `? + Num` | 快速切換到 Tab 上 | | `? + enter` | 最大化/還原 Tab | | `? + /` | 快速定位到光標位置 | | `? + opt + e` | 一屏顯示所有窗口 | | `? + r` | 清屏 | > [Mac iTerm2快捷鍵匯總大全](http://www.mabiji.com/mac/iterm2hotkeys.html) # Alias ## 添加別名 1. 切換到目錄:`$ cd ~/.oh-my-zsh/custom` 2. 創建一個文件:`aliases.zsh` 3. 可以用你喜歡的文本編輯器打開文件,添加別名: ~~~bash # An alias to naviage up one directory level alias open='explorer.exe' ~~~ 4. 保存之后,重啟命令行,或者運行`$ source ~/.zshrc` ## git alias ``` g=git ga='git add' gaa='git add --all' gapa='git add --patch' gb='git branch' gba='git branch -a' gbd='git branch -d' gbda='git branch --no-color --merged | command grep -vE "^(\*|\s*(master|develop|dev)\s*$)" | command xargs -n 1 git branch -d' gbl='git blame -b -w' gbnm='git branch --no-merged' gbr='git branch --remote' gbs='git bisect' gbsb='git bisect bad' gbsg='git bisect good' gbsr='git bisect reset' gbss='git bisect start' gc='git commit -v' 'gc!'='git commit -v --amend' gca='git commit -v -a' 'gca!'='git commit -v -a --amend' gcam='git commit -a -m' 'gcan!'='git commit -v -a --no-edit --amend' 'gcans!'='git commit -v -a -s --no-edit --amend' gcb='git checkout -b' gcd='git checkout develop' gcf='git config --list' gcl='git clone --recursive' gclean='git clean -fd' gcm='git checkout master' gcmsg='git commit -m' 'gcn!'='git commit -v --no-edit --amend' gco='git checkout' gcount='git shortlog -sn' gcp='git cherry-pick' gcpa='git cherry-pick --abort' gcpc='git cherry-pick --continue' gcs='git commit -S' gd='git diff' gdca='git diff --cached' gdct='git describe --tags `git rev-list --tags --max-count=1`' gdt='git diff-tree --no-commit-id --name-only -r' gdw='git diff --word-diff' gf='git fetch' gfa='git fetch --all --prune' gfo='git fetch origin' gg='git gui citool' gga='git gui citool --amend' ggpull='git pull origin $(git_current_branch)' ggpur=ggu ggpush='git push origin $(git_current_branch)' ggsup='git branch --set-upstream-to=origin/$(git_current_branch)' ghh='git help' gignore='git update-index --assume-unchanged' gignored='git ls-files -v | grep "^[[:lower:]]"' git-svn-dcommit-push='git svn dcommit && git push github master:svntrunk' gk='\gitk --all --branches' gke='\gitk --all $(git log -g --pretty=%h)' gl='git pull' glg='git log --stat' glgg='git log --graph' glgga='git log --graph --decorate --all' glgm='git log --graph --max-count=10' glgp='git log --stat -p' glo='git log --oneline --decorate' globurl='noglob urlglobber ' glog='git log --oneline --decorate --graph' gloga='git log --oneline --decorate --graph --all' glol='git log --graph --pretty='\''%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --abbrev-commit' glola='git log --graph --pretty='\''%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --abbrev-commit --all' glp=_git_log_prettily glum='git pull upstream master' gm='git merge' gmom='git merge origin/master' gmt='git mergetool --no-prompt' gmtvim='git mergetool --no-prompt --tool=vimdiff' gmum='git merge upstream/master' gp='git push' gpd='git push --dry-run' gpoat='git push origin --all && git push origin --tags' gpristine='git reset --hard && git clean -dfx' gpsup='git push --set-upstream origin $(git_current_branch)' gpu='git push upstream' gpv='git push -v' gr='git remote' gra='git remote add' grb='git rebase' grba='git rebase --abort' grbc='git rebase --continue' grbi='git rebase -i' grbm='git rebase master' grbs='git rebase --skip' grep='grep --color=auto --exclude-dir={.bzr,CVS,.git,.hg,.svn}' grh='git reset HEAD' grhh='git reset HEAD --hard' grmv='git remote rename' grrm='git remote remove' grset='git remote set-url' grt='cd $(git rev-parse --show-toplevel || echo ".")' gru='git reset --' grup='git remote update' grv='git remote -v' gsb='git status -sb' gsd='git svn dcommit' gsi='git submodule init' gsps='git show --pretty=short --show-signature' gsr='git svn rebase' gss='git status -s' gst='git status' gsta='git stash save' gstaa='git stash apply' gstc='git stash clear' gstd='git stash drop' gstl='git stash list' gstp='git stash pop' gsts='git stash show --text' gsu='git submodule update' gts='git tag -s' gtv='git tag | sort -V' gunignore='git update-index --no-assume-unchanged' gunwip='git log -n 1 | grep -q -c "\-\-wip\-\-" && git reset HEAD~1' gup='git pull --rebase' gupv='git pull --rebase -v' gwch='git whatchanged -p --abbrev-commit --pretty=medium' gwip='git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit --no-verify -m "--wip--"' history='fc -l 1' l='ls -lah' ``` ## Git 別名 幾乎每個人都會使用一些方法比如 Git 別名來提高效率,幾乎所有人都會把使用`git st`來代替`git status`。然而這需要手動設置,每個人也都不完全一樣。 Oh My Zsh 提供了一套系統別名(alias),來達到相同的功能。比如`gst`作為`git status`的別名。而且 Git 插件是 Oh My Zsh 默認啟用的,相當于你使用了 Oh My Zsh,你就擁有了一套高效率的別名,而且還是全球通用的。是不是棒棒噠?下面是一些我常用的別名: |Alias | Command | | --- | --- | | gapa | `git add --patch` | | gc! | `git commit -v --amend` | | gcl | `git clone --recursive` | | gclean | `git reset --hard && git clean -dfx` | | gcm | `git checkout master` | | gcmsg| `git commit -m` | | gco | git checkout | | gd | git diff | | gdca | git diff --cached | | glola | `git log --graph --pretty = format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --all` | | gp | git push | | grbc | git rebase --continue | | gst | git status | | gup | git pull --rebase | | gwip | `git add -A; git rm $(git ls-files --deleted) 2> /dev/null; git commit -m "--wip--"` | 完整列表請參考:https://github.com/robbyrussell/oh-my-zsh/wiki/Plugin:git ## 參考 [終極 Shell——ZSH](https://zhuanlan.zhihu.com/p/19556676) http://blog.csdn.net/iloveyin/article/details/49522449 https://github.com/robbyrussell/oh-my-zsh/wiki
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看