Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions sack
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ process_shorcut_paths() {
# Using : as the delimiter here should be fine, because : is not used in file names
awk -F':' '
{
print $2 " " $1;
print $2 ";" $1;
};'
}

Expand All @@ -152,8 +152,17 @@ create_shortcut_cmd() {
# The following literally writes the shorcut command and makes it executable
sack__shortcut_cmd_path=~/bin/$sack__shortcut_cmd
echo "#!/bin/bash" > $sack__shortcut_cmd_path
echo "sack__vim_shortcut=\$(sed -n \"\$1p\" < $sack__shortcut_file)" >> $sack__shortcut_cmd_path
echo "$sack__default_editor +\$sack__vim_shortcut" >> $sack__shortcut_cmd_path
echo "OIFS=\$IFS" >> $sack__shortcut_cmd_path
echo "IFS=';'" >> $sack__shortcut_cmd_path
echo "read -a sack__editor_shortcut <<< \"\$(sed -n \"\$1p\" < $sack__shortcut_file)\"" >> $sack__shortcut_cmd_path
echo "IFS=\$OIFS" >> $sack__shortcut_cmd_path

if [[ $sack__default_editor == vi* ]] || [[ $sack__default_editor == emacs* ]]; then
echo "$sack__default_editor +\${sack__editor_shortcut[0]} \${sack__editor_shortcut[1]}" >> $sack__shortcut_cmd_path
elif [[ $sack__default_editor == subl* ]]; then
echo "$sack__default_editor \${sack__editor_shortcut[1]}:\${sack__editor_shortcut[0]} &" >> $sack__shortcut_cmd_path
fi

chmod +x $sack__shortcut_cmd_path
}

Expand Down