dots

my dotfiles
git clone https://tilde.team/~marisa/repo/dots.git
Log | Files | Refs

commit 48da97b704da3b310ddadc6160106bbd0b8fea6e
parent 66954e64ec05b0bb03fa4708cf88ab8304aa6ab1
Author: mokou <mokou@fastmail.com>
Date:   Sat, 27 Mar 2021 13:53:01 +0100

Add elvish config based off of fish config

Diffstat:
Mdot_config/fish/executable_config.fish | 1+
Aprivate_dot_elvish/rc.elv | 84+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 85 insertions(+), 0 deletions(-)

diff --git a/dot_config/fish/executable_config.fish b/dot_config/fish/executable_config.fish @@ -53,6 +53,7 @@ set -x RUST_SRC_PATH (rustc --print sysroot)/lib/rustlib/src/rust/src set -x XDG_CURRENT_DESKTOP Unity set -x PYTHONPATH '/Users/lu/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/pep582' $PYTHONPATH set -x LANG "en_US.UTF-8" +set -x TZ_LIST "Europe/Berlin;Berlin,America/New_York;US East,America/Los_Angeles;US West,Europe/London;London" # General Aliases alias editconfig "chezmoi edit ~/.config/fish/config.fish; and chezmoi apply; and source ~/.config/fish/config.fish" diff --git a/private_dot_elvish/rc.elv b/private_dot_elvish/rc.elv @@ -0,0 +1,84 @@ +use path +use str + +# Convenience function for only setting PATH if the specified directory exists +setpath = [path]{ + if (path:is-dir $path) { + set-env PATH (str:join ':' [$E:PATH $path]) + } +} + +# Set paths +$setpath /opt/homebrew/bin +$setpath ~/.rbenv/shims +$setpath ~/.rbenv/bin +$setpath ~/.cargo/bin +$setpath ~/.local/bin +$setpath ~/n/bin +$setpath ~/Library/Python/3.7/bin + +# Use private stuff +if (path:is-regular ~/.elvish/lib/private.elv) { + use private + private:init +} + +# Environment variables +set-env EDITOR "vim" +set-env USER "lu" +set-env SHELL (which elvish) +set-env TERM xterm-256color +set-env N_PREFIX ~/n +set-env LANG en_US.UTF-8 +set-env LC_ALL en_US.UTF-8 +set-env LANGUAGE en_US.UTF-8 +set-env RUST_SRC_PATH (and (has-external rustc) (rustc --print sysroot))/lib/rustlib/src/rust/src +set-env PYTHONPATH (str:join ':' ["/Users/lu/.local/pipx/venvs/pdm/lib/python3.9/site-packages/pdm/pep582" $E:PYTHONPATH]) +set-env TZ_LIST "Europe/Berlin;Berlin,America/New_York;US East,America/Los_Angeles;US West,Europe/London;London" + +# Aliases +fn editconfig []{ + and (chezmoi edit ~/.elvish/rc.elv) (eval (cat ~/.elvish/rc.elv | slurp)) +} +fn c [@a]{ cargo $@a } +fn cr [@a]{ c run $@a } +fn cb [@a]{ c build $@a } +fn cwr [@a]{ c watch -x run $@a } +fn mkt []{ cd (mktemp -d) } +fn czm [@a]{ chezmoi $@a } +# Git aliases +fn g [@a]{ git $@a } +fn gs []{ g status --short } +fn gl []{ g log --color --graph --abbrev-commit --online } +fn gqp []{ g add --all; g commit; g push} +fn gqc []{ g add --all; g commit } +fn gpl []{ g pull } +fn gps []{ g push } +fn gc []{ g commit } +fn gco [@a]{ g checkout $@a } +# Mercurial aliases +fn h [@a]{ hg $@a } +fn ha [@a]{ hg addremove $@a } +fn hc []{ hg commit } +fn hps []{ hg push } +fn hpl []{ hg pull } +fn hs []{ hg status } +fn hl []{ hg log } +# Aliases that overwrite other, existing commands +if (has-external hub) { + fn git [@a]{ hub $@a } +} +if (has-external exa) { + fn ls [@a]{ exa $@a } +} + +# Prompt +edit:prompt = { styled (tilde-abbr $pwd) green; put "\n> " } +edit:rprompt = (constantly "") + +# Nice welcome message +if (and (has-external toilet) (has-external lolcat)) { + toilet -f future "Welcome to elvish!" | lolcat -F 0.4 -S (randint 1 100) +} else { + echo "Welcome to elvish! To enable gay mode, install `toilet` and `lolcat`." +}