mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-26 02:12:33 +01:00
finally added what belongs here
This commit is contained in:
parent
277507e6e3
commit
b9fe362216
2 changed files with 41 additions and 0 deletions
11
custom/emacs.zsh
Normal file
11
custom/emacs.zsh
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/zsh
|
||||
|
||||
# Emacs
|
||||
function em() {
|
||||
emacs $@ &>/dev/null &!
|
||||
}
|
||||
|
||||
# Emacs client
|
||||
function emc() {
|
||||
emacsclient -n $@
|
||||
}
|
||||
30
custom/go.zsh
Normal file
30
custom/go.zsh
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
#!/bin/zsh
|
||||
|
||||
function project() {
|
||||
cmd="cd"
|
||||
file=$1
|
||||
|
||||
if [[ "open" == "$file" ]] then
|
||||
file=$2
|
||||
cmd=(${(s: :)EDITOR})
|
||||
fi
|
||||
|
||||
for project in $PROJECT_PATHS; do
|
||||
if [[ -d $project/$file ]] then
|
||||
$cmd "$project/$file"
|
||||
unset project # Unset project var
|
||||
return
|
||||
fi
|
||||
done
|
||||
|
||||
echo "No such project $1"
|
||||
}
|
||||
|
||||
alias p="project"
|
||||
alias m="project open"
|
||||
|
||||
function _project () {
|
||||
compadd `/bin/ls -l $PROJECT_PATHS 2>/dev/null | awk '{ print $8 }'`
|
||||
}
|
||||
|
||||
compdef _project project
|
||||
Loading…
Add table
Add a link
Reference in a new issue