Execute bash commands from vim with name of current file name and path to file

前端 未结 1 1452
春和景丽
春和景丽 2021-01-26 02:12

I\'m trying to do this to save a file without changing the timestamp.

nnoremap :execute \'silent !file=%:p:h && mtime=$(stat -c %y \"%\") &&

1条回答
  •  失恋的感觉
    2021-01-26 03:00

    Why should it, it is a string. What you want is to combine/concat your string with some variables:

    'silent !file=' . expand('%:p:h') . ' && mtime .......... 
    

    0 讨论(0)
提交回复
热议问题