summaryrefslogtreecommitdiffstats
path: root/.local/bin/shortcuts
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/shortcuts')
-rwxr-xr-x.local/bin/shortcuts18
1 files changed, 16 insertions, 2 deletions
diff --git a/.local/bin/shortcuts b/.local/bin/shortcuts
index 08a2f57..9b9feb7 100755
--- a/.local/bin/shortcuts
+++ b/.local/bin/shortcuts
@@ -1,7 +1,9 @@
#!/bin/sh
bmdirs="${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs"
+bmdirs_eibhear="${XDG_CONFIG_HOME:-$HOME/.config}/shell/eibhear/bm-dirs"
bmfiles="${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-files"
+bmfiles_eibhear="${XDG_CONFIG_HOME:-$HOME/.config}/shell/eibhear/bm-files"
# Output locations. Unactivated progs should go to /dev/null.
shell_shortcuts="${XDG_CONFIG_HOME:-$HOME/.config}/shell/shortcutrc"
@@ -20,8 +22,14 @@ printf "# vim: filetype=sh\\nalias " > "$shell_shortcuts"
printf "# vim: filetype=sh\\n" > "$shell_env_shortcuts"
printf "\" vim: filetype=vim\\n" > "$vifm_shortcuts"
+# Enable nesting
+eval "echo \"$(cat "$bmdirs" "$bmdirs_eibhear")\"" | \
+awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
+ printf(\"[ -n \42%s\42 ] && export %s=\42%s\42 \n\",\$1,\$1,\$2) >> \"$shell_env_shortcuts\" }"
+source "$shell_env_shortcuts"
+
# Format the `directories` file in the correct syntax and sent it to all three configs.
-eval "echo \"$(cat "$bmdirs")\"" | \
+eval "echo \"$(cat "$bmdirs" "$bmdirs_eibhear")\"" | \
awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
printf(\"%s=\42cd %s && ls -A\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ;
printf(\"[ -n \42%s\42 ] && export %s=\42%s\42 \n\",\$1,\$1,\$2) >> \"$shell_env_shortcuts\" ;
@@ -32,8 +40,14 @@ awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
printf(\"map C%s cd \42%s\42 \n\",\$1,\$2) >> \"$lf_shortcuts\" ;
printf(\"cmap ;%s %s\n\",\$1,\$2) >> \"$vim_shortcuts\" }"
+# Enable nesting
+eval "echo \"$(cat "$bmfiles" "$bmfiles_eibhear")\"" | \
+awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
+ printf(\"[ -n \42%s\42 ] && export %s=\42%s\42 \n\",\$1,\$1,\$2) >> \"$shell_env_shortcuts\" }"
+source "$shell_env_shortcuts"
+
# Format the `files` file in the correct syntax and sent it to both configs.
-eval "echo \"$(cat "$bmfiles")\"" | \
+eval "echo \"$(cat "$bmfiles" "$bmfiles_eibhear")\"" | \
awk "!/^\s*#/ && !/^\s*\$/ {gsub(\"\\\s*#.*$\",\"\");
printf(\"%s=\42\$EDITOR %s\42 \\\\\n\",\$1,\$2) >> \"$shell_shortcuts\" ;
printf(\"[ -n \42%s\42 ] && export %s=\42%s\42 \n\",\$1,\$1,\$2) >> \"$shell_env_shortcuts\" ;