{"id":1123,"date":"2026-08-07T23:42:09","date_gmt":"2026-08-08T06:42:09","guid":{"rendered":"https:\/\/www.sandcomp.com\/blog\/?p=1123"},"modified":"2026-08-08T18:37:09","modified_gmt":"2026-08-09T01:37:09","slug":"gdoc-vim-en","status":"publish","type":"post","link":"https:\/\/www.sandcomp.com\/blog\/en\/2026\/08\/07\/gdoc-vim-en\/","title":{"rendered":"gdoc-vim: Editing Google Docs Directly in vim"},"content":{"rendered":"\n<div class=\"wp-block-jetpack-markdown\"><p>I like vim, and I like getting things done from the command line. Google Docs is also good at what it does \u2014 sharing, comments, revision history all come for free.<\/p>\n<p>Google Docs now supports Markdown import and export natively, which makes connecting the two a natural thing to do: the document stays in Docs, the editing happens in vim. So I wrote a small tool for it, <code>gdoc-vim<\/code>.<\/p>\n<h2>Installing<\/h2>\n<pre><code class=\"language-bash\">pipx install gdoc-vim\n<\/code><\/pre>\n<h2>Usage<\/h2>\n<p>To edit an existing document, paste the URL straight from your browser\u2019s address bar:<\/p>\n<pre><code class=\"language-bash\">gdoc-vim https:\/\/docs.google.com\/document\/d\/FILE_ID\/edit\n<\/code><\/pre>\n<p>It exports the document as Markdown and opens it in vim (or whatever <code>$EDITOR<\/code> points at). When you <code>:wq<\/code>, the content is converted back and written to <strong>the same document<\/strong> \u2014 same link, same sharing settings, revision history intact.<\/p>\n<p>You can also start a new document and go straight to writing:<\/p>\n<pre><code class=\"language-bash\">gdoc-vim -n &quot;Meeting notes&quot;\n<\/code><\/pre>\n<h2>Using a different editor<\/h2>\n<p>The name says vim, but any editor works \u2014 it honors <code>$EDITOR<\/code>:<\/p>\n<pre><code class=\"language-bash\">export EDITOR=emacs\n<\/code><\/pre>\n<p>For GUI editors, add whatever flag makes them block, e.g. <code>export EDITOR=&quot;code --wait&quot;<\/code>. Otherwise the command returns immediately and the tool sees an unchanged file.<\/p>\n<h2>Google authorization<\/h2>\n<p>The first run needs Google authorization set up: you create your own OAuth client in the Google Cloud Console. It takes about three minutes, once. The tool prints step-by-step instructions in the terminal the first time you run it.<\/p>\n<p>One thing worth knowing: a new OAuth client starts in \u201cTesting\u201d status, and in that state the tokens Google issues <strong>expire after 7 days<\/strong>, so you\u2019d have to re-authorize every week. Setting the publishing status to \u201cIn production\u201d in the Console fixes it, and that step requires no verification.<\/p>\n<h2>Links<\/h2>\n<ul>\n<li>GitHub: <a href=\"https:\/\/github.com\/gmajian\/gdoc-vim\">https:\/\/github.com\/gmajian\/gdoc-vim<\/a><\/li>\n<li>PyPI: <a href=\"https:\/\/pypi.org\/project\/gdoc-vim\/\">https:\/\/pypi.org\/project\/gdoc-vim\/<\/a><\/li>\n<\/ul>\n<p>Licensed under GPL-3.0. Questions or suggestions welcome in the comments below, or as an issue on GitHub.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[46],"tags":[],"class_list":["post-1123","post","type-post","status-publish","format-standard","hentry","category-tools"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.1.1 - aioseo.com -->\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"albert\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.sandcomp.com\/blog\/en\/2026\/08\/07\/gdoc-vim-en\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.1.1\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/en\\\/2026\\\/08\\\/07\\\/gdoc-vim-en\\\/#article\",\"name\":\"gdoc-vim: Editing Google Docs Directly in vim | \\u6c99\\u8ba1\\u7b97\",\"headline\":\"gdoc-vim: Editing Google Docs Directly in vim\",\"author\":{\"@id\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/author\\\/albert\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/en\\\/2026\\\/08\\\/07\\\/gdoc-vim-en\\\/#articleImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab17b43e4c094e7017a585293aa210121eebe42627cc7f28c34eba5badda4bb5?s=96&r=g\",\"width\":96,\"height\":96,\"caption\":\"albert\"},\"datePublished\":\"2026-08-07T23:42:09-07:00\",\"dateModified\":\"2026-08-08T18:37:09-07:00\",\"inLanguage\":\"zh-CN\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/en\\\/2026\\\/08\\\/07\\\/gdoc-vim-en\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/en\\\/2026\\\/08\\\/07\\\/gdoc-vim-en\\\/#webpage\"},\"articleSection\":\"Tools, English, pll_6a76cfc270e94\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/en\\\/2026\\\/08\\\/07\\\/gdoc-vim-en\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sandcomp.com\\\/blog#listItem\",\"position\":1,\"name\":\"\\u4e3b\\u9801\",\"item\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/en\\\/category\\\/tools\\\/#listItem\",\"name\":\"Tools\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/en\\\/category\\\/tools\\\/#listItem\",\"position\":2,\"name\":\"Tools\",\"item\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/en\\\/category\\\/tools\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/en\\\/2026\\\/08\\\/07\\\/gdoc-vim-en\\\/#listItem\",\"name\":\"gdoc-vim: Editing Google Docs Directly in vim\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sandcomp.com\\\/blog#listItem\",\"name\":\"\\u4e3b\\u9801\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/en\\\/2026\\\/08\\\/07\\\/gdoc-vim-en\\\/#listItem\",\"position\":3,\"name\":\"gdoc-vim: Editing Google Docs Directly in vim\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/en\\\/category\\\/tools\\\/#listItem\",\"name\":\"Tools\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/#person\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/author\\\/albert\\\/#author\",\"url\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/author\\\/albert\\\/\",\"name\":\"albert\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/en\\\/2026\\\/08\\\/07\\\/gdoc-vim-en\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab17b43e4c094e7017a585293aa210121eebe42627cc7f28c34eba5badda4bb5?s=96&r=g\",\"width\":96,\"height\":96,\"caption\":\"albert\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/en\\\/2026\\\/08\\\/07\\\/gdoc-vim-en\\\/#webpage\",\"url\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/en\\\/2026\\\/08\\\/07\\\/gdoc-vim-en\\\/\",\"name\":\"gdoc-vim: Editing Google Docs Directly in vim | \\u6c99\\u8ba1\\u7b97\",\"inLanguage\":\"zh-CN\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/en\\\/2026\\\/08\\\/07\\\/gdoc-vim-en\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/author\\\/albert\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/author\\\/albert\\\/#author\"},\"datePublished\":\"2026-08-07T23:42:09-07:00\",\"dateModified\":\"2026-08-08T18:37:09-07:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/\",\"name\":\"\\u6c99\\u8ba1\\u7b97\",\"description\":\"\\u4e00\\u6c99\\u4e00\\u4e16\\u754c\",\"inLanguage\":\"zh-CN\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.sandcomp.com\\\/blog\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"gdoc-vim: Editing Google Docs Directly in vim | \u6c99\u8ba1\u7b97","description":"","canonical_url":"https:\/\/www.sandcomp.com\/blog\/en\/2026\/08\/07\/gdoc-vim-en\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.sandcomp.com\/blog\/en\/2026\/08\/07\/gdoc-vim-en\/#article","name":"gdoc-vim: Editing Google Docs Directly in vim | \u6c99\u8ba1\u7b97","headline":"gdoc-vim: Editing Google Docs Directly in vim","author":{"@id":"https:\/\/www.sandcomp.com\/blog\/author\/albert\/#author"},"publisher":{"@id":"https:\/\/www.sandcomp.com\/blog\/#person"},"image":{"@type":"ImageObject","@id":"https:\/\/www.sandcomp.com\/blog\/en\/2026\/08\/07\/gdoc-vim-en\/#articleImage","url":"https:\/\/secure.gravatar.com\/avatar\/ab17b43e4c094e7017a585293aa210121eebe42627cc7f28c34eba5badda4bb5?s=96&r=g","width":96,"height":96,"caption":"albert"},"datePublished":"2026-08-07T23:42:09-07:00","dateModified":"2026-08-08T18:37:09-07:00","inLanguage":"zh-CN","mainEntityOfPage":{"@id":"https:\/\/www.sandcomp.com\/blog\/en\/2026\/08\/07\/gdoc-vim-en\/#webpage"},"isPartOf":{"@id":"https:\/\/www.sandcomp.com\/blog\/en\/2026\/08\/07\/gdoc-vim-en\/#webpage"},"articleSection":"Tools, English, pll_6a76cfc270e94"},{"@type":"BreadcrumbList","@id":"https:\/\/www.sandcomp.com\/blog\/en\/2026\/08\/07\/gdoc-vim-en\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.sandcomp.com\/blog#listItem","position":1,"name":"\u4e3b\u9801","item":"https:\/\/www.sandcomp.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/www.sandcomp.com\/blog\/en\/category\/tools\/#listItem","name":"Tools"}},{"@type":"ListItem","@id":"https:\/\/www.sandcomp.com\/blog\/en\/category\/tools\/#listItem","position":2,"name":"Tools","item":"https:\/\/www.sandcomp.com\/blog\/en\/category\/tools\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.sandcomp.com\/blog\/en\/2026\/08\/07\/gdoc-vim-en\/#listItem","name":"gdoc-vim: Editing Google Docs Directly in vim"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.sandcomp.com\/blog#listItem","name":"\u4e3b\u9801"}},{"@type":"ListItem","@id":"https:\/\/www.sandcomp.com\/blog\/en\/2026\/08\/07\/gdoc-vim-en\/#listItem","position":3,"name":"gdoc-vim: Editing Google Docs Directly in vim","previousItem":{"@type":"ListItem","@id":"https:\/\/www.sandcomp.com\/blog\/en\/category\/tools\/#listItem","name":"Tools"}}]},{"@type":"Person","@id":"https:\/\/www.sandcomp.com\/blog\/#person"},{"@type":"Person","@id":"https:\/\/www.sandcomp.com\/blog\/author\/albert\/#author","url":"https:\/\/www.sandcomp.com\/blog\/author\/albert\/","name":"albert","image":{"@type":"ImageObject","@id":"https:\/\/www.sandcomp.com\/blog\/en\/2026\/08\/07\/gdoc-vim-en\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/ab17b43e4c094e7017a585293aa210121eebe42627cc7f28c34eba5badda4bb5?s=96&r=g","width":96,"height":96,"caption":"albert"}},{"@type":"WebPage","@id":"https:\/\/www.sandcomp.com\/blog\/en\/2026\/08\/07\/gdoc-vim-en\/#webpage","url":"https:\/\/www.sandcomp.com\/blog\/en\/2026\/08\/07\/gdoc-vim-en\/","name":"gdoc-vim: Editing Google Docs Directly in vim | \u6c99\u8ba1\u7b97","inLanguage":"zh-CN","isPartOf":{"@id":"https:\/\/www.sandcomp.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.sandcomp.com\/blog\/en\/2026\/08\/07\/gdoc-vim-en\/#breadcrumblist"},"author":{"@id":"https:\/\/www.sandcomp.com\/blog\/author\/albert\/#author"},"creator":{"@id":"https:\/\/www.sandcomp.com\/blog\/author\/albert\/#author"},"datePublished":"2026-08-07T23:42:09-07:00","dateModified":"2026-08-08T18:37:09-07:00"},{"@type":"WebSite","@id":"https:\/\/www.sandcomp.com\/blog\/#website","url":"https:\/\/www.sandcomp.com\/blog\/","name":"\u6c99\u8ba1\u7b97","description":"\u4e00\u6c99\u4e00\u4e16\u754c","inLanguage":"zh-CN","publisher":{"@id":"https:\/\/www.sandcomp.com\/blog\/#person"}}]}},"aioseo_meta_data":{"post_id":"1123","title":null,"description":null,"keywords":null,"keyphrases":{"focus":{"keyphrase":"","score":0,"analysis":{"keyphraseInTitle":{"score":0,"maxScore":9,"error":1}}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":{"faqs":[],"keyPoints":[],"titles":[],"descriptions":[],"socialPosts":{"email":[],"linkedin":[],"twitter":[],"facebook":[],"instagram":[]}},"created":"2026-08-08 06:40:57","updated":"2026-08-09 02:38:23","focus_keyword":null,"additional_keywords":null,"truseo_locale":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.sandcomp.com\/blog\" title=\"\u4e3b\u9801\">\u4e3b\u9801<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.sandcomp.com\/blog\/en\/category\/tools\/\" title=\"Tools\">Tools<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tgdoc-vim: Editing Google Docs Directly in vim\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"\u4e3b\u9801","link":"https:\/\/www.sandcomp.com\/blog"},{"label":"Tools","link":"https:\/\/www.sandcomp.com\/blog\/en\/category\/tools\/"},{"label":"gdoc-vim: Editing Google Docs Directly in vim","link":"https:\/\/www.sandcomp.com\/blog\/en\/2026\/08\/07\/gdoc-vim-en\/"}],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.sandcomp.com\/blog\/wp-json\/wp\/v2\/posts\/1123","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sandcomp.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sandcomp.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sandcomp.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sandcomp.com\/blog\/wp-json\/wp\/v2\/comments?post=1123"}],"version-history":[{"count":3,"href":"https:\/\/www.sandcomp.com\/blog\/wp-json\/wp\/v2\/posts\/1123\/revisions"}],"predecessor-version":[{"id":1130,"href":"https:\/\/www.sandcomp.com\/blog\/wp-json\/wp\/v2\/posts\/1123\/revisions\/1130"}],"wp:attachment":[{"href":"https:\/\/www.sandcomp.com\/blog\/wp-json\/wp\/v2\/media?parent=1123"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sandcomp.com\/blog\/wp-json\/wp\/v2\/categories?post=1123"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sandcomp.com\/blog\/wp-json\/wp\/v2\/tags?post=1123"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}