在前端開發中,有一個非常好用的工具,Visual Studio Code,簡稱VS code。都不用我安利VS code,大家就會乖乖的去用,無數個大言不慚的攻城獅,都被VS code比德芙還絲滑的強大功能所折服。
現在使用Vscode編碼的人越來越多,憑借著免費,開源,輕量,跨平臺的特點收貨了一大批忠實粉絲 最近因項目需要開始使用Vscode,因此做了一番研究,現在把個人的一些小經驗分享給大家,首先我們來看看setings.json配置
{"window.zoomLevel": 1,"vetur.format.defaultFormatter.html": "js-beautify-html","editor.quickSuggestions": {"strings": true},"fileheader.customMade": { //此為頭部注釋"Description": "","Autor": "wangDuJuan","Date": "Do not edit"http:// "LastEditors": "liujun",// "LastEditTime": "Do not edit"},"fileheader.cursorMode": { //此為函數注釋"description": "","param": "","return": "","author": "wangDuJuan"},// 保存時自動格式化"eslint.autoFixOnSave": true,// 用來配置作用的文件類型"eslint.validate": ["javascript","javascriptreact",{"language": "html","autoFix": true},{"language": "vue","autoFix": true}],"beautify.config": {"indent_size": 4, //縮進大小,默認4"indent_char": " ", //縮進字符,默認" ""css": {"indent_size": 2},"eol": "n", //end of line,行結尾字符"n""indent_level": 0, //初始縮進級別"indent_with_tabs": false, //使用tab縮進,將會覆蓋“indent_size”和“indent_char”設置,默認false"preserve_newlines": true, //保留空行,默認“true”"max_preserve_newlines": 10, //一次最多保留多少行的空行,默認10"jslint_happy": false, //開啟jslint-stricter的嚴格模式(強制開啟“space_after_anon_function”選項),默認false"space_after_anon_function": false, //在匿名函數前自動加一個空格,比如function (){},默認false"brace_style": "collapse,preserve-inline", //括號風格,"collapse-preserve-inline", "collapse", "expand", "end-expand", or "none" ,默認“collapse”"keep_array_indentation": false, //保持數組縮進,默認false"keep_function_indentation": false, //保持函數縮進,默認false"space_before_conditional": true, //在條件語句之前保留一個空格,默認true"break_chained_methods": false, //中斷多行間的鏈式方法調用,默認true"eval_code": false,"unescape_strings": false, //解碼用xNN編碼的可打印字符,默認false"wrap_line_length": 0, //Wrap lines at next opportunity after N characters. (Set zero to ignore wrapping),默認0,下次在n個字符后換行"wrap_attributes": "auto", //將html屬性標簽放在新行“auto”,“force”,默認auto"wrap_attributes_indent_size": 4, //html屬性標簽新行縮進字符數,默認為"indent_size"4"end_with_newline": false //在文件結尾保證有換行,默認false},"beautify.language": {"js": {"type": ["javascript","json","typescript"],"filename": [".jshintrc",".jsbeautify"]},"css": ["css","scss","sass"],"html": ["htm","html","vue"]},"[scss]": {},"[typescript]": {},"workbench.iconTheme": "vscode-icons","editor.suggestSelection": "first","vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue","editor.codeActionsOnSave": {"source.fixAll.eslint": true},"[vue]": {"editor.defaultFormatter": "HookyQR.beautify"}}
新聞熱點
疑難解答