Skip to content

Instantly share code, notes, and snippets.

View DogLooksGood's full-sized avatar
🥌
Debugging

tianshu DogLooksGood

🥌
Debugging
View GitHub Profile
@DogLooksGood
DogLooksGood / from-vim-to-meow.org
Created December 5, 2021 21:04
from-vim-to-meow.org

From Vim Keybindings

A lot beginners asked about the equivalents to the common operations in Vim keybinding. Following is a list of comparison.

(Recommended qwerty keybinding is used here for simplify tables, every keybindings are customizable. We also use short name for commands.)

toggle insert state

operationcount VimVimMeowcount MeowMeow commands
@DogLooksGood
DogLooksGood / meow-tutorial.el
Last active March 14, 2021 03:27
Meow Tutorial (WIP)
;;; meow-tutorial.el --- Tutorial in Meow -*- lexical-binding: t -*-
;; This file is not part of GNU Emacs.
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License
;; as published by the Free Software Foundation; either version 3
;; of the License, or (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
@DogLooksGood
DogLooksGood / .emacs
Last active October 3, 2022 11:54
Meow dot emacs
(setq package-archives '(("gnu" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/gnu/")
("melpa" . "http://mirrors.tuna.tsinghua.edu.cn/elpa/melpa/")))
(require 'package)
(package-initialize)
(setq package-selected-packages
'(modus-themes
selectrum
meow
@DogLooksGood
DogLooksGood / txt
Created February 25, 2021 02:48
utf8demo
UTF-8 encoded sample plain-text file
‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Original version from Markus Kuhn [ˈmaʳkʊs kuːn] from University of Cambridge
http://www.cl.cam.ac.uk/~mgk25/
The original "xterm-UTF-8-demo.txt"
https://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-demo.txt
https://gist.github.com/msabramo/3921955
UTF-8 test file (closely related)...
https://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt
@DogLooksGood
DogLooksGood / pharo-setup.md
Created February 20, 2021 04:00
Setup Pharo With HiDPI and Fcitx Input Method

使用大鼠标光标

在启动 pharo-launcher 前,指定环境变量 SQUEAK_FAKEBIGCURSOR=1.

支持 Fcitx

在 pharo-launcher 中点击 settings 在 vm args 中添加 -compositioninput.

修正 Menubar 字体大小

在 pharo 中指定字体之后,可以使用 MenubarMorph reset. 来重置菜单的渲染。

@DogLooksGood
DogLooksGood / org-latex-auto-toggle.el
Created February 12, 2021 14:51
org-latex-auto-toggle.el
(require 'dash)
(defvar-local +org-last-in-latex nil)
(defun +org-post-command-hook ()
(ignore-errors
(let ((in-latex (and (derived-mode-p 'org-mode)
(or (org-inside-LaTeX-fragment-p)
(org-inside-latex-macro-p)))))
(if (and +org-last-in-latex (not in-latex))
echo fs.inotify.max_user_watches=524288 | sudo tee /etc/sysctl.d/40-max-user-watches.conf && sudo sysctl --system
@DogLooksGood
DogLooksGood / rime.el
Created February 23, 2020 08:05
Try to implement a minimal emacs rime input method
(defface rime-preedit-face
'((((class color) (background dark))
(:underline t))
(((class color) (background light))
(:underline t)))
"Face for preedit string"
:group 'rime)
(defvar rime--preedit-overlay nil)
(defvar rime--backspace-fallback nil)
@DogLooksGood
DogLooksGood / clojure-comment.el
Created December 10, 2019 03:01
A command to comment clojure code
(defun user/clojure-comment ()
(interactive)
(cond
((not current-prefix-arg)
(save-mark-and-excursion
(if (equal "#_" (buffer-substring-no-properties (point) (+ 2 (point))))
(while (equal "#_" (buffer-substring-no-properties (point) (+ 2 (point))))
(delete-char 2))
(progn
(unless (or (equal (char-after) 40)
@DogLooksGood
DogLooksGood / modal-edit-design.md
Last active October 17, 2019 22:17
A Modal Edit Design

模式编辑设计

最初的想法

  1. 减少RSI!避免control,也避免metashift.
  2. 尽量接近原始Emacs的按键绑定,减少学习的成本。
  3. 使用和位置无关的按键,这样在所有的键盘布局下都可以使用。
  4. 可以不需要hack就能方便的使用各个package。
  5. 可以高效的编辑文字。
  6. 指令序列尽量保持简短。