Skip to content

Instantly share code, notes, and snippets.

View lobre's full-sized avatar

Loric Brevet lobre

View GitHub Profile
@dojoteef
dojoteef / softwrap.kak
Last active September 16, 2024 14:42
Enable softwrap in kakoune and fix associated movement issues
# Softwrap long lines (and correct for improper kakoune movement behavior)
add-highlighter global/softwrap wrap -word -indent
define-command goto-center -docstring 'Jump to the center of the view' %{
execute-keys %sh{
echo $kak_window_range $kak_cursor_line | (
read y x h w l
num_lines=$((l-y-(h+1)/2))
if [ $num_lines -lt 0 ]; then
echo "${num_lines##-}j"
elif [ $num_lines -gt 0 ]; then
@gdamjan
gdamjan / default.nix
Last active November 26, 2022 12:19
A demo "Portable Service" for a shell program built with nix - https://systemd.io/PORTABLE_SERVICES/
{ pkgs ? import <nixpkgs> { } }:
let
demo-program = pkgs.writeShellScriptBin "helloWorld" "while sleep 3; do echo Hello World; done";
demo-service = pkgs.substituteAll {
name = "demo.service";
src = ./demo.service.in;
demoExe = "${demo-program}/bin/helloWorld";
};
demo-socket = pkgs.concatText "demo.socket" [ ./demo.socket ];
@fabi1cazenave
fabi1cazenave / kanata.kbd
Created December 3, 2023 10:36
kanata configuration : 4×10 + 3 thumb keys
;; Quick notes about the kanata configuration syntax:
;; - the syntax is Lisp-like but totally unrelated to Lisp, so no worries :-)
;; - comments are prefixed by double-semicolons
;; - only one `defsrc` is allowed, listing all keys handled by kanata
;; - up to 25 `deflayer` are allowed, one per layer emulation
;; - the underscore symbol `_` in `deflayer` sections means "transparent",
;; i.e. the previous layer behaviour is used when pressing that key
;; `defsrc` defines the keys that will be intercepted by kanata.
;; The order of the keys matches with deflayer declarations and all deflayer