Skip to content

Instantly share code, notes, and snippets.

@Kurama622
Kurama622 / treesitter_context.lua
Created March 31, 2026 13:31
treesitter context
vim.keymap.set("n", "<C-g>", function()
local hl_keywords = {
["class"] = true,
["function"] = true,
["namespace"] = true,
["method"] = true,
["type"] = true,
["enum"] = true,
["field"] = true,
}
@Kurama622
Kurama622 / context.lua
Last active March 30, 2026 05:02
Neovim-Context
local function binary_search(tbl, line)
local left = 1
local right = #tbl
local mid = 0
while true do
mid = bit.rshift(left + right, 1)
if not tbl[mid] then
return
end
@Kurama622
Kurama622 / xephyr.sh
Created May 13, 2025 16:02
Xephyr debug wm
#!/bin/bash
Xephyr -fullscreen -noreset :1 &
sleep 1
export DISPLAY=:1
# set dpi
xrdb -merge ~/.Xresources
exec dwm 2>/dev/null
@Kurama622
Kurama622 / function_calling.lua
Last active May 13, 2025 15:39
Function Calling in Neovim
local Job = require("plenary.job")
local json = vim.fn.json_encode
local function add(a, b)
print("a + b = ", a + b)
return a + b
end
local function Multiplication(a, b)
print("a * b = ", a * b)
return a * b
@Kurama622
Kurama622 / Makefile
Created June 5, 2024 08:46 — forked from ochinchina/Makefile
implement barrier with the zookeeper C API, require C++11 compiler
CPP = g++
INCS = -I$(ZK_DIR)/src/c/include -I$(ZK_DIR)/src/c/generated
LIBS = -L$(ZK_DIR)/src/c/.libs -lzookeeper_mt -lpthread
CXX_FLAGS = -std=c++11
all: barrier
barrier: ZkBarrierTest.o
$(CPP) -o barrier ZkBarrierTest.o $(LIBS)