Table of Contents
NAME
goto
AUTHOR
Francis Grizzly Smit (grizzly@smit.id.au)
VERSION
v0.1.71
TITLE
goto
SUBTITLE
GOTO is a cd alternative that acts like a database of bookmarks to different places in the directory tree.
COPYRIGHT
LGPL V3.0+ LICENSE
Top of Document
Introduction
GOTO is a mixture of a Raku app path.raku and a module Paths.rakumod (implemented separately) that implements it and a set of scripts to apply them inside a shell instance This is important as you need the scripts to call cd from within the shell process in order to actually change it's current directory otherwise we would only change a subprocesses current directory and then nothing would have been achieved on exit. The scripts are applied by running goto-init init [--shell=SHELL] [--config=CONFIG-FILE].
run
$ goto init --shell=SHELL --config=CONFIGFILE
where
NB: no other shells are supported at this time.
See gzz-goto/gt.
multi sub MAIN(Str:D $key --> int)
multi sub MAIN(Str:D $key, Bool:D :v(:$version) = False,
Bool:D :h(:$help) = False,
Bool:D :n(:nocolor(:$nocolour)) = False --> int){
if $help {
my %named-args;
my @args;
say-coloured($*USAGE, $nocolour, |%named-args, |@args);
exit 0;
}
if $version {
say version();
exit 0;
}
say path($key);
return 0;
}
Top of Document
GOTO
Basics from github
To set up the underpinings
cd <path>
git clone https://github.com/grizzlysmit/gzz-goto.git
cd
mkdir rakulib
cd rakulib
ln -s <path>/gzz-goto/rakulib/Paths.rakumod
cd
mkdir bin
cd bin
ln -s <path>/gzz-goto/bin/paths.raku
where path is the path you have chosen to clone the github repository to.
- make sure $HOME/bin is in your search path, and also raku needs to be installed.
config files
if you have sysamin privaliges you may want to put config files in /etc/skel/.local/share/paths/
just run
sudo cp -rv <path>/.local/ /etc/skel/
To use from bash
cd
ln -s <path>/gzz-goto/bash_aliases ~/.goto_bash_aliases
or
ln -s <path>/gzz-goto/bash_aliases ~/.prefered_name
and adjust bellow.
gvim -p ~/.bashrc
# or use another editor of your choice.
add
if [ -e "$HOME/.goto_bash_aliases" ]
then
# shellcheck disable=SC1090
source ~/.goto_bash_aliases
fi
line # shellcheck disable=SC1090 for those who use shellcheck linter ideally you should use it or something equivalent
To use from elvish
use epm
epm:install github.com/grizzlysmit/gzz-goto
add this to your rc.elv
- these four lines are optional if you have done the epm:install above then this is redundant but if you want your rc.elv to be portable then add them anyway
use epm
epm:install &silent-if-installed ^
github.com/grizzlysmit/gzz-goto
- definately add these lines.
use github.com/grizzlysmit/gzz-goto/gt
fn goto {|@_args|
gt:goto $@_args
}