Skip to content

Instantly share code, notes, and snippets.

Install Neovim Plugins after Importing Dotfiles

Oftentimes, after importing your .dotfiles (including your Neovim configuration files) to a new machine, installing your Neovim plugins using :PlugInstall (if you're on vim-plug) isn't ideal. This is mainly because of all the error messages that you would have to skip through before you're even able to run the install command.

This can be circumvented by doing the following:

nvim -u .dotfiles/.config/nvim/plugins.vim --headless +"PlugInstall" +"qall"

Adjusting the Grub Bootloader for a HiDPI Screen

The text size on Grub, when running on a computer with a HiDPI screen (e.g., 2880x1800 at 13 inch), will often appear too small. Lowering Grub's resolution is one solution. However, it will make Grub's interface pixelated. A better way is to enlarge the font size itself and not mess with the resolution.

We can start by deciding what font we want to use for Grub's interface. I recommend using a typeface that is specifically built for the absence of anti-aliasing, such as Unifont.

Changing the font size of Grub means replacing the binary .pf2 font file that is compatible with Grub (regular .ttf files can't be read by Grub). This is because the font size is hardcoded to the binary. To create that .pf2 file out of the Unifont typeface, we can run the following in the command line:

sudo grub-mkfont --no-hinting -s 32 -o /boot/grub/fonts/unifont.pf2 /usr/share/fonts/Unifont/Unifont.ttf
@gjazali
gjazali / prompt.sh
Last active April 21, 2025 14:51
Zsh Prompt with Git Status
# Allow the use of functions in prompt
setopt PROMPT_SUBST
# Colours
autoload -U colors && colors
# Exit code
local exit_code="%(?,,\$?: %{$fg[red]%}%?%{$reset_color%})"
# Version control system
@gjazali
gjazali / firefox-custom-tabs.md
Last active March 5, 2024 10:58
Firefox Tree Style Tab Without Tab Strip (Sidebar Only)

Use Firefox & Tree Style Tab with userChrome.css

This code will hide Firefox's horizontal tab strip in favour of solely using Tree Style Tab's vertical tabs. It will leave space for window buttons on the top left in a space of the same colour as the toolbar. This code is also optimised for full screen and both dark and light mode. Since the code is .css only, it does not require setting up autoconfig.js.

Tested on: macOS 11 (Big Sur), macOS 12 (Monterey), macOS 13 (Ventura), Windows 11, and Arch Linux (running i3wm).

Screenshot