Hammerspoon plugin to paste syntax highlighted code into Google Docs
MIT License
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.
hotkey
you'll bind in the Installation section.Pre-requisite: Ensure you have Hammerspoon installed.
Clone the repo:
mkdir -p ~/.hammerspoon/Spoons
git clone [email protected]: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)
Please open issues on the repo to quickly discuss any ideas you have, then create a PR and send it to dbalatero.