Skip to content

Instantly share code, notes, and snippets.

View mawkler's full-sized avatar
💭
Nix is love, Nix is life ❄️

Melker Ulander mawkler

💭
Nix is love, Nix is life ❄️
View GitHub Profile
@mawkler
mawkler / auto-symlinking-nix-directory.md
Created January 2, 2026 22:16
A home-manager directory that auto-creates dotfile symlinks to it in `~/.config/` based on the file structure

The function below lets you create a directory in your home-manager config that auto-creates symlinks for non-Nix dotfiles from ~/.config/ using xdg.configFile and mkOutOfStoreSymlink. This gives the following advantages:

  1. You can keep all your non-Nix dotfiles in your home-manager repo.
  2. You don't have to do home-manager switch on each dotfile change. Changes are instantly reflected.
  3. You don't need to hard-code the paths for each symlink, the linking is instead file-based. Just add the new dotfile to the directory, and you're done.

For example, if your home-manager config is in ~/nixos/ and looks like this...:

~/nixos
@mawkler
mawkler / vim-plugins.md
Last active November 30, 2021 10:26
List of recommended (Neo)vim plugins and resources
@mawkler
mawkler / tips.md
Created November 24, 2021 13:59
Generella vim-tips

Generella tips

För att få överblick över alla Vims kommandon: :help quickref.txt

Vims syntax för kommandon. Exempelvis:

  • <c-d> betyder ctrl-d
  • <m-d> betyder alt-d (m läses "meta")
  • <c-w>w betyder tryck ctrl-w, sen w
  • är samma sak som
@mawkler
mawkler / zoom.vim
Last active October 13, 2021 18:03
Functions for zooming in GUI versions of Vim/Neovim
" Increases the font size with `amount`
function! Zoom(amount) abort
call ZoomSet(matchstr(&guifont, '\d\+$') + a:amount)
endfunc
" Sets the font size to `font_size`
function ZoomSet(font_size) abort
let &guifont = substitute(&guifont, '\d\+$', a:font_size, '')
endfunc