Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lfrc.example: Add example mkdir binding, "show execution result" command #1188

Merged
merged 1 commit into from Apr 8, 2023

Conversation

ilyagr
Copy link
Collaborator

@ilyagr ilyagr commented Apr 2, 2023

Let me know if any of this makes you unhappy; I'm happy to only do
some of these things if people prefer.

The mkdir portion is an attempt to substitute for #1179.

Show how to map a to mkdir. ` maps to "show execution
result". Norton Commander & its successors map it to <c-o>,
but I think that's better for something opening-relatred.

Whenever a $ command gives an unexpected error, I want to see
what happened. There are many ways to do so, but the one I added
here seems the simplest and it took me a while to think of it.
We could also have an option to have $ commands pause like !
commands when there's an error.
Fixes #887

etc/lfrc.example Outdated Show resolved Hide resolved
@gokcehan
Copy link
Owner

gokcehan commented Apr 2, 2023

@ilyagr Thank you for the example.

I have left a comment regarding the example configuration in general to #1179 .

Regarding this PR, I'm not a fan of wrapping such commands in custom commands as parameter semantics might be confusing for some users (see #1175 for a recent example). It seems that it is also not possible to create multiple directories with this command which I think could be as useful as selection. Previously I guess :rename is used for the example since there is already a special command. I don't think it is particularly a good example though so it is left commented out. Instead of replacing the :rename example I think it could be more useful to add an extra mapping for the pipe-shell version of mkdir (e.g. map a :push %mkdir<space>) as we don't have such an example yet in the example configuration.

Dropping to shell with true seems interesting so I guess we can keep it.

Show how to map `a` to mkdir. `` ` `` maps to "show execution
result". Norton Commander & its successors map it to `<c-o>`,
but I think that's better for something opening-relatred.

Whenever a `$` command gives an unexpected error, I want to see
what happened. There are many ways to do so, but the one I added
here seems the simplest and it took me a while to think of it.
We could also have an option to have `$` commands pause like `!`
commands when there's an error.
@ilyagr
Copy link
Collaborator Author

ilyagr commented Apr 3, 2023

I think it could be more useful to add an extra mapping for the pipe-shell version of mkdir (e.g. map a :push %mkdir<space>)

Done, thanks. On second thought this is a more didactic example to show people.

I'm still interested in having an example that also selects the created dir (which many people would want and is far from trivial to come up with), but I now think it should be commented out and exist in addition to the simple mapping. Also, it's harder to create a good example than I thought. I'll leave it for another PR, maybe.

I have left a comment regarding the example configuration in general to #1179 .

I like having a vetted example of config for people to build upon. I'll think about it in more detail, but the main gist of what you said is that it's difficult to have a good example config, which is very true. Still, it can be very valuable, and the current one lf has is pretty good. I'll put more thoughts elsewhere when/if I collect them.

@ilyagr ilyagr changed the title lfrc.example: Remove rename, add mkdir, add "show execution result" command lfrc.example: Add example mkdir binding, "show execution result" command Apr 3, 2023
@gokcehan gokcehan merged commit 27d316c into gokcehan:master Apr 8, 2023
3 checks passed
@ilyagr ilyagr deleted the lfrc branch April 8, 2023 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement 'mkdir' command
3 participants