Skip to content

Instantly share code, notes, and snippets.

View ltratt's full-sized avatar

Laurence Tratt ltratt

View GitHub Profile
@ltratt
ltratt / highlight_words_in_vim.vim
Created July 21, 2020 07:58
Highlight words in Vim
" Highlight Word, initial version from:
" https://gist.github.com/emilyst/9243544#file-vimrc-L142
"
" This mini-plugin provides a few mappings for highlighting words temporarily.
"
" Sometimes you're looking at a hairy piece of code and would like a certain
" word or two to stand out temporarily. You can search for it, but that only
" gives you one color of highlighting. Now you can use <leader>N where N is
" a number from 1-6 to highlight the current word in a specific color.
"
@ltratt
ltratt / Makefile
Created March 1, 2021 20:51
Example Aeschylus Makefile
AUDIO_FMT=s16
AUDIO_RATE=44100
BACKGROUND_COLOUR=0x595959
CAMERA_RESOLUTION=1920x1080
FRAMERATE=24
MINI_CAMERA_CROP="1400:1045:330:0"
MINI_CAMERA_SCALE="570:-1"
CHROMAKEY="chromakey=3e5b0b:0.04:0.02,despill=type=green:mix=0.5:expand=0.3:brightness=0:green=-1:blue=0"
CAMERA_OVERLAY="x=W-w+0:y=H-h+1"
GOP=72
-- On the first run, this file will cause various errors as the plugins will
-- not yet be installed. Execute :PackerInstall, quit neovim, rerun and... all
-- should be good! Note that this config will download rust source if
-- $RUST_SRC_DIR isn't set and download and build rust-analyzer (if it's not
-- found in $PATH) in the background -- these two tasks can take a little
-- while, so you might find that your first few minutes of editing Rust source
-- don't work quite as expected.
local config_dir = os.getenv("HOME") .. '/.config/nvim'
@ltratt
ltratt / gist:eaa5857249c50b2ef736ff58d03e378c
Created February 20, 2025 17:54
skim-history-widget (Ctrl-R) for zsh
# CTRL-R - Paste the selected command from history into the command line
skim-history-widget() {
local selected num
setopt localoptions noglobsubst noposixbuiltins pipefail no_aliases 2> /dev/null
local awk_filter='{ cmd=$0; sub(/^\s*[0-9]+\**\s+/, "", cmd); if (!seen[cmd]++) print $0 }' # filter out duplicates
local n=1 fc_opts=''
if [[ -o extended_history ]]; then
awk_filter='
{
split($2, sp1, "-")