ST
streeter/GoogleDocsCodePaste.spoon
Hammerspoon plugin to paste syntax highlighted code into Google Docs
๐ฏ GoogleDocsCodePaste.spoon
This plugin lets you paste a code snippet from your macOS clipboard to Google Docs. The snippet will be pasted as a 2x1 table with line numbers and syntax highlighting.
Usage
- Copy a block of code into your clipboard.
- Switch to your Google Doc.
- Hit the paste
hotkeyyou'll bind in the Installation section. - Select the language from the popup chooser.
- It will paste a code block into your doc!
Installation
Pre-requisite: Ensure you have Hammerspoon installed.
Clone the repo:
mkdir -p ~/.hammerspoon/Spoons
git clone git@github.com:dbalatero/GoogleDocsCodePaste.spoon.git \
~/.hammerspoon/Spoons/GoogleDocsCodePaste.spoon
Run the install script to ensure you have all the right dependencies:
~/.hammerspoon/Spoons/GoogleDocsCodePaste.spoon/bin/install
Finally, add a snippet of code to your ~/.hammerspoon/init.lua:
local docs = require('GoogleDocsCodePaste')
-- Bind this to whatever mods + key you want:
hs.hotkey.bind({'cmd', 'ctrl', 'alt'}, 'v', docs.pasteToGoogleDocs)Contributing
Please open issues on the repo to quickly discuss any ideas you have, then create a PR and send it to dbalatero.
On this page
Languages
Lua86.4%Shell13.6%
Contributors
MIT License
Created February 18, 2022
Updated February 18, 2022
