awsm.fish icon indicating copy to clipboard operation
awsm.fish copied to clipboard

Add magic-enter plugin

Open mattmc3 opened this issue 3 years ago • 8 comments

Added Magic-Enter to the plugin list. For OMZ users, this is the fish version of this plugin: https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/magic-enter

mattmc3 avatar Nov 23 '21 02:11 mattmc3

where is the fish version?

BarbzYHOOL avatar Dec 21 '22 00:12 BarbzYHOOL

@BarbzYHOOL https://github.com/mattmc3/magic-enter.fish

catgofire avatar Dec 21 '22 01:12 catgofire

@BarbzYHOOL https://github.com/mattmc3/magic-enter.fish

thanks i'm dumb, proof that i didn't code for a long time This is an interesting plugin idea, the command to run should be configurable though

btw how did you get that notification about my comment?

BarbzYHOOL avatar Dec 22 '22 00:12 BarbzYHOOL

It's absolutely configurable. Just write your own magic-enter-cmd function:

function magic-enter-cmd --description "Print the command to run when no command was given"
    if command git rev-parse --is-inside-work-tree &>/dev/null
        echo "echo TODO: git command here"
    else
        echo "echo TODO: command here"
    end
end

mattmc3 avatar Dec 22 '22 00:12 mattmc3

you mean rewrite the function inside the plugin file?

BarbzYHOOL avatar Dec 22 '22 18:12 BarbzYHOOL

No, in your own fish functions directory. It's the same way you would override any function in fish - for example, similar to how you customize your fish_prompt.

mattmc3 avatar Dec 22 '22 18:12 mattmc3

Hey Matt! I do think this might be useful, but not sure how yet. The documentation could use some refining before we move forward. Not sure if I'd use this just to run ls with each enter, but there might be potential for more. Thanks for working on this! Keeping this open for now.

jorgebucaran avatar Apr 30 '23 07:04 jorgebucaran

Hello Jorge - as always, thank you - you're absolutely right that this plugin needed a bit more in the README. I've enhanced it - let me know if there's anything else I can do to make it clearer/more useful. It's one of my favorite simple OMZ plugins, so having a similar one in Fish has been a must-have.

mattmc3 avatar May 01 '23 01:05 mattmc3