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 / 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 / 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 / .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 / 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 / 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
@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 / xchange_viewer_underline_change.ahk
Last active March 2, 2020 17:00
Use right-click and then `f` to change underline style for XChange Viewer
#IfWinActive ahk_exe PDFXCview.exe
; Note, this script is built on one major assumption:
; 1. that there is a labeled routine called CenterMouseOnActiveWindow, from: https://www.autohotkey.com/boards/viewtopic.php?t=60433
; 2. that the Property window shall open at the **center** of the active window. For XChangeViewer, this is exactly the case.
~RButton::
Hotkey, f, f, On
KeyWait, f, D T3
Hotkey, f, f, Off
if(!ErrorLevel) {
; Send, {Esc}
@llinfeng
llinfeng / TP_middle_Scroll.ahk
Last active August 3, 2024 21:35
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 / cVimrc
Created January 6, 2020 14:36
cVim white list
let blacklists = ["https://mail.google.com/*","http://localhost/*","https://calendar.google.com/*","https://www.overleaf.com/*","https://app.getpocket.com/*","https://gallery.mailchimp.com/*","https://colab.research.google.com/*","https://www.tumblr.com/*","https://www.youtube.com/*","https://docs.google.com/*","https://todoist.com/*","https://toggl.com/*","https://groups.google.com/*"]
" Settings