diff options
author | self <george@gabbott.dev> | 2023-01-01 03:00:50 +0000 |
---|---|---|
committer | self <george@gabbott.dev> | 2023-01-01 03:00:50 +0000 |
commit | 7dfe2a5690abdce4c9b18b1bfee89ee190d292f9 (patch) | |
tree | d011af163a9c074e76bbe08202217a7b72c2112e | |
parent | fbd5fd6cf9e078bcdeb576218bf0300ae2ad245d (diff) |
intokebab
-rw-r--r-- | zsh/.zshrc-fn | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/zsh/.zshrc-fn b/zsh/.zshrc-fn index 526b435..0d7e707 100644 --- a/zsh/.zshrc-fn +++ b/zsh/.zshrc-fn @@ -24,3 +24,8 @@ sv() { pvd() { mpv *$1* } + +# Change a string into its kebab style, e.g. all-lower-case-with-dashes. +intokebab() { + echo "$1" | tr ' ' '-' | tr '[:upper:]' '[:lower:]' | sed 's/[^a-zA-Z-]//g' +} |