aboutsummaryrefslogtreecommitdiff
path: root/dot_config/xonsh
diff options
context:
space:
mode:
authortwells46 <173561638+twells46@users.noreply.github.com>2025-12-31 13:28:05 -0600
committertwells46 <173561638+twells46@users.noreply.github.com>2025-12-31 13:28:05 -0600
commit2140ab51deed88e90eafebf9520fa5f9995dc7c9 (patch)
tree03cf1dcd2900495c1efb79aaa85f3254ecd5fb87 /dot_config/xonsh
parentff8f50638e4b17a9d7cc88d2f0d9560b7effce39 (diff)
Migrate from stow
Diffstat (limited to 'dot_config/xonsh')
-rw-r--r--dot_config/xonsh/rc.xsh23
1 files changed, 23 insertions, 0 deletions
diff --git a/dot_config/xonsh/rc.xsh b/dot_config/xonsh/rc.xsh
new file mode 100644
index 0000000..4ebeb66
--- /dev/null
+++ b/dot_config/xonsh/rc.xsh
@@ -0,0 +1,23 @@
+# XONSH WEBCONFIG START
+$PROMPT = '{YELLOW}{env_name}{RESET}{GREEN}{cwd}{RESET} {RED}{last_return_code_if_nonzero:[{BOLD_INTENSE_RED}{}{RED}] }{RESET}{BOLD_BLUE}{prompt_end}{RESET} '
+# XONSH WEBCONFIG END
+
+xontrib load coreutils
+#xontrib load fish_completer
+
+$CARAPACE_BRIDGES='zsh,fish,bash,inshellisense'
+$COMPLETIONS_CONFIRM=True
+exec($(carapace _carapace))
+
+@aliases.register
+@aliases.return_command
+def _lfcd(args):
+ # This returns a command
+ # The outer $() runs a subshell, very similar to bash and co.
+ # The @$(cmd) is a shorthand for @([i.strip() for i in $(cmd).split()]).
+ # Essentially, it runs the output of the command as a command.
+ # In this case, `which -s lf` gets the `lf` binary,
+ # rather than the alias defined below.
+ return ['cd', $(@$(which -s lf) -print-last-dir @(args))]
+
+aliases['lf'] = 'lfcd'