VIM (and Neovim) things
To get the relative path of the current file;
" + % + p
% is a special read-only register in VIM that holds the name of the current file.
In insert mode (only); CTRL + R + % would work the same way.
(See :h reg (5. Read-only registers ":, ". and "%))
To redirect the output of messages to a specific file;
:redir > file
Notice that in order to see the messages you need to end the redirect;
:redir END
(See :h redi)