Re: patch for new feature: placeholders in execute command
Benno Schulenberg <[email protected]> Tue, 18 Nov 2025 11:14:48 +0100
| Newsgroups | gmane.editors.nano.devel |
|---|---|
| Message-ID | <[email protected]> |
Op 17-11-2025 om 16:32 schreef Luca Coraggio:
> What I meant is not to insert the documentation in the current document,
> but to show the doc in an external terminal, that is opened "on the fly".
> I typically spawn a new terminal and type the command that brings the
> documentation; I think it is just more convenient to highlight a word
> in nano, and have a keypress do that for me.
Oh. Unfortunately nano has just one cutbuffer, so passing two parameters
(the filename and the highlighted word) to the external script will need
some creative gluing. For example (all on one line):
bind Sh-M-M "{copy}{writeout}==={paste}{copy}{cancel}{execute}
yourscript.sh {paste}{enter}" main
Then yourscript.sh will have to separate the filename (before the ===)
from the highlighted word (after the ===), deduce the filetype from the
filename, and then invoke the appropriate doc reader with the extracted
word as a parameter... Quite some scripting. :| How many different
documentation readers (besides `pydoc` and `man`) do you use that this
is worth the effort?
Instead of first manually highlighting a word, you could also make the
keystroke highlight the current word before doing the rest:
bind Sh-M-K "{nextword}{mark}{prevword}{copy}..." ...
Then it will work more like Shift+K in vim.
Benno
OpenPGP_signature.asc
(application/pgp-signature, 840 B)
-----BEGIN PGP SIGNATURE----- wsF5BAABCAAjFiEEFo5vQpe/16ea/USWUUu+Lrjhlh8FAmkcRxgFAwAAAAAACgkQUUu+Lrjhlh/m ghAAm/I0xzxBiTIQe3A8wZ1Er4KmuaUXruPVISuUrK8v2OMmQ8e8QshRbftmme7pAT1VvfEb5Y3B nGKulNyBBw8rrUlhioiCYgJW/znTyHFZdMh2ACTQoAGJ/VI/59IRmV7Lwtlweyiylc8DUMElRl33 AMtJpSYVPM7f2ZJEI2lnzJaPmCdlQ/RvFtRNh7TwVCWopL+SSJqwxdn9Orp++0pUy/HBr0BWH+Ub ustaGn3n3d7Kj57oP4vqOWLltWbpxBo2jBCEduTMrbgeEp3OhlTaL5Ayq30/2FwWRIc2ipVoU7eB 5mstlzfzou7wLtYwsVBFaunEai2+XzsIJs5BTzXzn4REN9Rjl67fcXt15GArGL7u2kqkSr7xzoac Poihik+5oiHGYklm6kMHH5KEp0ZNo2k/wyg078qS+CR5uFGtf4cQFZVlOf8wF1uEILos3bFLcXtb KjynHZ8/Cs/RVGfLhdfnC8P/YszZXVxeZnEQZcXxEVQ9NeqVCfvkqYjWBa1TJ6e/ZQqR29e+ZIJQ YeJeZ8vct4KUTkte9Vh5Bq7gAnqtpCsbqKvOmnNbulV6eb0pSggDJIwsFBaT4cus4kUKE9lOveB7 /YtiAJqIzyoJx6Ty+F6P4jQ0rZhwy6oFPGQ9SvCPTTO7mbyxyqH6o41iDJqrCOy8crSrB/10oAOl qDE= =p8De -----END PGP SIGNATURE-----