Managed using the bare git repo method. Popularized by this Hacker News thread.
(From the Arch Wiki: Pacman Tips and Tricks)
-
Create the pacman hook:
sudoedit /etc/pacman.d/hooks/pkglist.hook
-
Paste the following content into the
.hookfile:[Trigger] Operation = Install Operation = Remove Type = Package Target = * [Action] When = PostTransaction Exec = /bin/sh -c '/usr/bin/pacman -Qqe > ~/pkglist.txt'
Tip
sudoedit uses the editor set by the SUDO_EDITOR environment variable to edit files owned by root as the current user. Running something like sudo nvim opens Neovim without all of the user configuration. That's why your plugins and themes might be missing when you open neovim as root.