I connect to various locations, for example:
and want to have some kind of short aliases for these long paths. Something like this:
How can I get it?
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.Sign up to join this community
Just use environment variables for the tramp paths.
For an example you could add the following line to your init file (with the right substitution for
(setenv "suHn" "/ssh:hostname|sudo:hostname:")
Those variables are resolved if you use them like
$suHn/ at the prompt of
Note however that I am not sure about the pipe-character
| in your tramp path. I never used such syntax for tramp and it is also not mentioned in tramp's file name conventions.
Read the Tramp Manual, chapter Frequently Asked Questions (https://www.gnu.org/software/tramp/#Frequently-Asked-Questions). It explains in length several approaches to shorten remote file names. These approaches are valid also for multi-hop file names.