diff --git a/.xonshrc b/.xonshrc new file mode 100644 index 0000000..355073b --- /dev/null +++ b/.xonshrc @@ -0,0 +1,69 @@ +# Xontribs +_xontribs = [ + "abbrevs", +] +xontrib load @(_xontribs) + +# Options +$XONSH_COLOR_STYLE = "one-dark" +$PROMPT_TOOLKIT_COLOR_DEPTH = "DEPTH_24_BIT" + +$VI_MODE = True + +$XONSH_HISTORY_BACKEND = "sqlite" +$DOTGLOB = True +$XONSH_SHOW_TRACEBACK = False +$ENABLE_ASYNC_PROMPT = True + +# Replacements +abbrevs["rm"] = "trash" + +# Safety options +abbrevs["cp"] = "cp -i" +abbrevs["mv"] = "mv -i" +abbrevs["rmi"] = "rm -i" + +# Default options +abbrevs["rsync"] = "rsync -avh --partial --zc=zstd --zl=22 --info=PROGRESS2 --no-i-r --stats" + +# Podman +sagemath_image = "docker.io/sagemath/sagemath:latest" +abbrevs["sage"] = f"podman pull {sagemath_image}; podman run -it --rm {sagemath_image}" +abbrevs["sage-jupyter"] = f"podman pull {sagemath_image}; podman run -it --rm -p8888:8888 {sagemath_image} sage-jupyter" + +fedora_image = "registry.fedoraproject.org/fedora:latest" +abbrevs["fedora"] = f"podman pull {fedora_image}; podman run -it --rm {fedora_image}" + +asciidoctor_image = "docker.io/asciidoctor/docker-asciidoctor:latest" +abbrevs["adoc"] = f"podman pull {asciidoctor_image}; podman run -it --rm -v @($(pwd).strip()):/documents/:Z {asciidoctor_image}" + +# Environment variables +$EDITOR = "/usr/bin/nvim" +$JULIA_NUM_THREADS = "16" + +# Setup +## Zoxide +execx($(zoxide init xonsh), 'exec', __xonsh__.ctx, filename='zoxide') + +## Starship +execx($(starship init xonsh)) + +# Aliases +aliases["cd"] = "z" +aliases["onefetch"] = "onefetch --no-palette" + +abbrevs["ssh"] = "kitty +kitten ssh" + +aliases["ls"] = "lsd" +aliases["ll"] = "lsd -l" +aliases["cat"] = "bat" + +## Taskwarrior +aliases["ta"] = "task add project:@($args[0]) @($args[1:])" +aliases["tal"] = "ta @($args) priority:L" +aliases["tam"] = "ta @($args) priority:M" +aliases["tah"] = "ta @($args) priority:H" + +## Vit +aliases["v"] = "vit" +aliases["vp"] = "vit project:@($args[0]) @($args[1:])"