I am looking to modify Ctrl-G <C-g>
in the following way:
Current Behavior:
<C-g>
"test.txt" 89 lines --1%--
What I want is to modify so it's output looks like 1 Ctrl-G 1<C-g>
"~/Documents/test.txt" 89 lines --1%--
if I make the following mapping:
map <C-g> echo expand('%:p')
I get:
/home/me/Documents/test.txt
I would like to push <C-g>
and get:
"~/Documents/test.txt" 89 lines --1%--
Can you help me fix my mapping to get desired output?
I am piggy-backing heavily off this question: Display name of the current file in vim? by muthuh
Try
:nnoremap <c-g> 1<c-g>
What about
:noremap <C-g> 1<C-g>
which avoids a recursion?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With