diff options
Diffstat (limited to 'plugins/fastfile/fastfile.plugin.zsh')
-rw-r--r-- | plugins/fastfile/fastfile.plugin.zsh | 39 |
1 files changed, 14 insertions, 25 deletions
diff --git a/plugins/fastfile/fastfile.plugin.zsh b/plugins/fastfile/fastfile.plugin.zsh index 775e9483e..a4229e4c2 100644 --- a/plugins/fastfile/fastfile.plugin.zsh +++ b/plugins/fastfile/fastfile.plugin.zsh @@ -1,15 +1,5 @@ -################################################################################ -# FILE: fastfile.plugin.zsh -# DESCRIPTION: oh-my-zsh plugin file. -# AUTHOR: Michael Varner (musikmichael@web.de) -# VERSION: 1.0.0 -# -# This plugin adds the ability to on the fly generate and access file shortcuts. -# -################################################################################ - ########################### -# Settings +# Settings # These can be overwritten any time. # If they are not set yet, they will be @@ -33,7 +23,7 @@ default fastfile_var_prefix "ยง" function fastfile() { test "$2" || 2="." file=$(readlink -f "$2") - + test "$1" || 1="$(basename "$file")" name=$(echo "$1" | tr " " "_") @@ -51,7 +41,7 @@ function fastfile() { # Arguments: # 1. name - The name of the shortcut # STDOUT: -# The path +# The path to the shortcut file # function fastfile_resolv() { echo "${fastfile_dir}${1}" @@ -88,12 +78,12 @@ function fastfile_print() { # (=> fastfle_print) for each shortcut # function fastfile_ls() { - for f in "${fastfile_dir}"/*; do - file=`basename "$f"` # To enable simpler handeling of spaces in file names - varkey=`echo "$file" | tr " " "_"` + for f in "${fastfile_dir}"/*; do + file=`basename "$f"` # To enable simpler handeling of spaces in file names + varkey=`echo "$file" | tr " " "_"` - # Special format for colums - echo "${fastfile_var_prefix}${varkey}|->|$(fastfile_get "$file")" + # Special format for colums + echo "${fastfile_var_prefix}${varkey}|->|$(fastfile_get "$file")" done | column -t -s "|" } @@ -102,7 +92,6 @@ function fastfile_ls() { # # Arguments: # 1. name - The name of the shortcut (default: name of the file) -# 2. file - The file or directory to make the shortcut for # STDOUT: # => fastfle_print # @@ -115,11 +104,11 @@ function fastfile_rm() { # Generate the aliases for the shortcuts # function fastfile_sync() { - for f in "${fastfile_dir}"/*; do - file=`basename "$f"` # To enable simpler handeling of spaces in file names - varkey=`echo "$file" | tr " " "_"` + for f in "${fastfile_dir}"/*; do + file=`basename "$f"` # To enable simpler handeling of spaces in file names + varkey=`echo "$file" | tr " " "_"` - alias -g "${fastfile_var_prefix}${varkey}"="'$(fastfile_get "$file")'" + alias -g "${fastfile_var_prefix}${varkey}"="'$(fastfile_get "$file")'" done } @@ -133,6 +122,6 @@ alias ffls=fastfile_ls alias ffsync=fastfile_sync ################################## -# Init +# Init -fastfile_sync
\ No newline at end of file +fastfile_sync |