
Show HN: Jumpfiles – get more done with fewer keystrokes - verdverm
https://github.com/hofstadter-io/jumpfiles/blob/master/README.md
======
Toutouxc
So I've read through the README and I still have no idea how it works or what
it even is. Is this a concept I should've heard of before or is it related to
some other project/concept?

~~~
IggleSniggle
I get it because I do something similar: I discover I have some command
(`annoyingly long but repeatable command `) that I run in a particular repo
(`repo\over\there`) frequently. For me, I then alias switching to that repo
with a 1-3 letter sequence: `rot` and the command to `alc` (annoyingly long
but repeatable command). Often I want these to be semipermanent so the aliases
are added to my bashrc.

This project looks like it is streamlining and organizing-per-project this
kind of workflow / preference for short aliases, with helpful conventions like
"?" that act sort of like a tab-completion hint.

~~~
LeonB
You might like ok-bash. ([https://github.com/secretGeek/ok-
bash](https://github.com/secretGeek/ok-bash))

In any folder, you put all your favorite One-liners for that folder into a
file called “.ok”.

Then you can run them command with “ok 1” for the first command, or “ok 2” for
the second command, etc. Use “ok” by itself to pretty-print all the available
commands in that folder.

I started the project but my friend @doekeman took it waaay further than I
ever dreamed.

It’s really helpful if you have a bunch of different projects that you work
on, and need a way to remember all their different commands and incantations.

There’s a Powershell version too (ok-ps).

For there bit where I jump around from one project to another I use a system
called markjump. It’s great too.

~~~
Kaze404
Seems pretty useful, but isn't that basically a makefile?

~~~
LeonB
Lol. I have heard that from people who haven’t used it.

It’s lighter-weight. Not as cryptic. Can also hook it up to your makefile
targets, make them easier to access.

The other thing people say is “isn’t that same as npm scripts?” — it can
complement those as well.

I modify “cd” so that on entering any folder it shows me the available .ok
commands, if any.

~~~
sorbits
_It’s lighter-weight. Not as cryptic. Can also hook it up to your makefile
targets, make them easier to access._

The only additional “weight” in the Makefile would be the name of the target,
where you leave it out and have it default to 1, 2, … n, which I would argue
is more cryptic, as “make build” or “make deploy” is always doing that action,
whereas “ok 2” could be deploy in one folder, and push in another.

As for easy access, most shells should offer you tab completion for the
Makefile’s targets, and your development environment may also pick up the
existence of the Makefile and offer a way to run the targets.

Additionally Makefiles allow to setup dependencies, for example in your ok
file example you have ./build.sh and ./deploy.sh as two actions: Clearly build
should be a dependency of deploy, so “make deploy” implies building, rather
than having to always do “ok 1 && ok 2”.

Lastly there is the ability to do dry-runs with Makefiles, once you start to
setup dependencies…

~~~
LeonB
You haven’t used or experienced .ok files and are seeing them as a competitor
to makefiles and being very defensive. They’re not a competitor to makefiles.

With ok you can also name the commands. It’s optional.

I would suggest using both, in a project that involves building, if you are
already comfortable with makefiles. You may also have npm scripts, again I’d
suggest both. You’ll probably find it quite comfortable and fun.

Makefiles have more features but bring with them more complexity and nuance,
for example the dependency features, which are useful for making but a
hindrance for a lot of other project tasks. When I show a “getting started
with makefiles” guide to my documentation friend they look at me like I’m
insane. It is truly cryptic to the uninitiated. But you already understand
makefiles, so try using both.

~~~
sorbits
_But you already understand makefiles, so try using both_

What is it that ok files can do that Makefiles don’t?

I don’t buy your complexity argument, a Makefile can be as simple as:

    
    
      1:
        ./build.sh
    

Now you can run “make 1” and you have the same as “ok 1”.

Although most people would name this “build” rather than “1”, so you “make
build”.

And the equivalent ok file would be:

    
    
      build: ./build.sh
    

So the only syntactical difference is that make require a newline after the
colon.

~~~
doekezanstra
The thing ok can do what make can't, is work on the current shell. With ok,
you can:

* navigate to another folder/directory * set an environment variable

I use both make and ok. For me, if I want to "make" stuff, I use make
(compile, sign, zip, deploy etc.). The ok-files, I use for ad-hoc stuff, like
viewing log files). It's also a good command's I can't seem to remember. A bit
less structured.

So I guess it's not only a technical difference, but also a slightly
conceptual difference.

I must say I do have a lot of (rather) small git-repo's I work on. And not
every day. So when I switch to some kind of project, it helps me work faster.
But your situation might differ...

------
lqet
> quickly create, refresh, and run terminal "shortcuts" for common commands
    
    
      $ alias shortcut='common command'
    

> jump around the filesystem
    
    
      $ r='/long/complicated/dir'
      $ cd $r
      $ pwd
      /long/complicated/dir
    

> chain them together
    
    
      $ a=echo
      $ b=hello
      $ $a $b
      hello
    

So what exactly is the added value here? Is it a manager for shortcuts?
Persistence?

~~~
verdverm
Quickly editing, reloading, and refreshing from anywhere. Also the persistence
between shells and a dot file loading.

Another nice thing is you environment bar secrets are only exposed during
command execution when they are needed. (See how the .jumpfiles.secrets.sh is
used) It's also largely an experimentation ground for some upcoming Hof
features.

------
mrtobo
Add some usage examples if you really wanna communicate the value of this. I
recommend video.

------
quest88
Keystrokes aren't slowing me down at work. It's shitty debugging, long build
and test times. Keystrokes are negligible.

~~~
verdverm
See our Hof project, working on that too.

Jumpfiles got ephemeral VMs and k8s last night, so if you want to enable
consistent dev envs and debugging, there are some options. Email me if you'd
like to know more about what we are planning and some of the more leading edge
capabilities.

------
hprotagonist
I use:

\- direnv ([https://direnv.net](https://direnv.net)) for project-specific
environment variable management and more

\- fzf ([https://github.com/junegunn/fzf](https://github.com/junegunn/fzf))
for rifling through history and finding files quickly.

\- z ([https://github.com/agkozak/zsh-z](https://github.com/agkozak/zsh-z)) to
partial-match on a frequency-weighted directory switch (eg, `z Proj <RET>`
will move me to `$HOME/Code/Projects/`.

~~~
sorbits
For the last one, worth mentioning CDPATH:

 _CDPATH The search path for the cd command. This is a colon-separated list of
directories in which the shell looks for destination directories specified by
the cd command. A sample value is ".:~:/usr"._

This works with tab completion.

------
simon1573
I have been using this since last it featured at the frontpage. It's great for
jumping to different projects etc.

~~~
verdverm
Just pushed a new version,ales it much easier to plugin your own custom stuff.
Still need a good example of this on GitHub...

Take. A look at the Hof leap, there are some examples of jumping to a dir,
found something, and then hopping back to where you were. Super useful for
building tools you are working on but don't need the extra shell session

------
verdverm
For anyone interested, we added some bounties so you can make money
contributing to Jumpfiles and our other open source projects. I personally
made my independent start freelancing and would now like to support others.

------
ARandomerDude
Check out `z`. It manages long paths automatically so you can cd quickly. One
of the best tools I've come across.

[https://github.com/rupa/z](https://github.com/rupa/z)

