1. 程式人生 > >為Visual Studio添加快捷工具

為Visual Studio添加快捷工具

nta pat lean post sys ech 等待 sta chm

添加額外工具:
Tools -> External Tools...
1. 添加Git Console
                Title: Git Console
              Command: C:\Program Files\Git\bin\sh.exe
            Arguments: --login
    Initial directory: $(ItemDir)
2. 添加Win10的Bash(推薦,安裝zsh、antigen或者on-my-zsh以及git後,可以用很多git的alias)
   註意:命令行不能直接用%systemroot%\System32\bash.exe,需要找它的源文件。
                Title: Git Console
              Command: C:\Windows\WinSxS\amd64_microsoft-windows-lxss-bash_31bf3856ad364e35_10.0.16299.15_none_62878a822db68b25\bash.exe
            Arguments: --login
    Initial directory: $(ItemDir)
3. Sublime Text
                Title: Sublime Text
              Command: "C:\Program Files\Sublime Text 3\sublime_text.exe"
            Arguments: $(ItemPath):$(CurLine):$(CurCol)
    Initial directory: $(ItemDir)
4. Notepad2
                Title: Notepad2
              Command: "C:\Program Files\Notepad2\Notepad2.exe"
            Arguments: /g $(CurLine),$(CurCol) $(ItemPath)
    Initial directory: $(ItemDir)
5. VSCode
                Title: VSCode
              Command: "C:\Program Files\Microsoft VS Code\Code.exe"
            Arguments: -g $(ItemPath):$(CurLine):$(CurCol)
    Initial directory: $(ItemDir)




Win10 WSL(bash) 配置
~~~~~~~~~~~~~~~~~~~~~~
現在添加刪除組件中勾選 Windows Subsystem for Linux
然後運行bash,會提示一個鏈接,瀏覽器打開後會出現App Store安裝Ubuntu
再次運行bash,等待安裝完成。(或者:lxrun /install)

用zsh代替bash
$ sudo apt install zsh vim -y
$ cd ~
$ curl -L git.io/antigen > antigen.zsh
$ vim ~/.antigenrc
source $HOME/antigen.zsh
antigen use oh-my-zsh
antigen bundles <<EOBUNDLES
    git
    gitfast
    git-extras
    heroku
    sudo
    z
    history
    encode64
    zsh-users/zsh-syntax-highlighting
    zsh-users/zsh-autosuggestions
    zsh-users/zsh-completions
EOBUNDLES
antigen theme clean
antigen apply
$ echo source \$HOME/.antigenrc>~/.zshrc
$ vim ~/.bashrc
在開頭輸入:
if [ -t 1 ]; then
    exec zsh
fi
$ exit
重啟運行bash
如果出現警告:zsh compinit: insecure directories, run compaudit for list.
$ chmod -R 755 ~/.antigen
$ chmod -R 755 ~/antigen.zsh
重啟運行bash

為Visual Studio添加快捷工具