summaryrefslogtreecommitdiff
path: root/.config/shells/utils/cpwdrc
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-02-21 17:11:05 -0500
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-02-21 17:11:05 -0500
commit960a05363ae9c0b767d57405cfffe9f8a6b021cd (patch)
tree41aca6d3abd2aa7408b2c24f4f9ff0c08ad475cb /.config/shells/utils/cpwdrc
parent8276fb9c65e40605f7d56dac3326b3f9f90c615d (diff)
refactor(zsh): Restructured common shell files
Restructured common shell files to be in a utils directory. Operating System specific files are in the util/OS_NAME/ directories.
Diffstat (limited to '.config/shells/utils/cpwdrc')
-rwxr-xr-x.config/shells/utils/cpwdrc10
1 files changed, 10 insertions, 0 deletions
diff --git a/.config/shells/utils/cpwdrc b/.config/shells/utils/cpwdrc
new file mode 100755
index 0000000..d3b9ec4
--- /dev/null
+++ b/.config/shells/utils/cpwdrc
@@ -0,0 +1,10 @@
+#!/bin/sh
+## Collapsed Directory
+_collapsed_pwd() {
+ pwd | perl -pe '
+ BEGIN {
+ binmode STDIN, ":encoding(UTF-8)";
+ binmode STDOUT, ":encoding(UTF-8)";
+ }; s|^$ENV{HOME}|~|g; s|/([^/.])[^/]*(?=/)|/$1|g; s|/\.([^/])[^/]*(?=/)|/.$1|g
+'
+}