Allow reading manpages by using F1. #1063

Closed
wants to merge 2 commits into
from

Conversation

Projects
None yet
5 participants
@xfix
Member

xfix commented Oct 27, 2013

Just a small fun feature I have implemented in order to ease discovering command prompt. Just like in graphical applications, and some text interface programs (like vim, mc, emacs) it allows you to get help, in this case, help for currently typed command by simply pressing F1. I believe it could be helpful in many cases, for example if you want more detailed documentation than what Tab completion provides.

(also, yes, I added this to my personal bindings, and I like this)

@zanchey

This comment has been minimized.

Show comment
Hide comment
@zanchey

zanchey Oct 29, 2013

Member

That's pretty cool.

Member

zanchey commented Oct 29, 2013

That's pretty cool.

@smidm

This comment has been minimized.

Show comment
Hide comment
@smidm

smidm Oct 30, 2013

Really cool! I just added that to my config.fish.

smidm commented Oct 30, 2013

Really cool! I just added that to my config.fish.

@siteshwar

This comment has been minimized.

Show comment
Hide comment
@siteshwar

siteshwar Oct 31, 2013

Member

Ship it!

EDIT:
There's a bug in the command which is used to show manpage. If I have a binary a.out in my current directory and type ./a.out and press F1, it will print binary data on screen.

Member

siteshwar commented Oct 31, 2013

Ship it!

EDIT:
There's a bug in the command which is used to show manpage. If I have a binary a.out in my current directory and type ./a.out and press F1, it will print binary data on screen.

@zanchey

This comment has been minimized.

Show comment
Hide comment
@zanchey

zanchey Nov 3, 2013

Member

What about using man (basename (commandline -po)[1]) instead? That avoids passing a path to man.

Member

zanchey commented Nov 3, 2013

What about using man (basename (commandline -po)[1]) instead? That avoids passing a path to man.

Use basename for man argument
This protects from providing paths to man, like `./a.out`.
@zanchey

This comment has been minimized.

Show comment
Hide comment
@zanchey

zanchey Nov 9, 2013

Member

Merged with rebase:

To git@github.com:fish-shell/fish-shell.git
fe3bca3..ba2fcd9 master -> master

Documented at 63d93a2.

Unfortunately a few terminals bind F1 to their own nefarious purposes, but most people should be able to use this.

Member

zanchey commented Nov 9, 2013

Merged with rebase:

To git@github.com:fish-shell/fish-shell.git
fe3bca3..ba2fcd9 master -> master

Documented at 63d93a2.

Unfortunately a few terminals bind F1 to their own nefarious purposes, but most people should be able to use this.

@zanchey zanchey closed this Nov 9, 2013

@nafg

This comment has been minimized.

Show comment
Hide comment
@nafg

nafg Jul 22, 2015

This is great!
It would be even better if it would work with subcommands. E.g. git checkout should go to man git checkout

nafg commented Jul 22, 2015

This is great!
It would be even better if it would work with subcommands. E.g. git checkout should go to man git checkout

@zanchey zanchey deleted the help branch Feb 24, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment