前言:
經常在vs中工作,但是一些編輯工作卻非常喜歡sublime的方式,如果你也是,那我們來當媒婆吧,哈哈.
准備:
Visualstudio一枚
Visualstudio一枚
Sublime一枚
版本都隨意,我這里以vs2010舉例.
開始:
打開工具-->外部工具

點擊增加:

其中標題隨你,
命令選擇你的sublime的位置
參數輸入:
$(ItemPath):$(CurLine):$(CurCol)
這個的意思是:
文件名:當前行號:當前列號,這個參數方式對所有工具都有效,我這里列出完整的參數參考.
Usage: subl [arguments] [files] edit the given files
or: subl [arguments] [directories] open the given directoriesor: subl [arguments] - edit stdin
Arguments:--project <project>: Load the given project--command <command>: Run the given command-n or --new-window: Open a new window-a or --add: Add folders to the current window-w or --wait: Wait for the files to be closed before returning-b or --background: Don't activate the application-s or --stay: Keep the application activated after closing the file-h or --help: Show help (this message) and exit-v or --version: Show version and exit--wait is implied if reading from stdin. Use --stay to not switch backto the terminal when a file is closed (only relevant if waiting for a file).Filenames may be given a :line or :line:column suffix to open at a specificlocation.這樣就可以點擊工具-->sublime來啟動sublime編輯了,編輯完保存關閉,vs會提示文件有修改,是否加載,點擊是即可.
如何能夠更加快捷的使用呢,那就設置快捷鍵吧.打開工具-->選項
找到Tools.ExternalCommand3,數字3是看你在外部工具列表排的位置設置一個你要的快捷鍵,我設置的Ctrl+E,Ctrl+E
確定就好了,這樣我們需要編輯就Ctrl+E,Ctrl+E,然后編輯,完成后Ctrl+s,alt+f4即可.