# vim: ft=sh: if command -v valgrind >/dev/null; then alias memcheck="valgrind --track-fds=yes --leak-check=full --track-origins=yes" alias massif="valgrind --tool=massif" alias drd="valgrind --tool=drd" alias helgrind="valgrind --tool=helgrind" fi if command -v meson >/dev/null; then msetup() { if [[ -f "build/build.ninja" ]]; then [[ $# -eq 0 ]] || meson configure build "$@" else meson setup "$@" build fi } mbuild() { msetup && meson compile -C build "$@" } mtest() { msetup && meson test -C build "$@" } mcoverage() { msetup -Db_coverage=true && meson test -C build "$@" && ninja -C build coverage-html } mdist() { msetup && meson dist -C build --formats xztar,gztar,zip "$@" } mupdate() { meson subprojects update } mpurge() { meson subprojects purge } fi if command -v bear >/dev/null; then bmake() { mkdir -p build bear --output build/compile_commands.json --append -- make "$@" } alias mbmake='bmake -j$(($(nproc) * 2)) -l$(nproc)' fi glv() { GITLAB_TOKEN="$(pass gitlab.com/nvim-token)" nvim -c 'lua require("gitlab").review()' } nvim_config() ( cd ~/.config/nvim && nvim init.vim ) if command -v nix 2>/dev/null >&2; then nrun() { nix run . -- "$@" } nrun_() { local package="$1" shift nix run ".#$package" -- "$@" } fi