fixed long standing nvim startup error
Testing fresh nvim installs can be a pain, and hard to di without borking your
known good install. I’ve been using NVIM_APPNAME to run a test nvim in a
sandbox that wont bork my main install. This usually runs for me in under a
minute, can be down under 15s if I remove some of the TreeSitter installs at
the end. This beats a full docker build of my full devtainer to test out nvim
packaging woes.
rm ~/.cache/wwtest -rf
rm ~/.local/share/wwtest -rf
rm ~/.config/wwtest -rf
cp -r nvim/.config/nvim/ ~/.config/wwtest
NVIM_APPNAME=wwtest nvim --headless "+Lazy sync" +qa
NVIM_APPNAME=wwtest nvim --headless "+TSUpdateSync" "+sleep 5000m" +qa
NVIM_APPNAME=wwtest nvim --headless "+MasonUpdate" +qa
NVIM_APPNAME=wwtest nvim --headless "+TSInstallSync! c cpp go lua python rust tsx javascript typescript vimdoc vim bash yaml toml vue just" +qa
NVIM_APPNAME=wwtest nvim --headless "+MasonInstall lua-language-server rustywind ruff ruff-lsp html-lsp typescript-language-server beautysh fixjson isort markdownlint stylua yamlfmt python-lsp-server" +qa
NVIM_APPNAME=wwtest nvim
I’ve started to use this as a just recipe to run before deploying a new
version of my dotfiles. So far its pairing nicely with nvim-manager
Setting up 4G Backup with Google Fi and Netgear LM1200
ahrefs-cleanup-2024
When I want to put a date in a document like a blog post from vim I use !!date
from insert mode. Note that entering !! from normal mode puts you in command
mode with :.! filled out. This runs a shell command, i.e. date for this
example.
It outputs the following
Fri Jan 31 08:46:11 PM CST 2025
You can also pass in a date such as tommorrow by pasdding in the -d date -d tomorrow.
It outputs the following
Sat Feb 1 08:53:20 PM CST 2025
codeium just taught me this one with autocomplete
:put =strftime('%Y-%m-%d')
This outputs the following
2025-01-31
What I like about the :put =strftime( method is that you can add a format,
but that is a lot more for me to remember than !!date
A few weeks later #
I’m going through a bunch of blog posts and dont want my date formats to change
to the Wed Feb format so I broke down and made these keybindings. I think I’m
still going to be using .!date a lot, but these keybindings will be nice for
editing blog post frontmatter.
set("n", "<leader>dd", "<cmd>put =strftime('%Y-%m-%d')<cr>", { noremap = true, silent = true })
set("n", "<leader>dt", "<cmd>put =strftime('%Y-%m-%d %H:%M:%S')<cr>", { noremap = true, silent = true })
dd 2025-02-12 dt 2025-02-12 12:53:47 - :.!date Wed Feb 12 12:53:47 PM CST 2025
Today I ran into an interesting question, why am I being asked to configure
tzdata while installing npm. Turns out that the aptitude cli has a why
command that very handily nails down why you have something installed on a
debian based system.
Install aptitude #
apt install aptitude
Why tzdata #
Now we can query why we need tzdata and see the full chain with the root
package being npm.
root@47685221fb82:/# aptitude why tzdata
i npm Depends node-gyp
i A node-gyp Depends gyp (>= 0.1+20200513gitcaa6002)
i A gyp Depends python3:any
i A python3 Provides python3:any
i A python3 Depends python3.12 (>= 3.12.3-0~)
i A python3.12 Depends tzdata
Today I ran into this interactive prompt on ubuntu while installing node and npm, and I do not want to manually configure this interactively every time I run an install, moreso in docker I do not have the interactive terminal to do so.
Configuring tzdata
------------------
Please select the geographic area in which you live. Subsequent configuration questions will narrow this down by presenting a list of cities, representing the time zones in which they are located.
1. Africa 2. America 3. Antarctica 4. Arctic 5. Asia 6. Atlantic 7. Australia 8. Europe 9. Indian 10. Pacific 11. Etc 12. Legacy
Geographic area:
Why tzdata #
Checking aptitude why tzdata it shows that the chain goes back through npm.
root@47685221fb82:/# aptitude why tzdata
i npm Depends node-gyp
i A node-gyp Depends gyp (>= 0.1+20200513gitcaa6002)
i A gyp Depends python3:any
i A python3 Provides python3:any
i A python3 Depends python3.12 (>= 3.12.3-0~)
i A python3.12 Depends tzdata
The solution, configure tzdata #
export TZ="America/Chicago"
export DEBIAN_FRONTEND=noninteractive
apt update
apt install tzdata -y
ln -fs /usr/share/zoneinfo/$TZ /etc/localtime
dpkg-reconfigure -f noninteractive tzdata
DEBIAN_FRONTEND=noninteractive
This is required, because apt installing tzdata will trigger the
interactive prompt. You will manually configure it in the next two steps.
dst session one
https://www.youtube.com/watch?v=03KsS09YS4E&t=610s
Today I learned about the basic calculator, bc. At the very end of this video prime uses it to add numbers in vim.
REPL #
You can start a calculator repl at the command line, by running bc.
Vim #
Since bc supports standard unix pipes you can easily pipe data from vim into bc
and back out using !!bc. All you need is a string of math on the line you
want to calculate, go to normal mode and run !!bc to get the answer.
Traditionally I will open my system calculator or ipython to do something like this.
To keep the equation and the result in the same line you can send the equation to stderr and the result to stdout using tee.
:.!tee >(cat >&2) | bc
markdown split panel
Make MinIO Access Key
I’ve been back to putting some images on my blog lately and thinking about
making them a bit thinner through the use of aspect ratio for simplicity. I’m
leaning pretty heavy on tailwindcss these days due to some weird quirks of
markdown-it-attrs I cannot have slashes in classes from markdown so I made a
.cinematic class to achieve this.
.cinematic {
@apply aspect-[2.39/1];
}
Example
Attrs does not like ‘/’ characters in its classes, so to use some tailwind classes with custom values we must make new classes in our tailwind input css.
.cinematic {
@apply aspect-[2.39/1];
}
Given the following markdown with attrs added to the image and to the paragraph block.
{.aspect-[2.39/1]}
{.cinematic}
{.cinematic}

We get the following output with only the middle one working correctly.
Note
The inline version of `.cinematic` works, but `.aspect-[2.39/1]` does not,
it turns into text after the image. The block version with the class before the image applies to the paragraph, not the image.
