Skip to content

Instantly share code, notes, and snippets.

View theol0403's full-sized avatar
💻

Theo Lemay theol0403

💻
View GitHub Profile
@kylechui
kylechui / dot-repeating.md
Last active April 8, 2024 08:20
A basic overview of how to manage dot-repeating in your Neovim plugin, as well as manipulate it to "force" what action is repeated.

Adding dot-repeat to your Neovim plugin

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.

The Basics

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

Using operatorfunc

@rufoa
rufoa / patch.sh
Last active February 2, 2024 06:41
sublime merge 2 build 2068 linux
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
target="${1:-/opt/sublime_merge/sublime_merge}"
check_sha() {
local sha_valid
@anhedonix
anhedonix / doom.md
Last active January 5, 2024 04:32 — forked from hjertnes/doom.txt
Doom Emacs Cheatsheet

Doom Emacs Default keybindings cheetsheet

SPC

  • SPC find file
  • , switch bufferA
  • . browse files
  • : MX
  • ; EX
  • &lt; switch buffer
@Jerrylum
Jerrylum / initialize.cpp
Last active June 12, 2019 19:52
PROS, auton selector with LLEMU
//
// Copyright (c) 2018 by CMASS Robotics team. All Rights Reserved.
//
#include "main.h"
#include <string>
#include <cstdarg>
#include <memory>
short _auto_selected_id = 1;
anonymous
anonymous / gmailAutoarchive.js
Created January 8, 2017 16:39
function gmailAutoarchive() {
var delayDays = 2; // will only impact emails more than 48h old
var maxDate = new Date();
maxDate.setDate(maxDate.getDate()-delayDays); // what was the date at that time?
// Get all the threads labelled 'autoarchive'
var label = GmailApp.getUserLabelByName("autoarchive");
var threads = label.getThreads(0, 400);