Skip to content

Instantly share code, notes, and snippets.

View yutkat's full-sized avatar
🤣
I'm looking for interesting things to do

Yuta Katayama yutkat

🤣
I'm looking for interesting things to do
View GitHub Profile
@last-partizan
last-partizan / ts-colors.lua
Created January 21, 2024 09:30
Map treesitter groups to nvim hl groups
-- Fix TS Colors
-- https://github.com/nvim-treesitter/nvim-treesitter/pull/3656/files
-- https://github.com/nvim-treesitter/nvim-treesitter/commit/1ae9b0e4558fe7868f8cda2db65239cfb14836d0
-- https://github.com/nvim-treesitter/nvim-treesitter/blob/master/CONTRIBUTING.md#highlights
local function set_default_hlgroups()
local highlights = {
-- Identifiers
["@variable"] = { link = "Variable", default = true },
["@variable.builtin"] = { link = "Special", default = true },
@RaafatTurki
RaafatTurki / hex_editor.lua
Last active January 18, 2025 07:46
proper hex editing in neovim
local xxd_dump_cmd = 'xxd -g 1 -u'
local xxd_cur_pos = nil
local function is_binary_file()
local filename = vim.fn.expand('%:t')
-- local basename = string.match(filename, "^[a-z]*$")
local binary_ext = { 'png', 'jpg', 'jpeg', 'out' }
local ext = string.match(filename, "%.([^%.]+)$")
if ext == nil and string.match(filename, '[a-z]+') then return true end
@kylechui
kylechui / dot-repeating.md
Last active September 1, 2025 16:33
A basic overview of how to manage dot-repeating in your Neovim plugin, as well as manipulate it to "force" what action is repeated.

Adding dot-repeat to your Neovim plugin

In Neovim, the . character repeats "the most recent action"; however, this is not always respected by plugin actions. Here we will explore how to build dot-repeat support directly into your plugin, bypassing the requirement of dependencies like repeat.vim.

The Basics

When some buffer-modifying action is performed, Neovim implicitly remembers the operator (e.g. d), motion (e.g. iw), and some other miscellaneous information. When the dot-repeat command is called, Neovim repeats that operator-motion combination. For example, if we type ci"text<Esc>, then we replace the inner contents of some double quotes with text, i.e. "hello world""text". Dot-repeating from here will do the same, i.e. "more samples""text".

Using operatorfunc

@folliehiyuki
folliehiyuki / init.lua
Last active August 17, 2025 17:18
River wayland compositor configuration in lua5.4
#!/usr/bin/lua5.4
--[[
NOTE:
- execp() needs 'lua-posix' package
- bitwise operands for tag mappings need Lua version >= 5.3
--]]
@mattn
mattn / README.md
Last active March 5, 2022 20:52
技術系 Twitter コミュニティ

移動しました!

@kkiyama117
kkiyama117 / denops-help.md
Last active June 12, 2021 06:45
Create plugin via denops.vim

Run plugins based on denops.vim

If you need this section written in Japanese, read article written by @lambdalisue

Requirements

You need to install these softwares on your machine to run denops plugins.

  • Deno (latest stable version is recommended.)
  • Vim/Neovim
@probonopd
probonopd / Wayland.md
Last active September 6, 2025 03:25
Think twice about Wayland. It breaks everything!

Think twice before abandoning X11. Wayland breaks everything!

image

Wayland breaks everything! It is binary incompatible, provides no clear transition path with 1:1 replacements for everything in X11, and is even philosophically incompatible with X11. Hence, if you are interested in existing applications to "just work" without the need for adjustments, then you may be better off avoiding Wayland.

Wayland solves no issues I have but breaks almost everything I need. Even the most basic, most simple things (like xkill) - in this case with no obvious replacement. And usually it stays broken, because the Wayland folks mostly seem to care about Automotive, Gnome, maybe KDE - and alienating everyone else (e.g., people using just an X11 window manager or something like GNUstep) in the process.

Feature comparison

@ig0rsky
ig0rsky / update-all-asdf-plugins.sh
Last active October 3, 2024 11:24
Update all asdf plugins to latest
#!/usr/bin/env bash
function log () {
printf "%s %s\n" "->" "$1"
}
log "Updating all asdf-plugin remotes..."
asdf plugin update --all
@cocopon
cocopon / slack-sidebar-iceberg
Last active May 26, 2023 12:06
Iceberg for Slack
#1E2132,#2A3158,#C6C8D1,#161821,#2A3158,#C6C8D1,#B4BE82,#E27878