Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Jeebak Kim jeebak

🏠
Working from home
View GitHub Profile
@jeebak
jeebak / visrc.lua
Last active Sep 27, 2021
Example $HOME/.config/vis/visrc.lua for the vis editor, with a simple "Plug()" (plugin manager) implementation
View visrc.lua
-- 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 Mar 25, 2022
Overload zsh / zle keybindings
View ctrl-key-zle-widgets.zsh
__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 Oct 16, 2019
Patch wofr06/lesspipe 1.83 to use bat
View lesspipe.sh-1.83.patch
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 Oct 23, 2021
A three line ZSH prompt, with emacs and vim keybindings
View zsh-prompt.zsh
# -----------------------------------------------------------------------------
# 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 Sep 5, 2019
Test Drive Vim / Emacs Distributions
View test-drive-vimacs
#!/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 Dec 28, 2017
Personalized keybindings for jasonrudolph/keyboard/hammerspoon WindowLayout Mode Raw
View windows-bindings.lua
-- 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 Aug 16, 2017 — forked from AWMooreCO/AdvancedWindowSnap.ahk
Advanced Window Snap is a script for AutoHotKey that expands upon Windows built-in window-snapping hotkeys.
View AdvancedWindowSnap.ahk
/**
* 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 <andrew+github@awmoore.com>
* @version 1.0
*/
@jeebak
jeebak / hack-mac-slack.bash
Last active Dec 15, 2019
Appends slack-night-mode CSS to a Slack .js file. For Mac only
View hack-mac-slack.bash
#!/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 May 29, 2022
My Boxstarter Script
View boxstarter.ps1
#
# 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 Oct 22, 2015
Apply the pie, on the fly
View git-pie-ify
#!/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