forked from ohmyzsh/ohmyzsh
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
227 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
locals.zsh | ||
log/.zsh_history | ||
projects.zsh | ||
custom/* | ||
!custom/example | ||
!custom/example.zsh | ||
custom/example | ||
custom/example.zsh | ||
*.swp | ||
!custom/example.zshcache | ||
cache/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# ------------------------------------------------------------------------------ | ||
# FILE: sfffe.plugin.zsh | ||
# DESCRIPTION: search file for FE | ||
# AUTHOR: yleo77 (ylep77@gmail.com) | ||
# VERSION: 0.1 | ||
# REQUIRE: ack | ||
# ------------------------------------------------------------------------------ | ||
|
||
if [ ! -x $(which ack) ]; then | ||
echo \'ack\' is not installed! | ||
exit -1 | ||
fi | ||
|
||
ajs() { | ||
ack "$@" --type js | ||
} | ||
|
||
acss() { | ||
ack "$@" --type css | ||
} | ||
|
||
fjs() { | ||
find ./ -name "$@*" -type f | grep '\.js' | ||
} | ||
|
||
fcss() { | ||
find ./ -name "$@*" -type f | grep '\.css' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Easily jump around the file system by manually adding marks | ||
# marks are stored as symbolic links in the directory $MARKPATH (default $HOME/.marks) | ||
# | ||
# jump FOO: jump to a mark named FOO | ||
# mark FOO: create a mark named FOO | ||
# unmark FOO: delete a mark | ||
# marks: lists all marks | ||
# | ||
export MARKPATH=$HOME/.marks | ||
|
||
jump() { | ||
cd -P "$MARKPATH/$1" 2>/dev/null || echo "No such mark: $1" | ||
} | ||
|
||
mark() { | ||
if (( $# == 0 )); then | ||
MARK=$(basename "$(pwd)") | ||
else | ||
MARK="$1" | ||
fi | ||
if read -q \?"Mark $(pwd) as ${MARK}? (y/n) "; then | ||
mkdir -p "$MARKPATH"; ln -s "$(pwd)" "$MARKPATH/$MARK" | ||
fi | ||
} | ||
|
||
unmark() { | ||
rm -i "$MARKPATH/$1" | ||
} | ||
|
||
autoload colors | ||
marks() { | ||
for link in $MARKPATH/*(@); do | ||
local markname="$fg[cyan]${link:t}$reset_color" | ||
local markpath="$fg[blue]$(readlink $link)$reset_color" | ||
printf "%s\t" $markname | ||
printf "-> %s \t\n" $markpath | ||
done | ||
} | ||
|
||
_completemarks() { | ||
if [[ $(ls "${MARKPATH}" | wc -l) -gt 1 ]]; then | ||
reply=($(ls $MARKPATH/**/*(-) | grep : | sed -E 's/(.*)\/([_\da-zA-Z\-]*):$/\2/g')) | ||
else | ||
if readlink -e "${MARKPATH}"/* &>/dev/null; then | ||
reply=($(ls "${MARKPATH}")) | ||
fi | ||
fi | ||
} | ||
compctl -K _completemarks jump | ||
compctl -K _completemarks unmark | ||
|
||
_mark_expansion() { | ||
setopt extendedglob | ||
autoload -U modify-current-argument | ||
modify-current-argument '$(readlink "$MARKPATH/$ARG")' | ||
} | ||
zle -N _mark_expansion | ||
bindkey "^g" _mark_expansion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Allow SSH tab completion for mosh hostnames | ||
compdef mosh=ssh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
# Open the node api for your current version to the optional section. | ||
# TODO: Make the section part easier to use. | ||
function node-docs { | ||
open "http://nodejs.org/docs/$(node --version)/api/all.html#all_$1" | ||
# get the open command | ||
local open_cmd | ||
if [[ $(uname -s) == 'Darwin' ]]; then | ||
open_cmd='open' | ||
else | ||
open_cmd='xdg-open' | ||
fi | ||
|
||
$open_cmd "http://nodejs.org/docs/$(node --version)/api/all.html#all_$1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#compdef nvm | ||
#autoload | ||
|
||
[[ -s ~/.nvm/nvm.sh ]] || return 0 | ||
|
||
local -a _1st_arguments | ||
_1st_arguments=( | ||
'help:show help' | ||
'install:download and install a version' | ||
'uninstall:uninstall a version' | ||
'use:modify PATH to use version' | ||
'run:run version with given arguments' | ||
'ls:list installed versions or versions matching a given description' | ||
'ls-remote:list remote versions available for install' | ||
'deactivate:undo effects of NVM on current shell' | ||
'alias:show or set aliases' | ||
'unalias:deletes an alias' | ||
'copy-packages:install global NPM packages to current version' | ||
) | ||
|
||
_arguments -C '*:: :->subcmds' && return 0 | ||
|
||
if (( CURRENT == 1 )); then | ||
_describe -t commands "nvm subcommand" _1st_arguments | ||
return | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# The addition 'nvm install' attempts in ~/.profile | ||
|
||
[[ -s ~/.nvm/nvm.sh ]] && . ~/.nvm/nvm.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.