Skip to content

Instantly share code, notes, and snippets.

@instance-id
Created March 5, 2023 00:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save instance-id/a23f1e001bbc0c8744c9cf7627db805d to your computer and use it in GitHub Desktop.
Save instance-id/a23f1e001bbc0c8744c9cf7627db805d to your computer and use it in GitHub Desktop.
Disables CodeMirror editor in Gists so you can use FireNvim
// ==UserScript==
// @name Github Gist - Hide CodeMirror for Firenvim
// @namespace Violentmonkey Scripts
// @match https://gist.github.com/*
// @run-at document-start
// @version 1.0
// @author instance.id
// @description Hide CodeMirror for Firenvim
// ==/UserScript==
// ==UserScript==
// @include https://gist.github.com/*
// ==/UserScript==
let cmParent = 'div.commit-create.position-relative'
let codeMirror = 'div div.CodeMirror.cm-s-github-light'
let textArea = 'div textarea.form-control.file-editor-textarea.js-blob-contents.js-code-textarea'
function delayedQuery() {
let q1 = document.querySelector(cmParent).querySelector(codeMirror).setAttribute("style", "display: none;")
let q2 = document.querySelector(textArea).setAttribute("style", "display: flex;")
}
setTimeout(delayedQuery, 300)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment