为Visual Studio添加快捷工具

添加额外工具:
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: Bash
              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

 

posted @ 2017-12-11 15:15  Bob-wei  阅读(501)  评论(0编辑  收藏  举报