Putting word count in Vim statusline for LaTeX files

2022.11.28

This ftplugin updates the word count in the statusline on every save. More frequent updates slow Vim down and cause random rendering problems.

" .vim/after/ftplugin/tex.vim

function CountWords()
  silent return systemlist('texcount ' .. expand('%:p'))[2]
endfunction

let b:wordcount = CountWords()

augroup tex
  autocmd! * <buffer>
  autocmd BufWritePost <buffer> :let b:wordcount = CountWords()
augroup END

setlocal statusline=%{b:wordcount}
      

GOES-16 map

2022.11.18

I wrote a script to retrieve and composite the latest GOES-16 satellite image of Earth. GitHub link coming soon.

Earth 5 minutes before I ran my script.

Configuring Zathura

2022.10.11

I finally got Zathura (the pdf viewer) configured the way I want it on MacOS. I installed using homebrew following these instructions. I set up an automator script to launch Zathura for me according to this gist. I chose my colors based on the blacks and whites in the pencil colorscheme.

Here’s my zathurarc file:

set selection-clipboard clipboard
set guioptions ""
set window-title-basename true

set recolor true
set recolor-keephue true
set recolor-lightcolor \#F1F1F1
set recolor-darkcolor \#181818
set default-bg \#E5E6E6
set completion-bg \#181818
set completion-fg \#F1F1F1
set completion-group-bg \#181818
set completion-group-fg \#F1F1F1
set completion-highlight-fg \#181818
set inputbar-bg \#181818
set inputbar-fg \#F1F1F1
set statusbar-bg \#181818
set statusbar-fg \#F1F1F1

Good luck! 📄

Washington State

2021.1.20

I learned some Blender and used some open source elevation data to make a nice looking relief map of Washington State. Check out how I made it here. 📍

Rendered relief map of WA

Camping in Cottonwood Wash

2020.5.14

This last weekend, Caitlyn and I backpacked up Cottonwood Wash in Utah’s San Rafael Swell, a beautiful canyon all to ourselves. We even spotted some petroglyphs. ⛰️

1983 USGS map of Mexican Mountain

Course notes from CS183

2020.4.20

These are my notes from the course CS183: Foundations of Machine Learning. They are imperfect and incomplete but I really enjoyed making them. If you would like to make edits email me and I can send you the source code. 📓