Skip to content

Instantly share code, notes, and snippets.


Linfeng Li llinfeng

  • The University of Michigan
  • Ann Arbor, MI, USA
View GitHub Profile
llinfeng / profile.log
Created Sep 15, 2022
Profiling vimwiki link creation on a Linux machine
View profile.log
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 / profile.log
Created Sep 15, 2022
Profiling Vimwiki Link Creation
View profile.log
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:
llinfeng /
Last active Jul 4, 2022
Use adb to launch a page in OneNote APK on an Android tablet
llinfeng / eink_clean.ahk
Last active Jul 31, 2022
Force full-screen refresh on e-ink monitors
View eink_clean.ahk
#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
; Source:
Gui, Color, 000000
Gui, Show, x-5000 y-20 w8000 h8000
sleep 333
Gui, Color, FFFFFF
llinfeng / Config_Zathura.txt
Last active May 19, 2022
Config VimTeX + Zathura with forward/backward search using NeoVim
View Config_Zathura.txt
# 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
llinfeng / Overleaf_V2_mappings.js
Last active Sep 10, 2021
Greasemonkey Script with Forward search in Overleaf
View Overleaf_V2_mappings.js
// ==UserScript==
// @name Overleaf Editor Custom VIM Keybindings
// @namespace
// @version 0.1
// @match*
// @grant none
// Source 1:
// Source 2:
// ==/UserScript==
llinfeng / xchange_viewer_underline_change.ahk
Last active Mar 2, 2020
Use right-click and then `f` to change underline style for XChange Viewer
View xchange_viewer_underline_change.ahk
#IfWinActive ahk_exe PDFXCview.exe
; Note, this script is built on one major assumption:
; 1. that there is a labeled routine called CenterMouseOnActiveWindow, from:
; 2. that the Property window shall open at the **center** of the active window. For XChangeViewer, this is exactly the case.
Hotkey, f, f, On
KeyWait, f, D T3
Hotkey, f, f, Off
if(!ErrorLevel) {
; Send, {Esc}
llinfeng / TP_middle_Scroll.ahk
Last active Jul 29, 2022
AHK - scroll with middle-mouse-key + trackpoint for Thinkpad keyboards
View TP_middle_Scroll.ahk
; Midbutton down for scrolling {{{
; Feature: with acceleration as intended.
; Source:
; Linking source:
; Working version {{{
Hotkey, $*MButton Up, MButtonup, off
KeyWait, MButton, T0.2
If ErrorLevel = 1
llinfeng / cVimrc
Created Jan 6, 2020
cVim white list
View cVimrc
let blacklists = ["*","http://localhost/*","*","*","*","*","*","*","*","*","*","*","*"]
" Settings
llinfeng / AHK_Markdown_to_go.ahk
Created Dec 7, 2019
An Autohotkey snippet that converts raw Markdown texts into "pastable" rich-text, for Gmail and even MS Word.
View AHK_Markdown_to_go.ahk
; Debugging tips
; 1. Check if pandoc is installed. If not, the best way is to install through choco.
; choco install page:
; 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.