Tab completion when opening files in Vim.
:edit %<Tab> to expand the file path relative to current window.
To expand the path, without the filename, use
:edit %:h<Tab> instead.
For full, absolute path expansion use:
Sometimes it can be useful to copy the absolute path of the file to open / operate on it somewhere else. I use most when I’m opening another Vim window in a separate display. As the path is copied into system buffer, opening the file is as simple as typing
noremap <silent> <F4> :let @+=expand("%:p")<CR>