Skip to content

Instantly share code, notes, and snippets.

View Matt-Deacalion's full-sized avatar
🏹
Ready, Fire, Aim!

Matt Matt-Deacalion

🏹
Ready, Fire, Aim!
  • Budapest, Hungary
View GitHub Profile

Simple Templates In Vim

Vim has :h skeleton help topic for when you want to read a skeleton (template) file into a new file.

For me the idea of automatic templates is not that appealing, instead I would rather insert a template when I need it:

:r ~/.vim/asciidoctor/template_for_entity_relation_diagram

@christianparpart
christianparpart / terminal-synchronized-output.md
Last active April 29, 2025 08:25
Terminal Spec: Synchronized Output

Synchronized Output

Synchronized output is merely implementing the feature as inspired by iTerm2 synchronized output, except that it's not using the rare DCS but rather the well known SM ? and RM ?. iTerm2 has now also adopted to use the new syntax instead of using DCS.

Semantics

When rendering the screen of the terminal, the Emulator usually iterates through each visible grid cell and renders its current state. With applications updating the screen a at higher frequency this can cause tearing.

This mode attempts to mitigate that.

Shell pipes & redirects

Summary, syntax, examples.

@hahdookin
hahdookin / script.vim
Created March 31, 2022 05:50
Example vim9script with jobs
" vim9script that uses jobs to find a word's defintions
" and post them to the quickfix list
" Last Change: 2022 Mar 31
" Maintainer: Christopher Pane <[email protected]>
vim9script
const api = "https://api.dictionaryapi.dev/api/v2/entries/en/"
def OnResponse(ch: channel, msg: string)
const json = json_decode(msg)
@tjdevries
tjdevries / cfilter.lua
Created September 29, 2022 03:12
cfilter.vim -> cfilter.lua
-- vim9script
-- # cfilter.vim: Plugin to filter entries from a quickfix/location list
-- # Last Change: Jun 30, 2022
-- # Maintainer: Yegappan Lakshmanan (yegappan AT yahoo DOT com)
-- # Version: 2.0
-- #
-- # Commands to filter the quickfix list:
-- # :Cfilter[!] /{pat}/
-- # Create a new quickfix list from entries matching {pat} in the current
-- # quickfix list. Both the file name and the text of the entries are
@dustinknopoff
dustinknopoff / migrateToTaxonomies.ts
Last active October 12, 2024 10:05
This is written expecting to be in the top level directory of a Zola project and can be run `deno run --allow-read=. --allow-write=. migrateToTaxonomies.ts`
import {
extract,
test as containsFrontmatter,
} from "https://deno.land/[email protected]/encoding/front_matter/any.ts";
import { walk } from "https://deno.land/[email protected]/fs/mod.ts";
import { stringify } from "npm:[email protected]"
async function writeFile(path: string, attrs: { [key: string]: any }, body: string) {
await Deno.writeTextFile(path, `---\n${stringify(attrs)}\n---\n\n${body}`)
}
@kevinlekiller
kevinlekiller / sofalizer.lua
Last active February 13, 2025 18:19
Lua script for mpv to enable sofalizer, with sofa file inside of mpv's ~~/
--[[
Copyright (C) 2023 kevincs
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
@romainl
romainl / vanilla-surround.md
Last active March 16, 2025 10:41
Poor man's Surround

Poor man's Surround

The following shows how to replicate some of Surround's features if you don't happen to have it installed.

NOTE: We only dealt with the simplest cases, here, and the convoluted nature of some of these commands shows how well designed and useful that plugin is. And let's not talk about all the corner cases it handles.

Install it, it's worth it.

The list

@skrymets
skrymets / Cornell's Notes Template.md
Last active February 23, 2025 13:03
Cornell Note Template for Obsidian
cssclass
cornell-note
Cues

Notes

The Cornell Note-taking System is a popular and effective method for organizing and summarizing information during lectures, readings, or any other form of learning.

@tombowditch
tombowditch / tunneling.md
Last active September 3, 2024 06:32 — forked from itslukej/tunneling.md
Tunneling a whole process through wireguard

Tunneling a whole process through wireguard

Certain company blocking a certain hosting provider? No problem, just tunnel the process through a small VPS with wireguard.

Consider server A your blocked server and server B your VPS.

Step 1: Generate a keypair on server A and server B

Server A: