Skip to content

Instantly share code, notes, and snippets.

View llinfeng's full-sized avatar

Linfeng Li llinfeng

  • The University of Michigan
  • Ann Arbor, MI, USA
View GitHub Profile
@llinfeng
llinfeng / TP_middle_Scroll.ahk
Last active March 28, 2024 08:06
AHK - scroll with middle-mouse-key + trackpoint for Thinkpad keyboards
; Midbutton down for scrolling {{{
; Feature: with acceleration as intended.
; Source: http://forum.notebookreview.com/threads/ultranav-middle-click-button-scroll.423415/
; Linking source: https://superuser.com/questions/91074/thinkpad-trackpoint-scrolling-and-middle-click-possible
; Working version {{{
$*MButton::
Hotkey, $*MButton Up, MButtonup, off
KeyWait, MButton, T0.2
If ErrorLevel = 1
{
@llinfeng
llinfeng / Vim_Dasung_Color.vim
Last active February 23, 2024 00:13
Tuning colorization of Vim for E-ink display
function! Dasung() " Specify a readable color scheme.
" Set color scheme, so that mostly things are readable
colorscheme delek
" Tune the airline color scheme (feel free to take it away).
AirlineTheme zenburn
" Keep the cursor as HD-FT has touch input
set guioptions+=r
" I got my copy of ProFontWindows, likely, from here: https://github.com/chrissimpkins/codeface/tree/master/fonts/pro-font-windows
" Resolution for the 13-inch Paperlike HD display is 1400 x 1050
set guifont=ProFontWindows:h20
@llinfeng
llinfeng / AHK_Markdown_to_go.ahk
Created December 7, 2019 14:37
An Autohotkey snippet that converts raw Markdown texts into "pastable" rich-text, for Gmail and even MS Word.
::togo::
; Debugging tips
; 1. Check if pandoc is installed. If not, the best way is to install through choco.
; choco install page:https://chocolatey.org/packages/pandoc
; 2. Check if `paste.exe` is available to PowerShell, same thing for `clip.exe` ==> these two are necessary Windows utilities/executable that were called with Ctrl+V and Ctrl+C
Run, PowerShell "paste.exe | pandoc -f markdown-smart --from=gfm -t HTML | Set-Clipboard -AsHtml ; echo 'Conversion done.' "
; Caveat: single quotes are pasted wrongly, as question marks.
Return
@llinfeng
llinfeng / Overleaf_V2_mappings.js
Last active December 16, 2023 23:39
Greasemonkey Script with Forward search in Overleaf
// ==UserScript==
// @name Overleaf Editor Custom VIM Keybindings
// @namespace http://tampermonkey.net/
// @version 0.1
// @match https://www.overleaf.com/project/*
// @grant none
// Source 1: https://groups.google.com/d/msg/ace-discuss/gwXMzUM17I4/9B_acHBSCQAJ
// Source 2: https://www.overleaf.com/learn/how-to/How_can_I_define_custom_Vim_macros_in_a_vimrc_file_on_Overleaf%3F
// ==/UserScript==
@llinfeng
llinfeng / eink_clean.ahk
Last active December 14, 2023 04:09
Force full-screen refresh on e-ink monitors
#SingleInstance, force ; Allow only one instance of this script to be running.
#Persistent ; To stop the script from exiting.
; Here, press F1 to trigger the black/white flash
F1::
; Source: https://superuser.com/questions/662264/i-would-like-to-make-the-screen-go-black-every-8-seconds-how
Gui, Color, 000000
Gui, Show, x-5000 y-20 w8000 h8000
sleep 333
Gui, Color, FFFFFF
@llinfeng
llinfeng / Overleaf Editor Custom VIM Keybindings (2023).user.js
Last active March 2, 2023 19:17
Custom vim keybinds for Overleaf (compatible with CodeMirror 5/6)
// ==UserScript==
// @name Overleaf Editor Custom VIM Keybindings (2023)
// @namespace http://tampermonkey.net/
// @version 0.0.2
// @match https://www.overleaf.com/project/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
@llinfeng
llinfeng / .OpenOneNoteLink_on_Android.md
Last active February 9, 2023 03:42
Use adb to launch a page in OneNote APK on an Android tablet
@llinfeng
llinfeng / profile.log
Created September 15, 2022 12:50
Profiling vimwiki link creation on a Linux machine
FUNCTION <SNR>167_update_hg_branch()
Defined: ~/vimfiles/plugged/vim-airline/autoload/airline/extensions/branch.vim:148
Called 23 times
Total time: 0.002346
Self time: 0.002071
count total (s) self (s)
23 0.000465 0.000190 if airline#util#has_lawrencium()
let cmd='LC_ALL=C hg qtop'
let stl=lawrencium#statusline()
@llinfeng
llinfeng / profile.log
Created September 15, 2022 12:35
Profiling Vimwiki Link Creation
SCRIPT /home/llinfeng/vimfiles/plugged/vimwiki/autoload/vimwiki/diary.vim
Sourced 1 time
Total time: 0.000560
Self time: 0.000560
count total (s) self (s)
" vim:tabstop=2:shiftwidth=2:expandtab:textwidth=99
" Vimwiki autoload plugin file
" Description: Handle diary notes
" Home: https://github.com/vimwiki/vimwiki/
@llinfeng
llinfeng / Config_Zathura.txt
Last active May 19, 2022 15:53
Config VimTeX + Zathura with forward/backward search using NeoVim
# Store as `~/.config/zathura/zathurarc`
# Store the following in `~/.config/nvim/init.vim`.
# Though, with VimTeX, it is optional to populate the synctex setting in Zathura.
set synctex true