Title: Search a file and open its folder vim
Tags: vim;vim-plugin
Question: I am using silver searcher in vim. A lot of times I want to search a file BUT open its folder (to see the other files that are there). How can I do it?


Here is the accepted answer: Unless you have a very specific workflow that you didn't disclose, ```ag``` is a red herring, here.
You can open the built-in file explorer in the parent directory of the current file with:
```:Ex
```
You can also do:
```:e %:h
```
because of the way Vim falls back to Netrw when you ask it to edit a directory.
See ```:help :Explore``` and its variants, as well as ```:help filename-modifiers``` for the ```:h``` bit.



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2022:00:05/01/22', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<vim><vim-plugin>', 'Title': 'Search a file and open its folder vim', 'ViewCount': 43, 'id': 72076796, 'user_AboutMe': '', 'user_AccountId': 1211201.0, 'user_DisplayName': 'yehudahs', 'user_Reputation': 2378.0, 'user_Views': 276.0, 'user_id': 1179689.0}}