dbalatero / GoogleDocsCodePaste.spoon

Hammerspoon plugin to paste syntax highlighted code into Google Docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🍯 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.

image

Usage

  1. Copy a block of code into your clipboard.
  2. Switch to your Google Doc.
  3. Hit the paste hotkey you'll bind in the Installation section.
  4. Select the language from the popup chooser.
  5. 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.

About

Hammerspoon plugin to paste syntax highlighted code into Google Docs

License:MIT License


Languages

Language:Lua 84.5%Language:Shell 15.5%