Simplistic theme fuzzy finder using themes from iterm2colorschemes.com, jq, and fzf.
$ colorschemes -h
from xonsh.built_ins import XSH | |
$MAGIC_ENTER_GIT_COMMAND = "git status -sb ." | |
$MAGIC_ENTER_OTHER_COMMAND = "ls -lahF ." | |
$MAGIC_ENTER_RUN_COMMAND = "" | |
@events.on_transform_command | |
def magic_enter(cmd, **_): | |
"""Custom Enter key behavior: runs 'ls' if no command was given.""" | |
if not cmd.strip(): |
#!/usr/bin/env fish | |
path resolve (status --current-filename)/.. |
# 5 lines from the bottom | |
PS1=$'\n\n\n\n\n\e[5A'"$PS1" |
ALTER TABLE public.mytable | |
ADD COLUMN add_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
ADD COLUMN add_user VARCHAR(255) NOT NULL DEFAULT current_user, | |
ADD COLUMN change_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
ADD COLUMN change_user VARCHAR(255) NOT NULL DEFAULT current_user; |
create table public.dim_date | |
( | |
id integer not null | |
primary key, | |
date_value date not null | |
unique, | |
datetime_value timestamp not null, | |
calendar_year integer not null, | |
calendar_month integer not null, | |
calendar_day integer not null, |
{ | |
"version": 1, | |
"notes": "", | |
"documentation": "\"This file is a QMK Configurator export. You can import this at <https://config.qmk.fm>. It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: <https://docs.qmk.fm/#/newbs>\n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n", | |
"keyboard": "keychron/v2/ansi", | |
"keymap": "keychron_v2_ansi_layout_ansi_67_2025-02-16", | |
"layout": "LAYOUT_ansi_67", | |
"layers": [ | |
[ | |
"KC_ESC", |
# Strip leading dollar signs. Fixes commands pasted from markdown. | |
# Requires ble.sh: https://github.com/akinomyoga/ble.sh | |
# shellcheck disable=SC2016 | |
ble/function#advice around ble/widget/default/accept-line ' | |
if [[ "${_ble_edit_str:0:2}" == "$ " ]]; then | |
ble/widget/beginning-of-logical-line | |
ble/widget/insert-string "${_ble_edit_str:2}" | |
ble/widget/kill-forward-logical-line | |
fi | |
ble/function#advice/do |
# Use %N in a file | |
0=${(%):-%N} | |
echo "dollar zero: $0" | |
# Use :a to get the absolute path | |
echo "dollar zero abs path: ${0:a}" | |
# Use :A to get the absolute path resolving symlinks | |
echo "dollar zero abs path: ${0:A}" |
# Fish-like contains (https://fishshell.com/docs/current/cmds/contains.html) | |
contains() {( | |
while getopts "i" opt; do | |
case "$opt" in | |
i) o_index=1 ;; | |
*) return 1 ;; | |
esac | |
done | |
shift $(( OPTIND - 1 )) |