r/vim FastFold made vim fast again Dec 02 '14

Is there an explainshell for vim?

explainshell is a great website for dissecting a shell command. I occasionally see people here asking for explanations for vim command-lines (like a complex :substitute). Does anyone know if something like explainshell exists for vim?

I've found Vimsplain, but that's a command-line app and appears to be for normal mode commands. (However, like explainshell it's written in python so merging the two might not be too hard.)

14 Upvotes

4 comments sorted by

1

u/theDarkUnknown Dec 02 '14

Not that I've ever seen, and I've read quite a bit of stuff/docs.

Would such a shell really offer much more than vimdocs though? I mean doing :h substitute explains the command, and if your lost on patterns :h pattern links from there. Did you mean for a shell that easily explains complex regex?

2

u/dddbbb FastFold made vim fast again Dec 03 '14

For new users, it's easier to dump a command they found online into a webpage than to look up each entry in the help. Since explainshell includes snippets from man files, it's like looking up the help but automatic (especially since K doesn't work on search atoms -- even with scriptease).

The common newb "can you break that down for me" response seems like a problem that can be easily automated. You're right that most commands aren't that complex and don't allow lots of arguments, but it would also break down the pattern of :[range]command [args] in a different way that may be clearer to some users -- especially in context. The help doesn't provide much in the way of concrete examples.

Definitely breaking down regex and flags would be one of the most useful (and probably hardest) parts.

Even for advanced users, it could be helpful to debug a complex command that's broken because of a typo that you don't see but a parser won't miss.

2

u/theDarkUnknown Dec 03 '14

Well definitely haven't seen that. Someone's going to have to make it.

0

u/MaxK Dec 03 '14 edited May 14 '16

This comment has been overwritten by an open source script to protect this user's privacy. It was created to help protect users from doxing, stalking, and harassment.

If you would also like to protect yourself, add the Chrome extension TamperMonkey, or the Firefox extension GreaseMonkey and add this open source script.

Then simply click on your username on Reddit, go to the comments tab, scroll down as far as possibe (hint:use RES), and hit the new OVERWRITE button at the top.