I recently started learning LilyPond and am trying to notate finger sustained notes as described in Is there piano notation for finger sustained notes (as opposed to pedal sustain)?. I would be fine with either one of the notations from the top two answers.
I was able to notate what's described in the second answer like so:
\relative f' { f4~ <f c'>~ <f c' f>2 }
I find the code I wrote very verbose because I have to repeat all of the previous notes whenever I add a new one. Ideally I would only need to specify the next note and that I'd like the previous notes to continue and tie over. Is there a less verbose way to express this or what's described in the top answer of the question I linked?