話題討論 | 用好VSCode這13款插件和8個快捷鍵,工作效率提升10倍

{"type":"doc","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"作者:","attrs":{}},{"type":"text","text":"程序員檸檬橙","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"程序員學習路線圖:","attrs":{}},{"type":"link","attrs":{"href":"https://github.com/imcoderlemon/CodeClass","title":""},"content":[{"type":"text","text":"https://github.com/imcoderlemon/CodeClass","attrs":{}}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"大家好我是lemon,上次推送的文章雖然不是技術文,但熱度達到了小高潮,沒看過的小夥伴可以點擊下面鏈接圍觀:","attrs":{}},{"type":"link","attrs":{"href":"https://mp.weixin.qq.com/s/kN1jpWByBs2ztg44ZDKWKQ","title":""},"content":[{"type":"text","text":"我在一線城市買房了,靠着自己努力和...","attrs":{}}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"僅一天時間文章閱讀數就達到 1000+ ,目前爲止有 16 位土豪朋友讚賞,這也是寫公衆號這半年來收穫點贊最多、讚賞最多的文章(作爲一個技術號主,高贊竟然不是技術文,哭死)。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"我想大家一定是知道lemon要開始還房貸,壓力太大想幫忙分擔一把,","attrs":{}},{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"鞠躬感謝各位小夥伴的支持與認可,lemon 會堅持輸出技術文章讓自己和讀者們都有收穫","attrs":{}},{"type":"text","text":"。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"話不多說,馬上進入我們今天的主題吧。","attrs":{}}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"又見VsCode","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"Visual Studio Code(簡稱VS Code)是一個由微軟開發,同時支持Windows 、Linux 和 macOS 等操作系統的免費代碼編輯器","attrs":{}},{"type":"text","text":",在2019年的Stack Overflow組織的開發者調研中,VS Code被認爲是最受開發者歡迎的開發環境。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"之前寫過一篇文章詳細介紹如何使用 VsCode 進行遠程開發","attrs":{}},{"type":"text","text":",文章得到了衆多讀者的廣泛好評,傳送門:","attrs":{}},{"type":"link","attrs":{"href":"https://mp.weixin.qq.com/s/AR9BbYG4t8nKvhWihaEgvg","title":""},"content":[{"type":"text","text":"手把手教你配置VS Code遠程開發工具,工作效率提升N倍","attrs":{}}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"VsCode 遠程開發環境相對其他 IDE 的遠程開發環境,實現了真正的遠程開發,在本地主機(一般是Windows或MAC)上的操作的對象直接就是遠程機(Linux),所有本地主機上的修改直接基於遠端文件,擺脫了傳統開發流程在本地編輯文件,利用FTP工具上傳到遠程編譯機調試編譯,這一套繁瑣的操作,因此非常的方便。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"接着上篇VsCode教程,這篇文章我會結合日常工作使用經驗,教你打造一個體驗流暢的 C/C++ 開發環境","attrs":{}},{"type":"text","text":",這份配置指南可能不是面面俱到,也不會詳細的教你一步步怎麼配置插件,這些太細節的工作留給你自己去完成,實際上插件下載頁都會有詳細的說明。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"不少新手可能會覺得 VsCode 編輯文本還好,看代碼和寫代碼太難用,那是沒有掌握正確的打開方式,","attrs":{}},{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"VsCode 精髓是豐富的插件體系支持,相信看完這篇文章配置好環境之後,就只剩一句「真香」能形容","attrs":{}},{"type":"text","text":"。","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/a7/a704472d8c9bd6cf532e6e873555b65d.gif","alt":null,"title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"爲了有個直觀的印象,先來看下我的 VsCode 插件列表,因爲我用VsCode 開發 C/C++/Go/Python 程序,插件比較多,有些可能和本文無關的插件可以忽略掉。","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/f7/f7964d78967768fb5a2dff0795c36505.png","alt":null,"title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"基礎開發插件","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"既然是配置支持C/C++環境下開發,","attrs":{}},{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"那首先推薦的基礎 C/C++ 開發插件","attrs":{}},{"type":"text","text":",以下兩個是必須要裝的插件,主要提供一些基礎的代碼調試和查看功能,安裝以後 VsCode 就能支持智能化代碼補全、類型填充和聯想、符號和函數定義跳轉、引用查找等 C/C++ 程序開發和源碼管理必備能力,讓你的 VsCode 從編輯器進化成 IDE 的基礎插件。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/4f/4fa166a0b50711c1e3120fa1332695b4.png","alt":null,"title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/bc/bc3c58577c2dfc59bcb3691f160def81.png","alt":null,"title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"源碼閱讀","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"程序員日常工作有兩大內容,一個是寫自己的代碼,一個是閱讀別人寫的代碼,下面這兩個插件讓你在 VsCode 優雅看代碼。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"首先推薦的是下面的這個懶人神器 TODO Tree,自己寫的 TODO 哭着也要補充實現。","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/47/473e4c4e332de73140c07bde28316d4a.png","alt":null,"title":"","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":"","fromPaste":false,"pastePass":false}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"TODO Tree","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"這個插件的使用場景是,你看完代碼加了下面這個註釋 :","attrs":{}},{"type":"codeinline","content":[{"type":"text","text":"// TODO 以後會擴展這部分功能","attrs":{}}],"attrs":{}},{"type":"text","text":" 當然,不知道這個「以後」是什麼時候,一不小心以後變成遙遙無期,一部分原因是不想改,另一部分原因是寫下這段註釋的人時間久了就忘記了,這時候你需要「 TODO Tree 插件」,我們可以更方便的管理代碼中的此類註釋。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"這個插件能幫你組織和管理TODO 註釋,你在代碼中註釋的帶 TODO 的標籤會統一在側邊欄顯示出來,當然不限於 TODO 註釋,可以自定義管理標籤比如 ","attrs":{}},{"type":"codeinline","content":[{"type":"text","text":"FIXME","attrs":{}}],"attrs":{}},{"type":"text","text":" 等,可以基於標籤過濾和篩選。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"另一個推薦的源碼閱讀插件是 Bookmarks","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/b5/b5e37cdd5a7ebbe68b09191b07ac5389.png","alt":null,"title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"「書籤」這個插件的功能就和它名字一樣直接,沒錯它就是一個你的源碼書籤,當我們看大工程源碼的時候,往往需要在成千上萬個源文件之間跳轉,","attrs":{}},{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"此外, Bookmarks 能幫你方便的創建和管理書籤","attrs":{}},{"type":"text","text":",看到哪個位置想加個書籤就按快捷鍵 ","attrs":{}},{"type":"codeinline","content":[{"type":"text","text":"Ctrl + Alt + K","attrs":{}}],"attrs":{}},{"type":"text","text":" ,多按一次就是刪除,不僅如此他還提供了在書籤之前跳躍和查看管理的功能,更多功能可以自己體驗,反正我看大工程源碼用這個很爽。","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/60/609b58f815b37324eeb57eafa7f4ff71.png","alt":null,"title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"代碼管理","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"下面介紹兩個 Git 版本控制相關的插件","attrs":{}},{"type":"text","text":",項目中我們用的最多的版本控制工具是 Git ,當然 VsCode 自身提供了比較豐富的 Git 版本控制功能,基本上可以通過在界面點點點完成一些了Git 操作,但我今天要介紹的這兩個插件能讓你的 Git 更驚豔,算是對功能的增強,讓你的 Git 操作更直觀好用,好看的東西誰不喜歡呢?","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"第一個出場的是Git Graph 插件,可視化Git倉庫,讓你的提交記錄看起來美觀大方,並且基於圖中提交點提供了豐富的Git 操作。","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/c0/c003b0e75399c625612cffc629902c93.png","alt":null,"title":"","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":"","fromPaste":false,"pastePass":false}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"GitGraph","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"如圖中你所見到的樣子,提交記錄變成一條條時間線,分支也能清晰的用不同顏色時間線區分出來,並且點開提交線上的提交點可以查看當時的提交動作,可以在提交動作上查看做了哪些改動,也可以方便的跳轉到改動文件,更多功能自行體驗,這個插件 lemon 強烈推薦!","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"下面介紹的這個GitLens 插件也是Git功能增強工具。","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/d5/d52b8dc0b9b6cae91b9ce84442af43df.png","alt":null,"title":"","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":"","fromPaste":false,"pastePass":false}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"GitLens","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"我最喜歡它的一個功能是,它可以在文件中改動的位置後面直接顯示出本次改動的提交信息,然後你可以直接通過顯示的提交信息跳轉到提交文件對比,其實還有其他豐富的功能,不過這個功能我用的最多。","attrs":{}}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"小而美的工具","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"下面這幾個插件是我在日常使用中積累的工具插件,非必須,但是擁有了之後編碼幸福感倍增,下面一一介紹給大家。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"第一個是下面這個Bracket Pair Colorizer插件,我管它叫彩虹括號插件。","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/0d/0d9214844161aaa8aca9ff5936867b2e.png","alt":null,"title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"彩虹括號","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"你是否爲經常爲寫的大括號、花括號、小括號沒有匹配而煩惱?是否經常找匹配括號看瞎了眼?現在不要 888 也不要 998,只需一鍵下載安裝這個插件就再也不用擔心啦。這個插件讓你寫的每一個括號都能找到他自己的顏色,成雙成對,點一下其中一半括號自動匹配另一半,拯救了廣大程序員的近視眼睛度數。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"再來介紹下面這個koroFileHeader插件,這個插件主要用於自動的插入頭文件開頭的說明和函數的說明。","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/63/6396c1c4b5bb61600dca346094d5abc9.png","alt":null,"title":"","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":"","fromPaste":false,"pastePass":false}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"koroFileHHeader","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"比如我們經常看到別人的頭文件開頭是這樣的模板:","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"這個可不是別人一個個字打出來的,安裝插件之後你只需要簡單配置想要的格式,然後按下快捷鍵","attrs":{}},{"type":"codeinline","content":[{"type":"text","text":"Ctrl + Alt +i","attrs":{}}],"attrs":{}},{"type":"text","text":" 即可自動即可自動生成這樣一個模板。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"類似的對函數的說明註釋模板,只需按下快捷鍵","attrs":{}},{"type":"codeinline","content":[{"type":"text","text":"Ctrl + Alt +t","attrs":{}}],"attrs":{}},{"type":"text","text":" 即可完成,非常的方便。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"下面這個插件Switcher,這個插件能在頭文件和 C/C++ 文件之間跳轉。","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/08/08db181ccea13ebb25c2c6f474d492c4.png","alt":null,"title":"","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":"","fromPaste":false,"pastePass":false}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"這個插件完全是因爲我太懶想省力,才找的一個輔助工具,我們經常需要通過頭文件跳到對應的源文件,或者從源文件跳轉到對應的頭文件,當然可以在側邊欄的文件管理器中選擇打開,但是多了一個步驟有點繁瑣,所以我找了這個插件,其實按插件的說明文檔,它是能在不同的文件類型之間跳轉,不僅僅侷限於頭文件和源文件,懶人福音,你值得擁有。","attrs":{}}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"實用工具","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"下面這幾個插件是比較實用的工具插件,各取所需。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"第一個是官方提供的 VsCode 中文漢化包","attrs":{}},{"type":"text","text":"。雖然lemon提倡並鼓勵大家多多實用英語,但若你不想折騰,那咱們家漢語博大精深,好優美的中國話,那就讓VsCode也來說漢語吧,Microsoft 官方直供,兼容性好,放心食用。","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/6d/6d19dd9d25035732beaed5e0f7e9ec81.png","alt":null,"title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"中文語言包","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"下面這個是 Markdown 預覽增強插件","attrs":{}},{"type":"text","text":"。對於經常寫博客或文章的人來說,Markdown 肯定是少不了的,這個插件支持分屏預覽,各種豐富的Markdwon 增強功能。","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/8d/8d0dd13297723e20f6e815f3b1ea54e1.png","alt":null,"title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"markdown增強","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"最後這個 shellman 插件是 Linux shell 腳本輔助工具。在 Linux 下工作難免隨手寫一個腳本,這個插件能提供了便捷的shell script 自動補全和聯想等功能,提高你的腳本編寫速度和準確性。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/7c/7cb785c6a64e1cd8950518b24ceded89.png","alt":null,"title":"","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":"","fromPaste":false,"pastePass":false}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"shellman","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"以上就是我開發環境中配置的常用插件,快來抄作業,跟着配置起來你就擁有了一個流暢的C/C++開發環境","attrs":{}},{"type":"text","text":"。搭配下面講的插件部分內容服用,效果更佳。","attrs":{}}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"最常用快捷鍵","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"快捷鍵太多,沒必要完全記下來,只需記住一些常用的快捷鍵即可,一些不常用的快捷鍵在使用的時候加強記憶就好","attrs":{}},{"type":"text","text":"。列舉出我自己常用的快捷鍵,不多,但夠用!應付日常開發工作綽綽有餘。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"codeinline","content":[{"type":"text","text":"Ctrl + Shift + P","attrs":{}}],"attrs":{}},{"type":"text","text":"  這個必須要放在第一位,這個命令是所有「命令之母」。這麼說一點也不過分,它會打開 VsCode 命令窗口,在這個窗口下輸入上述的插件名稱就能知道這個插件支持哪些特性了,順帶還會說明特性快捷鍵。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"下面舉個例子,先輸入","attrs":{}},{"type":"codeinline","content":[{"type":"text","text":"Ctrl + Shift + P","attrs":{}}],"attrs":{}},{"type":"text","text":" 打開命令查找輸入框,然後輸入 ","attrs":{}},{"type":"codeinline","content":[{"type":"text","text":"bookmarks","attrs":{}}],"attrs":{}},{"type":"text","text":" 就能知道這個插件的支持的所有特性,順便記下快捷鍵。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"codeinline","content":[{"type":"text","text":"Ctrl + P","attrs":{}}],"attrs":{}},{"type":"text","text":" 文件查找。快速打開文件列表,輸入關鍵字匹配文件,優先顯示最新打開過的文件,方便的在指定文件之間跳轉。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"codeinline","content":[{"type":"text","text":"F12","attrs":{}}],"attrs":{}},{"type":"text","text":" 跳轉到定義,這個沒啥好說的,跳轉到函數或符號的定義,這是高頻操作。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"codeinline","content":[{"type":"text","text":"Alt + F12","attrs":{}}],"attrs":{}},{"type":"text","text":" 以預覽方式在當前頁面顯示定義,都是查看定義,相對 ","attrs":{}},{"type":"codeinline","content":[{"type":"text","text":"F12","attrs":{}}],"attrs":{}},{"type":"text","text":" 的優點是不會跳出當前文件到定義文件,而是在當前文件打開一個小窗口預覽,如下圖:","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/47/4799ba21b193c81404d4957453f12672.png","alt":null,"title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"codeinline","content":[{"type":"text","text":"Shift + F12","attrs":{}}],"attrs":{}},{"type":"text","text":" 查看光標所在函數或變量的引用,就像 ","attrs":{}},{"type":"codeinline","content":[{"type":"text","text":"Alt +F12","attrs":{}}],"attrs":{}},{"type":"text","text":" 一樣以預覽方式在當前文件打開引用的文件列表。如下圖:","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/a1/a1d7acb4f2ae8af1aeae51ecca337526.png","alt":null,"title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"codeinline","content":[{"type":"text","text":"Alt + 左/右箭頭","attrs":{}}],"attrs":{}},{"type":"text","text":" 前進或者後退到光標所在源碼的上一個位置。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"codeinline","content":[{"type":"text","text":"Ctrl + Shift + O","attrs":{}}],"attrs":{}},{"type":"text","text":" 查看當前文件的符號,可以用關鍵字過濾符號,當然你也可以在左側的大綱視圖中查找符號,不過大綱視圖不能查找匹配符號,所以我更習慣用快捷鍵方式查找符號。","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/e6/e68dddb581d90634b336715491be0158.png","alt":null,"title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"符號和函數查找","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"快捷鍵講完了嗎?沒有,太多快捷鍵了;其他的快捷鍵不重要嗎?因人而異吧,高頻使用的快捷鍵就是重要的,而上面我說的這幾個是超高頻使用,記住這幾個差不多就行了,剩下快捷鍵你如果用的多了自然就記住了,","attrs":{}},{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"但是我上面說的這幾個快捷鍵請務必先記在腦子裏,這會大大降低你的使用成本,儘早享受 VsCode Coding 的樂趣","attrs":{}},{"type":"text","text":"!","attrs":{}}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"最後說幾句","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"想起我上大學的時候,大一學習C語言課必須安裝VC++ 6.0纔行,那時候也有 Visual studio 這樣的 IDE,不過老師沒推薦其他 IDE,都是憑藉自己對編程的興趣發現了更多比VC++ 6.0 更加 '現代化' 的 IDE,比如Jetbrain 系列和Visual studio系列,愛不釋手各種嘗試。","attrs":{}}]},{"type":"image","attrs":{"src":"https://static001.geekbang.org/infoq/e1/e14ea9ab8977d7842a17ebb08c42938e.png","alt":null,"title":null,"style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":null,"fromPaste":true,"pastePass":true}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"現在主流的 IDE 已經非常豐富,其實編輯器或者 IDE 只是一個工具,沒有最好自己用的順手就行,就像 Vim 黨和 Emacs 黨誰也說服不了誰一樣,自己喜歡就好。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"大家更應該關注編程這件事本身,提高自身硬實力纔是最緊要的,不過好的工具能讓你事半功倍","attrs":{}},{"type":"text","text":",這點我也是完全贊成的,希望這篇文章也能夠讓你事半功倍。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"強吧。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"老規矩,感謝各位的閱讀,文章的目的是分享對知識的理解,技術類文章我都會反覆求證以求最大程度保證準確性,若文中出現明顯紕漏也歡迎指出,我們一起在探討中學習。今天的技術分享就到這裏,我們下期再見。","attrs":{}}]},{"type":"horizontalrule","attrs":{}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Hi,我是堂主檸檬,一線互聯網大廠後端程序員一枚,個人技術gzh主要分享後端開發相關的技術學習,每篇文章都是我精心創作,如果文章對你有幫助,這次一定不要白piao,","attrs":{}},{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"點贊 ","attrs":{}},{"type":"text","text":"或 ","attrs":{}},{"type":"text","marks":[{"type":"strong","attrs":{}}],"text":"分享","attrs":{}},{"type":"text","text":" 給需要的朋友,這對檸檬很重要,在此先謝過各位大佬了!我是檸檬,我們下期再見。","attrs":{}}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"微信搜索公衆號「 後端技術學堂 」回覆「1024」獲取 50 本計算機電子書,回覆「學習路線」獲取超詳細後端技術學習路線思維導圖,文章每週持續更新,我們下期見!","attrs":{}}]}],"attrs":{}}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章