{"id":3721,"date":"2016-01-30T15:43:57","date_gmt":"2016-01-30T07:43:57","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/heaths\/2016\/01\/30\/insert-guids-directly-into-visual-studio-code\/"},"modified":"2019-02-17T15:29:22","modified_gmt":"2019-02-17T22:29:22","slug":"insert-guids-directly-into-visual-studio-code","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/setup\/insert-guids-directly-into-visual-studio-code\/","title":{"rendered":"Insert GUIDs directly into Visual Studio Code"},"content":{"rendered":"<p>Let me preface this by stating I love <a href=\"http:\/\/code.visualstudio.com\">Visual Studio Code<\/a>! While I think its big, older brother <a href=\"http:\/\/www.visualstudio.com\">Visual Studio<\/a> is great for large solutions or even small projects where project files are managed automatically by the IDE, Code work great for small, loose projects and is very fast. I still use <a href=\"http:\/\/www.vim.org\">Vim<\/a> for a lot of quick edits in a console (I spend a lot of time in powershell.exe even when using Visual Studio for development) but Code has quickly been filling that niche for source code in various languages.<\/p>\n<p>But when frequently having to author GUIDs for something-or-other, my routine of generating GUIDs in different formats, copying, and pasting them into source is burdensome. After seeing many of the cool first- and third-party extensions available for Code and how concise the <a href=\"https:\/\/code.visualstudio.com\/docs\/extensionAPI\/overview\">API<\/a> is, I wrote <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=heaths.vscode-guid\">my own extension<\/a> to actually insert GUIDs into the current document.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/setup\/wp-content\/uploads\/sites\/13\/2016\/01\/l2JI7IDkCA2ZzPoSk-1862.gif\" alt=\"\" \/><\/p>\n<p>It was also a fun opportunity to delve deeper into managing modules through NPM and working with TypeScript.<\/p>\n<p>Installing the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=heaths.vscode-guid\">extension<\/a> is easy:<\/p>\n<ol>\n<li>Open the command palette: <strong>Ctrl+Shift+P<\/strong> or <strong>Cmd+Shift+P<\/strong> on Mac<\/li>\n<li>Type: Install Extension<\/li>\n<li>Type: Insert GUID<\/li>\n<li>Press <strong>Enter<\/strong> or click the download button to install<\/li>\n<\/ol>\n<p>And with a recent update, using it is even easier:<\/p>\n<ol>\n<li>Type: <strong>Ctrl+Shift+[<\/strong> which actually equates to <strong>Ctrl+{<\/strong> or <strong>Cmd+{<\/strong> on Mac<\/li>\n<li>Press the number corresponding to the format you want<\/li>\n<li>Press <strong>Enter<\/strong><\/li>\n<\/ol>\n<p>Multi-line formats will put the cursor on the next line while single-line formats \u2013 like those you might put in XML attributes \u2013 do not. This felt like a reasonable improvement over the separate Create GUID utility that ships with VS, as was inserting directly into the document instead of copying to the clipboard.<\/p>\n<p>Feel free to check out the <a href=\"https:\/\/github.com\/heaths\/vscode-guid.git\">source<\/a> and leave <a href=\"https:\/\/github.com\/heaths\/vscode-guid\/issues\">feedback<\/a> for improvements.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let me preface this by stating I love Visual Studio Code! While I think its big, older brother Visual Studio is great for large solutions or even small projects where project files are managed automatically by the IDE, Code work great for small, loose projects and is very fast. I still use Vim for a [&hellip;]<\/p>\n","protected":false},"author":389,"featured_media":3843,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[14,29,58],"class_list":["post-3721","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-development","tag-personal","tag-vscode"],"acf":[],"blog_post_summary":"<p>Let me preface this by stating I love Visual Studio Code! While I think its big, older brother Visual Studio is great for large solutions or even small projects where project files are managed automatically by the IDE, Code work great for small, loose projects and is very fast. I still use Vim for a [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts\/3721","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/users\/389"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/comments?post=3721"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/posts\/3721\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/media\/3843"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/media?parent=3721"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/categories?post=3721"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/setup\/wp-json\/wp\/v2\/tags?post=3721"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}