Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to format the result of Ctrl-g in vim?

Tags:

vim

Is it possible to change what goes into <c-g>’s output? Specifically, I want to add the current filetype to to the output.

like image 676
none Avatar asked Nov 25 '25 11:11

none


1 Answers

You can do this by overloading the command with a mapping. Since :file is the same as <C-g>, let's use that; it saves us the :normal:

:nnoremap <silent> <C-g> :file<Bar>echon ' ' &filetype<CR>
like image 67
Ingo Karkat Avatar answered Nov 27 '25 06:11

Ingo Karkat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!