navi icon indicating copy to clipboard operation
navi copied to clipboard

Escape <variable> in cheat files

Open mrVanDalo opened this issue 4 years ago • 7 comments

Is your feature request related to a problem? Please describe.

# build default.nix
nix-build -E 'with import <nixpkgs> {} ; callPackage ./default.nix {}'

this line things of nixpkgs> as a variable, but it actually should stay `.

Describe the solution you'd like

Best we to escapt <nixpkgs> some how.

Describe alternatives you've considered

currently I ship around it, by defining

$ nixpkgs: echo "<nixpkgs>"

mrVanDalo avatar Mar 13 '20 09:03 mrVanDalo

Thanks for opening your first issue here! In case you're facing a bug, please update navi to the latest version first. Maybe the bug is already solved! :)

welcome[bot] avatar Mar 13 '20 09:03 welcome[bot]

Any ideas for escaping? <<foo>>? maybe \<foo>?

Suppose we go for <<foo>>. What if the user really wants to type <<foo>> (not as a variable)?

I need to think about it haha

denisidoro avatar Mar 13 '20 16:03 denisidoro

Yeah it is not easy I guess. I think \<foo> is more practical. \\<foo> => \<foo> and \\\<foo> => \\<foo> but this might be short minded.

mrVanDalo avatar Mar 13 '20 19:03 mrVanDalo

I ran into this recently as well for work. For me, \<foo> or \<foo\> would be fine as I think the majority of CLI heavy workers are used to escaping pairs for one reason or another

kbknapp avatar Mar 16 '20 18:03 kbknapp

:+1: from me for \<foo>.

I can't guarantee when I'll implement it, though.

This seems to be a simple issue for a newcomer, so if anyone is interested in opening a PR, I'd appreciate it!

denisidoro avatar Mar 16 '20 19:03 denisidoro

Hi! Sorry for the late reply.

Being 100% honest here: this is a feature it would be nice to have but unfortunately I haven't had much free time lately, so I have no plans to implement this in the near future.

If anyone could submit a PR for this, I'll gladly accept it, though! 👍

denisidoro avatar May 12 '20 13:05 denisidoro

Seems like this was implemented @denisidoro?

My test:

Cheatsheet:

# test
ssh \<intothisliterally\>

Navi:

~ ❯❯❯ navi                                                                                        ✘ 130
ssh: Could not resolve hostname <intothisliterally>: Name or service not known

joaquinlpereyra avatar Nov 30 '21 01:11 joaquinlpereyra