{"id":120,"date":"2025-05-25T18:52:26","date_gmt":"2025-05-25T18:52:26","guid":{"rendered":"https:\/\/davidshobbies.com\/?p=120"},"modified":"2025-05-25T18:52:30","modified_gmt":"2025-05-25T18:52:30","slug":"how-to-set-up-and-use-github-copilot-in-vim","status":"publish","type":"post","link":"https:\/\/davidshobbies.com\/?p=120","title":{"rendered":"How to Set Up and Use GitHub Copilot in Vim"},"content":{"rendered":"\n<p class=\"\">AI assistants are all the rage these days.  At my previous place of employment we used Copilot and VSCode quite a bit.  At the moment I&#8217;m looking for a new role and taking advantage of the additional free time to sharpen old skills and build some new ones.<\/p>\n\n\n\n<p class=\"\">I first encountered vi when I was messing around with Slackware back in the mid 90s.  It took some getting used to at first, but I&#8217;ve always found it to be a little bit more of a comfortable place for me.  While looking for new plugins to try, I came across the <a href=\"https:\/\/github.com\/github\/copilot.vim\">Neovim plugin for Copilot<\/a> and decided to give it a go.<\/p>\n\n\n\n<p class=\"\">I installed it using <a href=\"https:\/\/github.com\/junegunn\/vim-plug\">vim-plug<\/a> and things seemed to go well out of the gate.  I fired up a fresh copy of vim and encountered this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"361\" height=\"65\" src=\"https:\/\/i0.wp.com\/davidshobbies.com\/wp-content\/uploads\/2025\/05\/image.png?fit=361%2C65&amp;ssl=1\" alt=\"\" class=\"wp-image-122\" srcset=\"https:\/\/i0.wp.com\/davidshobbies.com\/wp-content\/uploads\/2025\/05\/image.png?w=361&amp;ssl=1 361w, https:\/\/i0.wp.com\/davidshobbies.com\/wp-content\/uploads\/2025\/05\/image.png?resize=300%2C54&amp;ssl=1 300w\" sizes=\"auto, (max-width: 361px) 100vw, 361px\" \/><\/figure>\n\n\n\n<p class=\"\">I&#8217;m not  a node guy and just installed the version that Xubuntu came with, so it isn&#8217;t surprising that it&#8217;s out of date.  After setting up the Node PPA and installing Node 22, the error cleared.  I entered teh command <code>:Copilot setup<\/code> and was quickly given a one time password to authenticate the plugin with Github.  I don&#8217;t see how it could&#8217;ve been any easier.<\/p>\n\n\n\n<p class=\"\">After installing it, I decided to give some standard &#8220;learn to code in this language&#8221; stuff a try with Python.  <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"392\" height=\"198\" src=\"https:\/\/i0.wp.com\/davidshobbies.com\/wp-content\/uploads\/2025\/05\/image-1.png?fit=392%2C198&amp;ssl=1\" alt=\"\" class=\"wp-image-125\" srcset=\"https:\/\/i0.wp.com\/davidshobbies.com\/wp-content\/uploads\/2025\/05\/image-1.png?w=392&amp;ssl=1 392w, https:\/\/i0.wp.com\/davidshobbies.com\/wp-content\/uploads\/2025\/05\/image-1.png?resize=300%2C152&amp;ssl=1 300w\" sizes=\"auto, (max-width: 392px) 100vw, 392px\" \/><\/figure>\n\n\n\n<p class=\"\">Just as in VSCode, all I needed to do was make it clear that Python and started a function definition.  The AI  took care of the rest.  So far, so good.<\/p>\n\n\n\n<p class=\"\">For something a bit more exciting I thought it&#8217;d be neat to try having it make a simple database schema for a hypothetical RBAC system.  After telling it to create tables called &#8220;users&#8221; and &#8220;roles&#8221;, it just took care of the rest via tab completion:<\/p>\n\n\n\n<p class=\"\"><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"555\" height=\"539\" src=\"https:\/\/i0.wp.com\/davidshobbies.com\/wp-content\/uploads\/2025\/05\/image-2.png?fit=555%2C539&amp;ssl=1\" alt=\"\" class=\"wp-image-126\" srcset=\"https:\/\/i0.wp.com\/davidshobbies.com\/wp-content\/uploads\/2025\/05\/image-2.png?w=555&amp;ssl=1 555w, https:\/\/i0.wp.com\/davidshobbies.com\/wp-content\/uploads\/2025\/05\/image-2.png?resize=300%2C291&amp;ssl=1 300w\" sizes=\"auto, (max-width: 555px) 100vw, 555px\" \/><\/figure>\n\n\n\n<p class=\"\">Generally speaking it looks pretty decent.  I don&#8217;t see any foreign key enforcement set up here (which is absolutely necessary for this kind of thing), but for a bunch of autocomplete stuff it&#8217;s not too bad.  I imagine that with enough involvement in the code base (assuming it actually existed) things like that would start being taken care of automatically.<\/p>\n\n\n\n<p class=\"\">Terraform has been my bread and butter for the last few years, so it seemed like a good thing to test out.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"424\" height=\"974\" src=\"https:\/\/i0.wp.com\/davidshobbies.com\/wp-content\/uploads\/2025\/05\/image-3.png?fit=424%2C974&amp;ssl=1\" alt=\"\" class=\"wp-image-129\" srcset=\"https:\/\/i0.wp.com\/davidshobbies.com\/wp-content\/uploads\/2025\/05\/image-3.png?w=424&amp;ssl=1 424w, https:\/\/i0.wp.com\/davidshobbies.com\/wp-content\/uploads\/2025\/05\/image-3.png?resize=131%2C300&amp;ssl=1 131w\" sizes=\"auto, (max-width: 424px) 100vw, 424px\" \/><\/figure>\n\n\n\n<p class=\"\">Again, with very little input it was able to get the basics you&#8217;d need to get a VPC and some basic networking set up.  Not bad at all.<\/p>\n\n\n\n<p class=\"\">It&#8217;s great that Vim&#8217;s plugin architecture brings cutting-edge features to the editor we know and love. Life in the terminal is quieter and more focused, and it&#8217;s nice that users there can still access the latest tools.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>AI assistants are all the rage these days. At my previous place of employment we used Copilot and VSCode quite a bit. At the moment<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-120","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"aioseo_notices":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Set Up and Use GitHub Copilot in Vim - David&#039;s Hobbies<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/davidshobbies.com\/?p=120\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Set Up and Use GitHub Copilot in Vim - David&#039;s Hobbies\" \/>\n<meta property=\"og:description\" content=\"AI assistants are all the rage these days. At my previous place of employment we used Copilot and VSCode quite a bit. At the moment\" \/>\n<meta property=\"og:url\" content=\"https:\/\/davidshobbies.com\/?p=120\" \/>\n<meta property=\"og:site_name\" content=\"David&#039;s Hobbies\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-25T18:52:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-25T18:52:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/davidshobbies.com\/wp-content\/uploads\/2025\/05\/image.png?fit=361%2C65&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"361\" \/>\n\t<meta property=\"og:image:height\" content=\"65\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"David\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"David\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/davidshobbies.com\\\/?p=120#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/davidshobbies.com\\\/?p=120\"},\"author\":{\"name\":\"David\",\"@id\":\"https:\\\/\\\/davidshobbies.com\\\/#\\\/schema\\\/person\\\/178ffd56b9731c5da84318cafedb52f7\"},\"headline\":\"How to Set Up and Use GitHub Copilot in Vim\",\"datePublished\":\"2025-05-25T18:52:26+00:00\",\"dateModified\":\"2025-05-25T18:52:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/davidshobbies.com\\\/?p=120\"},\"wordCount\":466,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/davidshobbies.com\\\/?p=120#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/davidshobbies.com\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/image.png?fit=361%2C65&amp;ssl=1\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/davidshobbies.com\\\/?p=120#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/davidshobbies.com\\\/?p=120\",\"url\":\"https:\\\/\\\/davidshobbies.com\\\/?p=120\",\"name\":\"How to Set Up and Use GitHub Copilot in Vim - David&#039;s Hobbies\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/davidshobbies.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/davidshobbies.com\\\/?p=120#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/davidshobbies.com\\\/?p=120#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/i0.wp.com\\\/davidshobbies.com\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/image.png?fit=361%2C65&amp;ssl=1\",\"datePublished\":\"2025-05-25T18:52:26+00:00\",\"dateModified\":\"2025-05-25T18:52:30+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/davidshobbies.com\\\/#\\\/schema\\\/person\\\/178ffd56b9731c5da84318cafedb52f7\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/davidshobbies.com\\\/?p=120#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/davidshobbies.com\\\/?p=120\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/davidshobbies.com\\\/?p=120#primaryimage\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/davidshobbies.com\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/image.png?fit=361%2C65&amp;ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/davidshobbies.com\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/image.png?fit=361%2C65&amp;ssl=1\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/davidshobbies.com\\\/?p=120#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/davidshobbies.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Set Up and Use GitHub Copilot in Vim\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/davidshobbies.com\\\/#website\",\"url\":\"https:\\\/\\\/davidshobbies.com\\\/\",\"name\":\"David&#039;s Hobbies\",\"description\":\"Nerdy stuff, for both work and play\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/davidshobbies.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/davidshobbies.com\\\/#\\\/schema\\\/person\\\/178ffd56b9731c5da84318cafedb52f7\",\"name\":\"David\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ff5cfc9cfbf2b5bd689c140a28b8396fbc5853b4f593d166ecaf4a588c09338d?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ff5cfc9cfbf2b5bd689c140a28b8396fbc5853b4f593d166ecaf4a588c09338d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ff5cfc9cfbf2b5bd689c140a28b8396fbc5853b4f593d166ecaf4a588c09338d?s=96&d=mm&r=g\",\"caption\":\"David\"},\"url\":\"https:\\\/\\\/davidshobbies.com\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Set Up and Use GitHub Copilot in Vim - David&#039;s Hobbies","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/davidshobbies.com\/?p=120","og_locale":"en_US","og_type":"article","og_title":"How to Set Up and Use GitHub Copilot in Vim - David&#039;s Hobbies","og_description":"AI assistants are all the rage these days. At my previous place of employment we used Copilot and VSCode quite a bit. At the moment","og_url":"https:\/\/davidshobbies.com\/?p=120","og_site_name":"David&#039;s Hobbies","article_published_time":"2025-05-25T18:52:26+00:00","article_modified_time":"2025-05-25T18:52:30+00:00","og_image":[{"width":361,"height":65,"url":"https:\/\/i0.wp.com\/davidshobbies.com\/wp-content\/uploads\/2025\/05\/image.png?fit=361%2C65&ssl=1","type":"image\/png"}],"author":"David","twitter_card":"summary_large_image","twitter_misc":{"Written by":"David","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/davidshobbies.com\/?p=120#article","isPartOf":{"@id":"https:\/\/davidshobbies.com\/?p=120"},"author":{"name":"David","@id":"https:\/\/davidshobbies.com\/#\/schema\/person\/178ffd56b9731c5da84318cafedb52f7"},"headline":"How to Set Up and Use GitHub Copilot in Vim","datePublished":"2025-05-25T18:52:26+00:00","dateModified":"2025-05-25T18:52:30+00:00","mainEntityOfPage":{"@id":"https:\/\/davidshobbies.com\/?p=120"},"wordCount":466,"commentCount":0,"image":{"@id":"https:\/\/davidshobbies.com\/?p=120#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/davidshobbies.com\/wp-content\/uploads\/2025\/05\/image.png?fit=361%2C65&amp;ssl=1","inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/davidshobbies.com\/?p=120#respond"]}]},{"@type":"WebPage","@id":"https:\/\/davidshobbies.com\/?p=120","url":"https:\/\/davidshobbies.com\/?p=120","name":"How to Set Up and Use GitHub Copilot in Vim - David&#039;s Hobbies","isPartOf":{"@id":"https:\/\/davidshobbies.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/davidshobbies.com\/?p=120#primaryimage"},"image":{"@id":"https:\/\/davidshobbies.com\/?p=120#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/davidshobbies.com\/wp-content\/uploads\/2025\/05\/image.png?fit=361%2C65&amp;ssl=1","datePublished":"2025-05-25T18:52:26+00:00","dateModified":"2025-05-25T18:52:30+00:00","author":{"@id":"https:\/\/davidshobbies.com\/#\/schema\/person\/178ffd56b9731c5da84318cafedb52f7"},"breadcrumb":{"@id":"https:\/\/davidshobbies.com\/?p=120#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/davidshobbies.com\/?p=120"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/davidshobbies.com\/?p=120#primaryimage","url":"https:\/\/i0.wp.com\/davidshobbies.com\/wp-content\/uploads\/2025\/05\/image.png?fit=361%2C65&amp;ssl=1","contentUrl":"https:\/\/i0.wp.com\/davidshobbies.com\/wp-content\/uploads\/2025\/05\/image.png?fit=361%2C65&amp;ssl=1"},{"@type":"BreadcrumbList","@id":"https:\/\/davidshobbies.com\/?p=120#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/davidshobbies.com\/"},{"@type":"ListItem","position":2,"name":"How to Set Up and Use GitHub Copilot in Vim"}]},{"@type":"WebSite","@id":"https:\/\/davidshobbies.com\/#website","url":"https:\/\/davidshobbies.com\/","name":"David&#039;s Hobbies","description":"Nerdy stuff, for both work and play","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/davidshobbies.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/davidshobbies.com\/#\/schema\/person\/178ffd56b9731c5da84318cafedb52f7","name":"David","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ff5cfc9cfbf2b5bd689c140a28b8396fbc5853b4f593d166ecaf4a588c09338d?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ff5cfc9cfbf2b5bd689c140a28b8396fbc5853b4f593d166ecaf4a588c09338d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ff5cfc9cfbf2b5bd689c140a28b8396fbc5853b4f593d166ecaf4a588c09338d?s=96&d=mm&r=g","caption":"David"},"url":"https:\/\/davidshobbies.com\/?author=1"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/davidshobbies.com\/index.php?rest_route=\/wp\/v2\/posts\/120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/davidshobbies.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/davidshobbies.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/davidshobbies.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/davidshobbies.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=120"}],"version-history":[{"count":5,"href":"https:\/\/davidshobbies.com\/index.php?rest_route=\/wp\/v2\/posts\/120\/revisions"}],"predecessor-version":[{"id":130,"href":"https:\/\/davidshobbies.com\/index.php?rest_route=\/wp\/v2\/posts\/120\/revisions\/130"}],"wp:attachment":[{"href":"https:\/\/davidshobbies.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/davidshobbies.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/davidshobbies.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}