If the goal is simply to place line 8 at the top of the window, you can achieve this in the command line with:
:execute "normal gg7\<c-e>"
This jumps to the top of the file, and then scrolls down 7 lines.
Further to discussions in the comments, in order to create a
zT mapping that moves the current line to the top of the window without using the
<c-e> normal mode command, you can do this:
:nnoremap zT :execute "normal! " . (line(".") + &scrolloff) . "Gzt"<cr>
The below was written when the question implied the user wanted to change the behaviour of '
zt' Not removing it, because it includes some useful features of Vimscript.
You could achieve this by remapping 'zt' to scroll the extra amount by using the normal mode
<c-e> command with a count of
&scrolloff after carrying out its usual behaviour:
:nnoremap zt zt:execute "normal!" . &scrolloff . "\<lt>c-e>\<lt>esc>"<cr>
Alternatively, if your goal is simply to move line 8 to the top of the window, and you don't want to change the behaviour of 'zt', you could instead change your command to:
... | execute "normal! " . (8 + &scrolloff) . "Gzt"
This places the cursor
&scrolloff lines below line 8, and then performs a standard
zt, moving line 8 to the top of the window.
Note that after using either solution, the line at the very top of the screen will no longer be the "current" line. This is impossible to achieve with
'scrolloff' set, as that state is precisely what
'scrolloff' is intended to prevent.