This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Pull in the wezterm API | |
local wezterm = require 'wezterm' | |
local act = wezterm.action | |
local mux = wezterm.mux | |
-- This table will hold the configuration. | |
local config = {} | |
-- In newer versions of wezterm, use the config_builder which will | |
-- help provide clearer error messages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
if ! fgrep -qs 'ctrl:new_ctrl = +new_ctrl(new_ctrl)' /usr/share/X11/xkb/rules/evdev; then | |
sudo sed -i.bak '/ctrl:nocaps[[:blank:]]*=[[:blank:]]*+ctrl(nocaps)/a\ | |
ctrl:new_ctrl = +new_ctrl(new_ctrl) | |
' /usr/share/X11/xkb/rules/evdev | |
fi | |
cat <<'HEREDOC' |sudo tee /usr/share/X11/xkb/symbols/new_ctrl | |
partial modifier_keys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defvar-local +lsp--flycheck-eglot--current-errors nil) | |
(defun +lsp--flycheck-eglot-init (checker callback) | |
"CHECKER is the checker (eglot). | |
CALLBACK is the function that we need to call when we are done, on all the errors." | |
(eglot-flymake-backend #'+lsp--flycheck-eglot--on-diagnostics) | |
(funcall callback 'finished +lsp--flycheck-eglot--current-errors)) | |
(defun +lsp--flycheck-eglot--on-diagnostics (diags &rest _) | |
(cl-labels |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
# 有关 Fiber 的解释: (按照数据流的方向分为两部分) | |
# 在 `主线程' 中使用 resume 方法来启动(或继续执行)一个 `纤程'. | |
# 1. 第一次调用 fiber.resume, 会启动一个纤程, | |
# 如果 resume 调用时提供了实参, 会作为代码块形参传入代码块. | |
# 2. 如果非第一次调用 fiber.resume, 即, `恢复' 一个纤程, 会做两件事: | |
# - 从上次离开纤程的那个位置(调用 Fiber.yield 离开纤程的那个位置), 恢复纤程的执行. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'gist) | |
(provide 'gist_init) | |
;;; gist_init ends here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ensure add this rm script's $PATH before system /usr/bin/rm command. | |
# a linux rm (wrapper) script which can only use -rf/-r/-f option immediately following rm command. | |
# e.g. | |
# rm ~/.cache -rf # failed! with rm: -rf: No such file or directory | |
# rm -rf ~/.cache # success! | |
case "${@:(-1)}" in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
USE_COPY= | |
function readlink1() { | |
(cd "$1" && pwd -P) | |
} | |
function backup () { | |
mv $* $*_bak-$(date '+%Y-%m-%d_%H:%M') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'multi-vterm) | |
(defun toggle-drop-down-term () | |
"Open a drop-down terminal in the same directory as the current file." | |
(interactive) | |
(require 'multi-vterm) | |
(let ((win (get-local-window-for-buffer-name "*vterminal"))) | |
(if win | |
(delete-window win) | |
(let ((vterm-buffer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'multi-vterm) | |
(defun toggle-drop-down-term () | |
"Open a drop-down terminal in the same directory as the current file." | |
(interactive) | |
(require 'multi-vterm) | |
(let ((win (get-local-window-for-buffer-name "*vterminal"))) | |
(if win | |
(delete-window win) | |
(let ((vterm-buffer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'multi-vterm) | |
(defun toggle-drop-down-term () | |
"Open a drop-down terminal in the same directory as the current file." | |
(interactive) | |
(require 'multi-vterm) | |
(let ((win (get-local-window-for-buffer-name "*vterminal"))) | |
(if win | |
(delete-window win) | |
(let ((vterm-buffer |
NewerOlder