0

I'd like to print some file information on vim's bottom line upon pressing a keyboard shortcut, sort of like Ctrl+G but with different info (modification timestamp).

How can I output there?

My current shot:

nnoremap <C-H> :!stat -c '\%y' %<CR>

is unsatisfactory because it switches to the command output buffer (or what should I call it) and stays there until Enter is pressed, which is quite disruptive.

2
  • 1
    You could :echo systemlist() or do some processing in a dedicated function. Or use getftime()
    – D. Ben Knoble
    Feb 17 at 15:37
  • @D.BenKnoble Most helpful. Thanks! Figured out how to do it based on your suggestion. Feb 17 at 15:51

1 Answer 1

0

Based on D. Ben Knoble's suggestion,

nnoremap <C-H> :echo systemlist("stat -c '%y' " . expand("%"))[0]<CR>

works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.