mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-06-05 05:03:16 +02:00
Merge 8dd8e86139 into 55ab532e50
This commit is contained in:
commit
716153ed6f
2 changed files with 49 additions and 0 deletions
7
plugins/bem/README.md
Normal file
7
plugins/bem/README.md
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
# BEM autocomplete plugin
|
||||||
|
Adds autocomplete options for bem-tools — toolkit to work with files based on BEM methodology
|
||||||
|
http://bem.info/tools/bem/
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
In order to make this work, you will need to install bem-tools. See https://github.com/bem/bem-tools for details
|
||||||
42
plugins/bem/_bem
Normal file
42
plugins/bem/_bem
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
###-begin-bem-completion-###
|
||||||
|
#
|
||||||
|
# bem command completion script
|
||||||
|
#
|
||||||
|
# Installation: bem completion >> ~/.bashrc (or ~/.zshrc)
|
||||||
|
# Or, maybe: bem completion > /usr/local/etc/bash_completion.d/bem
|
||||||
|
#
|
||||||
|
|
||||||
|
COMP_WORDBREAKS=${COMP_WORDBREAKS/=/}
|
||||||
|
COMP_WORDBREAKS=${COMP_WORDBREAKS/@/}
|
||||||
|
export COMP_WORDBREAKS
|
||||||
|
|
||||||
|
if complete &>/dev/null; then
|
||||||
|
_bem_completion () {
|
||||||
|
local si="$IFS"
|
||||||
|
IFS=$'\n' COMPREPLY=($(COMP_CWORD="$COMP_CWORD" \
|
||||||
|
COMP_LINE="$COMP_LINE" \
|
||||||
|
COMP_POINT="$COMP_POINT" \
|
||||||
|
bem completion -- "${COMP_WORDS[@]}" \
|
||||||
|
2>/dev/null)) || return $?
|
||||||
|
IFS="$si"
|
||||||
|
}
|
||||||
|
complete -F _bem_completion bem
|
||||||
|
elif compctl &>/dev/null; then
|
||||||
|
_bem_completion () {
|
||||||
|
local cword line point words si
|
||||||
|
read -Ac words
|
||||||
|
read -cn cword
|
||||||
|
let cword-=1
|
||||||
|
read -l line
|
||||||
|
read -ln point
|
||||||
|
si="$IFS"
|
||||||
|
IFS=$'\n' reply=($(COMP_CWORD="$cword" \
|
||||||
|
COMP_LINE="$line" \
|
||||||
|
COMP_POINT="$point" \
|
||||||
|
bem completion -- "${words[@]}" \
|
||||||
|
2>/dev/null)) || return $?
|
||||||
|
IFS="$si"
|
||||||
|
}
|
||||||
|
compctl -K _bem_completion bem
|
||||||
|
fi
|
||||||
|
###-end-bem-completion-###
|
||||||
Loading…
Add table
Add a link
Reference in a new issue