BashRC: Corrected the project-aliases and moved mpx to vendors. VimRC: Added snippets for Ruby.

Signed-off-by: Hermann Mayer's avatarHermann Mayer <hermann.mayer92@gmail.com>
parent be27b1a3
snippet stop
context('stop') { it { exit } }
......@@ -5,7 +5,7 @@
# $1 - The search path, Default: CWD
ROOT_FILES=".editorconfig\|README*\|Makefile\|.gitlab-ci.yml\|.gitignore"
EXCLUDE_WORDS1="0ld|old|wiki|test|dist|src|deploy|vendor|config|build|backup"
EXCLUDE_WORDS1="0ld|\/old|wiki|\/test|\/dist|src|deploy|vendor|config|build|backup"
EXCLUDE_WORDS2="tmp$|log$|doc$"
EXCLUDE_PATTERNS="\/\.|(\/[a-z0-9]\/)|(\/[a-z]{0,2}$)"
EXCLUDE="${EXCLUDE_WORDS1}|${EXCLUDE_WORDS2}|${EXCLUDE_PATTERNS}"
......@@ -20,13 +20,13 @@ fi
# Find all project roots, let only the unique pass and sort out all excludes
find . -maxdepth ${SEARCH_DEPTH} -type f \
-regex ".*\(${ROOT_FILES}\)" \
| rev | cut -d '/' -f2- | rev \
| grep -viP "${EXCLUDE}" \
| sort -u \
| while IFS='' read path; do
alias=$(echo "${path}" | rev | cut -d '/' -f-2 | rev \
| sed 's#^./##g' | sed 's#[^A-Za-z0-9]#-#g' \
| tr '[:upper:]' '[:lower:]')
printf "alias p-%s='cd \"%s\"';\n" "${alias}" "$(readlink -f "${path}")"
-regex ".*\(${ROOT_FILES}\)" \
| rev | cut -d '/' -f2- | rev \
| grep -viP "${EXCLUDE}" \
| sort -u \
| while IFS='' read path; do
alias=$(echo "${path}" | rev | cut -d '/' -f-2 | rev \
| sed 's#^./##g' | sed 's#[^A-Za-z0-9]#-#g' \
| tr '[:upper:]' '[:lower:]')
printf "alias p-%s='cd \"%s\"';\n" "${alias}" "$(readlink -f "${path}")"
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment