Skip to content

Instantly share code, notes, and snippets.

View jeebak's full-sized avatar
🏠
Working from home

Jeebak Kim jeebak

🏠
Working from home
View GitHub Profile
@jeebak
jeebak / visrc.lua
Last active September 27, 2021 06:36
Example $HOME/.config/vis/visrc.lua for the vis editor, with a simple "Plug()" (plugin manager) implementation
-- load standard vis module, providing parts of the Lua API
require('vis')
function FilterRange(file, range, pos, filter)
-- Based on: http://martanne.github.io/vis/doc/#Vis:operator_new
local status, out, err = vis:pipe(file, range, filter)
if not status then
vis:info(err)
else
file:delete(range)
@jeebak
jeebak / ctrl-key-zle-widgets.zsh
Last active March 25, 2022 22:30
Overload zsh / zle keybindings
__dotmatrix::ctrl-key() {
# Run: zsh -f -c 'set -o emacs; bindkey'
# to get a list of default keybindings.
# Some keybindings, like those for cursor movements: ^a, ^e, ^f, ^b, etc. are
# meaningful when there is text on the command line. If the command line is
# empty, then these keybindings are essentially no-ops.
# Using the $CURSOR and $BUFFER zle variables, we can take advantage of this
# and assign custom behavior to these bindings when the command line is empty.
@jeebak
jeebak / lesspipe.sh-1.83.patch
Last active October 16, 2019 20:14
Patch wofr06/lesspipe 1.83 to use bat
diff --git a/lesspipe.sh b/lesspipe.sh
index dc8c594..379cc12 100755
--- a/lesspipe.sh
+++ b/lesspipe.sh
@@ -527,8 +527,8 @@ isfinal() {
lang=${3#$sep}
lang="-l ${lang#.}"
lang=${lang%%-l }
- if cmd_exist code2color; then
- code2color $PPID ${in_file:+"$in_file"} $lang "$2"
@jeebak
jeebak / zsh-prompt.zsh
Last active August 13, 2023 19:08
A three line ZSH prompt, with emacs and vim keybindings
# -----------------------------------------------------------------------------
# https://gist.github.com/jeebak/2fb31f964669892f6ef457508916bdb3
#
# A three line ZSH prompt, with emacs and vim keybindings:
# 1. At-a-glance: ┌─($USER@$HOST:$TTY─(shlvl:$SHLVL)─(jobs:0)─(exit:$?)
# 2. VCS/vim mode: │░(«git/vim mode»)↔[master↔origin↕◇◇◇]░》
# 3. [r]prompt: └─(«zsh»)% [~]
#
# NOTE: SHLVL on macOS seems to be > 1 (it is correctly 1, under Linux.) The
# quick workaround is to: export SHLVL=1 (before starting tmux, for example.)
@jeebak
jeebak / test-drive-vimacs
Last active September 5, 2019 06:37
Test Drive Vim / Emacs Distributions
#!/usr/bin/env bash
# -----------------------------------------------------------------------------
# This is a stoopid simple wrapper script to conveniently test drive different
# vim/emacs distributions w/out messing up your own vim/emacs environment.
# It accomplishes this by "installing" them in their own isolated "$HOME"
# environment (under their own "$HOME/.cache/test-drive-vimacs/$DISTRO"
# folder.) We save and export the real "$HOME" value as "$REAL_HOME" making it
# available during the editing session, in case its needed.
@jeebak
jeebak / windows-bindings.lua
Last active December 28, 2017 20:09
Personalized keybindings for jasonrudolph/keyboard/hammerspoon WindowLayout Mode Raw
-- Personalized keybindings for jasonrudolph/keyboard/hammerspoon WindowLayout Mode
--
-- To customize the key bindings for WindowLayout Mode, create a copy of this
-- file, save it as `windows-bindings.lua`, and edit the table below to
-- configure your preferred shortcuts.
--------------------------------------------------------------------------------
-- Define WindowLayout Mode
--
-- In addition to the default keybindings:
@jeebak
jeebak / AdvancedWindowSnap.ahk
Last active August 16, 2017 07:28 — forked from AWMooreCO/AdvancedWindowSnap.ahk
Advanced Window Snap is a script for AutoHotKey that expands upon Windows built-in window-snapping hotkeys.
/**
* Forked from: https://gist.github.com/AWMooreCO/1ef708055a11862ca9dc
*
* Advanced Window Snap
* Snaps the Active Window to one of nine different window positions.
*
* @author Andrew Moore <[email protected]>
* @version 1.0
*/
@jeebak
jeebak / hack-mac-slack.bash
Last active December 15, 2019 08:01
Appends slack-night-mode CSS to a Slack .js file. For Mac only
#!/usr/bin/env bash
# https://gist.github.com/DrewML/0acd2e389492e7d9d6be63386d75dd99
# https://github.com/widget-/slack-black-theme
# https://github.com/laCour/slack-night-mode/
# No longer relevant
@jeebak
jeebak / boxstarter.ps1
Last active August 18, 2022 15:10
My Boxstarter Script
#
# https://github.com/tknerr/bills-kitchen
# All you need for cooking with Chef and Vagrant on Windows you will find in Bill's Kitchen
# https://github.com/tknerr/linus-kitchen
# An Ubuntu-based developer VM for hacking with Chef, Vagrant, Docker & Co
#
# Based on: https://github.com/felixrieseberg/windows-development-environment
# Test-Admin is not available yet, so use...
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
@jeebak
jeebak / git-pie-ify
Last active October 22, 2015 02:42
Apply the pie, on the fly
#!/usr/bin/env bash
#
# https://gist.github.com/jeebak/f9088cede18d31f2d3a0
#
# Added to: https://github.com/unixorn/git-extra-commands
# Further updates will be there.
#
[[ $# -ne 2 ]] && echo "Usage: git pie-ify pattern replacement" 1>&2 && exit 1