This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Redirect to Mastodon home instance | |
// @namespace Violentmonkey Scripts | |
// @match https://*/@*/* | |
// @version 1.0 | |
// @author pseudometa | |
// @description 2024-11-22 | |
// @icon https://mastodon.social/packs/media/icons/favicon-48x48-c1197e9664ee6476d2715a1c4293bf61.png | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---@param types string[] Will return the first node that matches one of these types | |
---@param node TSNode|nil | |
---@return TSNode|nil | |
local function find_node_ancestor(types, node) | |
if not node then | |
return nil | |
end | |
if vim.tbl_contains(types, node:type()) then | |
return node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name GitHub: remove `?tab=readme-ov-file` from URL | |
// @description GitHub: remove `?tab=readme-ov-file` from URL | |
// @namespace https://gist.github.com/vogler | |
// @downloadURL https://gist.github.com/vogler/74edff6de37c3a13eeff8c99c6bed910/raw/clean-url-readme-tab.github.com.tamper.js | |
// @version 0.1 | |
// @author Ralf Vogler | |
// @match https://github.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com | |
// @grant none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const execSync = require('child_process').execSync; | |
const spawnSync = require('child_process').spawnSync; | |
async function compile(input, context) { | |
// This is undocumented and could break. | |
let basePath = context.app.vault.adapter.basePath; | |
if (!basePath.endsWith("/")) { | |
basePath = basePath + "/"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# macOS | |
cd "path/to/your/vault" | |
awk 'FNR <= 1 && /^---$/{print FILENAME}' **/*.md | | |
xargs -I {} sed -i '' -E '1,/^---$/ s/(\[\[.*]])/"\1"/g' "{}" | |
# Linux (or macOS users with GNU sed) | |
cd "path/to/your/vault" | |
awk 'FNR <= 1 && /^---$/{print FILENAME}' **/*.md | | |
xargs -I {} sed -i -E '1,/^---$/ s/(\[\[.*]])/"\1"/g' "{}" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
/* [...] redacted customizations [...] */ | |
--file-margins: var(--size-4-5); | |
} | |
.cm-vimCursorLayer { | |
animation: none !important; | |
} |
In Neovim, the .
character repeats "the most recent action"; however, this is not always respected by plugin actions. Here we will explore how to build dot-repeat support directly into your plugin, bypassing the requirement of dependencies like repeat.vim.
When some buffer-modifying action is performed, Neovim implicitly remembers the operator (e.g. d
), motion (e.g. iw
), and some other miscellaneous information. When the dot-repeat command is called, Neovim repeats that operator-motion combination. For example, if we type ci"text<Esc>
, then we replace the inner contents of some double quotes with text
, i.e. "hello world"
→ "text"
. Dot-repeating from here will do the same, i.e. "more samples"
→ "text"
.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%* | |
//OPTIONS: TOP / BOTTOM | |
const whereToWrite = "TOP"; | |
//OPTIONS: COPY / MOVE | |
const copyOrMove = "COPY"; | |
//Find leaf next door | |
const thisLeaf = app.workspace.activeLeaf; | |
const thisFile = thisLeaf.view.file; | |
let leafToUse = app.workspace.getAdjacentLeafInDirection(thisLeaf, "right"); | |
if(!leafToUse){leafToUse = app.workspace.getAdjacentLeafInDirection(thisLeaf, "left");} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* RAINBOW INDENT COLORS */ | |
:root { | |
/* default */ | |
--font-use-default: var(--default-font); | |
--font-size-use-default: var(--editor-font-size); | |
--indent-use-default: 1.8ch; | |
/* ------- */ | |
/* theme */ | |
--font-use-theme: inherit; |
NewerOlder