Skip to content

Instantly share code, notes, and snippets.

@romainl
romainl / grep.md
Last active April 28, 2024 19:53
Instant grep + quickfix

FOREWORDS

I don't mean the snippet at the bottom of this gist to be a generic plug-n-play solution to your search needs. It is very likely to not work for you or even break things, and it certainly is not as extensively tested and genericised as your regular third-party plugin.

My goal, here and in most of my posts, is to show how Vim's features can be leveraged to build your own high-level, low-maintenance, workflows without systematically jumping on the plugins bandwagon or twisting Vim's arm.


Instant grep + quickfix

@atav32
atav32 / convert_itermcolors.py
Last active February 18, 2024 01:38 — forked from MSylvia/convert_itermcolors.py
Convert .itermcolors file to html hex & rgb
#!/usr/bin/env python
#
# Convert .itermcolors files to hex colors for html
import sys
import xml.etree.ElementTree as ET
def rgb_to_hex(rgb):
return '#%02x%02x%02x' % rgb
@romainl
romainl / colorscheme-override.md
Last active April 27, 2024 15:36
The right way to override any highlighting if you don't want to edit the colorscheme file directly

The right way to override any highlighting if you don't want to edit the colorscheme file directly

Generalities first

Suppose you have weird taste and you absolutely want:

  • your visual selection to always have a green background and black foreground,
  • your active statusline to always have a white background and red foreground,
  • your very own deep blue background.
@enzinier
enzinier / avd.desktop
Last active July 14, 2022 15:05
Create shortcut for running android virtual device in Ubuntu launcher.
[Desktop Entry]
Version=1.0
Name=AVD
Comment=AVD
Exec=bash -c "DEVICES=$(/home/jason/Android/Sdk/tools/emulator -list-avds 2>&1) && /home/jason/Android/Sdk/tools/emulator @${DEVICES[0]}"
Icon=/home/jason/Android/Sdk/platforms/android-23/templates/ic_launcher_xhdpi.png
Terminal=false
Type=Application
Categories=Utility;Application;
@RainmanNoodles
RainmanNoodles / hs-fuzzy-window-picker.lua
Last active June 8, 2023 15:49
Hammerspoon Fuzzy Window Switcher
-- Fuzzy Window Switcher
_fuzzyChoices = nil
_fuzzyChooser = nil
_fuzzyLastWindow = nil
function fuzzyQuery(s, m)
s_index = 1
m_index = 1
match_start = nil
@ctechols
ctechols / compinit.zsh
Last active April 19, 2024 23:44
Speed up zsh compinit by only checking cache once a day.
# On slow systems, checking the cached .zcompdump file to see if it must be
# regenerated adds a noticable delay to zsh startup. This little hack restricts
# it to once a day. It should be pasted into your own completion file.
#
# The globbing is a little complicated here:
# - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct.
# - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error)
# - '.' matches "regular files"
# - 'mh+24' matches files (or directories or whatever) that are older than 24 hours.
autoload -Uz compinit
@felHR85
felHR85 / SoftKeyboard.java
Last active February 17, 2024 23:11
A solution to catch show/hide soft keyboard events in Android http://felhr85.net/2014/05/04/catch-soft-keyboard-showhidden-events-in-android/
/*
* Author: Felipe Herranz (felhr85@gmail.com)
* Contributors:Francesco Verheye (verheye.francesco@gmail.com)
* Israel Dominguez (dominguez.israel@gmail.com)
*/
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicBoolean;
import android.os.Handler;