How to Show the file path opened in VIM

Asked

Viewed 280 times

2

Sometimes I leave the file open for a long time, and I don’t know which directory it is in because the environments of my application are separated by path.

Ex:

prod 
/loja/prod/app/index.php
teste
/loja/teste/app/index.php

wanted to show this path with VIM. It is possible and how to do?

  • CTR+G - shows the file name; folder is the window title.

3 answers

3


0

In normal mode press 1Ctrl-g

0

You can run an external command by vim with the syntax :! comando. The command pwd returns the directory you are in. Soon:

:! pwd

  • It didn’t work for me. Left the file, then asked for input, then went back to the file but didn’t show anything!

  • try to get ! out of the way or add a % at the end. it’s been a while since I migrated to Emacs XD

  • vim is already showing the directory in the window title.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.