Skip to content

Instantly share code, notes, and snippets.

View junkblocker's full-sized avatar

Manpreet Singh junkblocker

View GitHub Profile
@junkblocker
junkblocker / README.md
Created June 3, 2026 01:34 — forked from lobre/README.md
Understanding Kakoune’s Command Language: Parsing, Evaluations, and Beyond

Understanding Kakoune’s Command Language: Parsing, Evaluations, and Beyond

Kakoune is a modal editor. That means when you’re editing text, you’re constantly interacting with the editor using a powerful language of keystrokes — moving around, selecting text, transforming content, all through short, expressive commands typed directly in the editing interface. This is the core editing experience, and it’s what gives Kakoune its speed and fluidity.

But this isn’t the only way to interact with Kakoune.

There’s another side to Kakoune — a more structural, programmable one — which lets you interact with the editor through commands. These commands can be used to configure Kakoune, automate behavior, and define complex workflows. Commands can be written in configuration files, invoked via custom keybindings, or typed directly into the command prompt.

This document focuses on that second side: the command interface. We will explore how commands work, how they are built, and how Kakoune interprets them

@junkblocker
junkblocker / vimtab.kak
Created June 2, 2026 15:05 — forked from dojoteef/vimtab.kak
Replicate Vim's expandtab and softtabstop behavior in kakoune
# Replicate expandtab from vim.
declare-option -docstring "Expand <tab> to spaces based on tabstop." bool expandtab yes
# Replicate softtabstop from vim.
declare-option -docstring "Make tabstop number of spaces feel like a <tab> when pressing <tab> or <backspace> in insert mode." int softtabstop 4
# Helper function for inserting a <tab>
def softtabstop-insert-tab -hidden %{
evaluate-commands -no-hooks -draft -itersel %{
try %sh{
@junkblocker
junkblocker / parser.sh
Created April 3, 2026 17:13 — forked from alganet/parser.sh
Prototype sh parser written in sh
# Copyright (c) Alexandre Gomes Gaigalas <alganet@gmail.com>
# SPDX-License-Identifier: ISC
_repeat () {
case "${2:-}" in
0|"") return;;
1) REPLY="$1"; return;;
2) REPLY="$1$1"; return;;
3) REPLY="$1$1$1"; return;;
4) REPLY="$1$1$1$1"; return;;
@junkblocker
junkblocker / c89cc.sh
Created April 3, 2026 17:01 — forked from alganet/c89cc.sh
c89cc.sh - standalone C89/ELF64 compiler in pure portable shell
#!/bin/sh
# ISC License
# Copyright (c) 2026 Alexandre Gomes Gaigalas <alganet@gmail.com>
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
diff --git c/.talon/user/mine/firefox_wayland.talon i/.talon/user/mine/firefox_wayland.talon
new file mode 100644
index 000000000..dbf281dbe
--- /dev/null
+++ i/.talon/user/mine/firefox_wayland.talon
@@ -0,0 +1,4 @@
+user.wayland_window_class: org.mozilla.firefox
+-
+# This activates the tag 'user.tabs'.
+tag(): user.tabs
@junkblocker
junkblocker / run-command.zsh
Created September 19, 2025 20:09 — forked from romkatv/run-command.zsh
Zsh function to run a command and capture its status, stdout and stderr
# Runs "$@" in a subshell with the caller's options, sets reply=(stdout stderr)
# and returns the status of the executed command. Both stdout and stderr are
# captured completely, including NUL bytes, incomplete UTF-8 characters and
# trailing LF, if any.
#
# Example:
#
# % zsh-run-command ls -d ~ /garbage
# % printf 'status: %s\nstdout: %s\nstderr: %s\n' $? "${(q+)reply[@]}"
# status: 2
@junkblocker
junkblocker / README.md
Created May 4, 2025 03:22 — forked from davcam/README.md
A zettelkasten/denote application in ad editor.

This gist describes simply/minimally how to extend the ad editor to use zettelkasten/Denote type notes using just four short bash scripts.

Below is a short description of ad, a couple of demos and the bash scripts needed to:

  • create "Denote" notes
  • create links to notes
  • open notes in ad from the links using ad's loading/plumbing mechanism
  • list notes in ad that link back (backlink) to the current one
@junkblocker
junkblocker / init.lua
Created April 25, 2025 03:08
Neovim 0.11 config with builtin autocompletion
---[[HOW TO USE IT?
--- 0. Install neovim 0.11
--- 1. Create ~/.config/nvim-experiments directory on your machine (Assuming you are using Linux)
--- 2. Copy this init.lua into the nvim-experiments directory
--- 3. Launch neovim using `NVIM_APPNAME=nvim-experiments nvim` command
--- 4. Install requiring lsp servers via mason (type `:Mason`), relaunch neovim, and open your project to test it
--- 5. You may want to install treesitter parsers to get documentation
--- highlighting for some languages
---]]
@junkblocker
junkblocker / README.md
Created April 24, 2025 21:53 — forked from Leenuus/README.md
Display command output in neovim split window

I just implemented a simple but really powerful user command suggested by romainl in lua, running asynchronously using vim.uv API.

In short, this is a command named Redir, which redirect ex command or shell commands stdin/sterr to neovim buffers. So you can view them in split window on the fly.

With Redir, you can do:

  • A good way to inspect your neovim.
" show all your messages in split, I love this one and make it default
@junkblocker
junkblocker / notify.lua
Created December 13, 2024 01:38 — forked from CodingWithAnxiety/notify.lua
Libnotify Wezterm
--- A notification module for WezTerm using notify-send.
-- This module provides functionality to send notifications using the 'notify-send' command,
-- which is available on most Linux distributions that implement the org.freedesktop.Notifications specification.
-- @module notify
-- @author [Your Name]
-- @license [Your License]
-- @copyright [Your Copyright]
local wezterm = require 'wezterm'