I have a file that is 9 lines long called foo.txt . I use
:split foo.txt
and the new split takes up a full 50% of the editor, which results in a lot of wasted space.
I can resize it with :resize ctrl-R=line('$')
but I have to type it manually each time the file changes because the editor only remembers the evaluated value.
So my question is:
- Is it possible to open a split with maximum height to be the size of the file
- Is it possible to have this happen dynamically, so the size of the split changes (to some maximum) as I add and remove lines.