How do you use the expression register to evaluate Vimscript?
Answer
<C-r>=expand('%:t')<CR>
Explanation
In insert mode, <C-r>= opens the expression register. Type any Vimscript expression like expand('%:t') to insert the filename without path.
<C-r>=expand('%:t')<CR>
In insert mode, <C-r>= opens the expression register. Type any Vimscript expression like expand('%:t') to insert the filename without path.