ÔÚLinuxÉÏʹÓÃVisual Studio Code¾ÙÐкó¶Ë¿ª·¢µÄÍƼöÉèÖÃ
ÔÚlinuxÉÏʹÓÃvisual studio code¾ÙÐкó¶Ë¿ª·¢µÄÍƼöÉèÖÃ
Ëæ×ÅÔÆÅÌËãºÍ¿ªÔ´ÊÖÒÕµÄÉú³¤£¬Linux²Ù×÷ϵͳԽÀ´Ô½Êܵ½³ÌÐòÔ±ºÍ¿ª·¢Ö°Ô±µÄϲ»¶¡£¶øÔÚLinuxÉÏ£¬Visual Studio Code£¨¼ò³ÆVS Code£©×÷Ϊһ¿îÇ¿Ê¢µÄ´úÂë±à¼Æ÷£¬Ò²Öð½¥³ÉΪ¿ª·¢ÕßµÄÊ×Ñ¡¹¤¾ßÖ®Ò»¡£±¾ÎĽ«ÏÈÈÝÔõÑùÔÚLinuxÉÏʹÓÃVS Code¾ÙÐкó¶Ë¿ª·¢£¬²¢¸ø³öһЩÍƼöµÄÉèÖá£
×°ÖÃVS Code
Ê×ÏÈ£¬ÄãÐèÒªÔÚLinuxÉÏ×°ÖÃVS Code¡£Äã¿ÉÒÔ´Ó¹Ù·½ÍøÕ¾ÉÏÏÂÔØÊÊÓÃÓÚLinuxµÄ×°Öðü£¬È»ºóƾ֤ÌáÐѾÙÐÐ×°Öá£×°ÖÃÍê³Éºó£¬Äã¾Í¿ÉÒÔÆô¶¯VS CodeÁË¡£
×°ÖÃÀ©Õ¹
VS Codeͨ¹ý¸»ºñµÄÀ©Õ¹Éú̬ϵͳ£¬ÌṩÁËÐí¶àÇ¿Ê¢µÄ¹¦Ð§ºÍ¹¤¾ß£¬Ê¹µÃºó¶Ë¿ª·¢Ô½·¢±ã½Ý¸ßЧ¡£ÏÂÃæÊÇһЩÍƼöµÄÀ©Õ¹£¬Äã¿ÉÒÔͨ¹ýÔÚVS CodeµÄÀ©Õ¹Ãæ°åÖÐËÑË÷²¢×°ÖÃËüÃÇ£º
Python£ºÈôÊÇÄãʹÓÃPython¾ÙÐкó¶Ë¿ª·¢£¬ÕâÊÇÒ»¸ö±Ø±¸À©Õ¹¡£ËüÌṩÁË´úÂ벹ȫ¡¢Óï·¨¼ì²é¡¢µ÷ÊÔÖ§³ÖµÈ¹¦Ð§¡£
Java£ºÈôÊÇÄãʹÓÃJava¾ÙÐкó¶Ë¿ª·¢£¬Äã¿ÉÒÔ×°ÖÃJavaÀ©Õ¹¡£ËüÖ§³ÖÏîÄ¿ÖÎÀí¡¢´úÂ벹ȫ¡¢µ÷ÊԵȹ¦Ð§¡£
Node.js£ºÈôÊÇÄãʹÓÃNode.js¾ÙÐкó¶Ë¿ª·¢£¬Äã¿ÉÒÔ×°ÖÃNode.jsÀ©Õ¹¡£ËüÌṩÁËÔËÐС¢µ÷ÊÔ¡¢²âÊÔµÈÏà¹Ø¹¤¾ß¡£
Docker£ºÈôÊÇÄãʹÓÃDocker¾ÙÐÐÓ¦ÓÃÈÝÆ÷»¯£¬¿ÉÒÔ×°ÖÃDockerÀ©Õ¹¡£ËüÌṩÁËÓëDockerµÄ¼¯³É£¬Àû±ãÄãÖÎÀíºÍ²Ù×÷ÈÝÆ÷¡£
Git£º×÷Ϊһ¸ö°æ±¾¿ØÖƹ¤¾ß£¬GitÀ©Õ¹ÎªÄãÌṩÁËÓëGitµÄ¼¯³É£¬Ê¹µÃ´úÂëµÄÌá½»¡¢ÀÈ¡ºÍ·ÖÖ§ÖÎÀíÔ½·¢Àû±ã¡£
ÉèÖõ÷ÊÔÆ÷
µ÷ÊÔÆ÷ÊǺó¶Ë¿ª·¢²»¿É»òȱµÄ¹¤¾ßÖ®Ò»¡£ÔÚVS CodeÖУ¬Äã¿ÉÒÔƾ֤×Ô¼ºµÄ¿ª·¢ÓïÑÔÉèÖÃÏìÓ¦µÄµ÷ÊÔÆ÷¡£ÒÔPythonΪÀý£¬Äã¿ÉÒÔ°´ÏÂF5¼ü½øÈëµ÷ÊÔģʽ£¬È»ºóÑ¡ÔñPython£¨»òÆäËûÓïÑÔ£©×÷Ϊµ÷ÊÔÇéÐΡ£½ÓÏÂÀ´£¬ÄãÐèÒªÔÚ.vscodeÎļþ¼ÐÖн¨ÉèÒ»¸ölaunch.jsonÎļþ£¬ÓÃÓÚÉèÖõ÷ÊÔÆ÷µÄÐÐΪ¡£
ÒÔPythonΪÀý£¬ÏÂÃæÊÇÒ»¸ö¼òÆÓµÄlaunch.jsonÉèÖÃʾÀý£º
{ "version": "0.2.0", "configurations": [ { "name": "Python: Debug", "type": "python", "request": "launch", "program": "${file}", "console": "integratedTerminal" } ] }
µÇ¼ºó¸´ÖÆ
ÒÔÉÏÉèÖûáÔÚ¼¯³ÉÖÕ¶ËÖÐÆô¶¯PythonÚ¹ÊÍÆ÷£¬²¢Ö´ÐÐÄ¿½ñÎļþ¡£Äã¿ÉÒÔƾ֤×Ô¼ºµÄÐèÇó¾ÙÐе÷½âºÍÀ©Õ¹¡£
ʹÓÃÖÕ¶Ë
ÔÚºó¶Ë¿ª·¢ÖУ¬ÖÕ¶ËÊDZز»¿ÉÉٵŤ¾ßÖ®Ò»¡£VS CodeÌṩÁ˼¯³ÉÖն˹¦Ð§£¬¿ÉÒÔÖ±½ÓÔÚ±à¼Æ÷ÖÐÖ´ÐÐÖÕ¶ËÏÂÁî¡£Äã¿ÉÒÔͨ¹ý°´ÏÂCtrl + `¼ü£¨·´ÒýºÅ¼ü£©·¿ªÖÕ¶ËÃæ°å£¬²¢ÔÚÆäÖÐÖ´ÐÐÏìÓ¦µÄÏÂÁî¡£¹ØÓÚLinuxϵͳÀ´Ëµ£¬Äã¿ÉÒÔʹÓÃÈκÎÄãÊìϤµÄÖÕ¶ËÏÂÁÕâʹµÃÔÚVS CodeÖоÙÐкó¶Ë¿ª·¢Ô½·¢Àû±ã¡£
ʹÓôúÂëƬ¶Ï
ΪÁËÌá¸ß¿ª·¢Ð§ÂÊ£¬VS CodeÖ§³Ö´úÂëƬ¶Ï£¨snippet£©¡£´úÂëƬ¶Ï¿ÉÒÔÊÇÒ»¶Î´úÂëµÄÄ£°å£¬Í¨¹ý¼òÆÓµÄÒªº¦´ÊÀ©Õ¹ÎªÍêÕûµÄ´úÂë¿é¡£ÔÚºó¶Ë¿ª·¢ÖУ¬ÎÒÃǾ³£ÐèÒªÊäÈëÖظ´µÄ´úÂëƬ¶Ï£¬È纯ÊýµÄ½ç˵¡¢Ä£×ÓµÄÉùÃ÷µÈ¡£Í¨¹ý½ç˵ºÍʹÓôúÂëƬ¶Ï£¬Äã¿ÉÒÔ½ÚÔ¼´ó×ÚµÄʱ¼äºÍ¾«Éñ¡£
ÒÔPythonΪÀý£¬Äã¿ÉÒÔ·¿ªVS CodeµÄÊ×Ñ¡ÏȻºóÑ¡ÔñÓû§Æ¬¶Ï£¨User Snippets£©¡£ÔÚPythonƬ¶ÏÎļþÖУ¬Äã¿ÉÒÔ½ç˵×Ô¼ºµÄ´úÂëƬ¶Ï£¬ÈçÏÂËùʾ£º
{ "Python": { "model": { "prefix": "model", "body": [ "class ${1:Model}(models.Model):", " ${2:field_name} = models.${3:CharField}(max_length=${4:255})" ], "description": "Model snippet" } } }
µÇ¼ºó¸´ÖÆ
ÒÔÉÏ´úÂë½ç˵ÁËÒ»¸öÃûΪmodelµÄ´úÂëƬ¶Ï¡£Äã¿ÉÒÔÔÚ±à¼Æ÷ÖÐÊäÈëmodel£¬È»ºó°´ÏÂTab¼üÀ©Õ¹ÎªÍêÕûµÄÄ£×Ó´úÂë¡£
×ܽá
ͨ¹ýÒÔÉÏÉèÖã¬Äã¿ÉÒÔÔÚLinuxÉÏʹÓÃVisual Studio Code¾ÙÐкó¶Ë¿ª·¢£¬²¢Ìá¸ß¿ª·¢Ð§ÂÊ¡£ËäÈ»£¬ÕâÖ»ÊÇһЩÍƼöµÄÉèÖã¬Äã¿ÉÒÔƾ֤×Ô¼ºµÄÐèÇóºÍÏ°¹ß¾ÙÐе÷½âºÍÀ©Õ¹¡£Ï£Íû±¾ÎÄÄܶÔÄãÔÚLinuxÉÏʹÓÃVS Code¾ÙÐкó¶Ë¿ª·¢ÓÐËù×ÊÖú£¡
ÒÔÉϾÍÊÇÔÚLinuxÉÏʹÓÃVisual Studio Code¾ÙÐкó¶Ë¿ª·¢µÄÍƼöÉèÖõÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡