5

When you are using vim, is there a way to have a GUI-style navigation panel to open files in the your source code directory?

Something that's somewhat similar to the Sublime Text GUI sidebar? Picture below describing what I mean:

sublime text file directory sidebar

rsm
  • 2,530
  • 4
  • 26
  • 33
Hays Stanford
  • 93
  • 1
  • 8
  • 1
    Hi, a lot of people have asked questions about file navigation with Vim. Your version of this question makes me think you might want to look at Nerdtree. Did you see this post on Vim file navigation? https://stackoverflow.com/questions/53664/how-to-effectively-work-with-multiple-files-in-vim? – Patrick Bacon Jan 27 '20 at 22:32
  • Was hoping there might be a more visual representation of the file directory – Hays Stanford Jan 28 '20 at 20:19

6 Answers6

7

Builtin: use netrw’s command :Explore.

D. Ben Knoble
  • 4,273
  • 1
  • 20
  • 38
6

I use NERDTree, which provides a sidebar for file selection. Next to that you are also able to do file operations like moving them or creating new ones.

If you want each file to be accompanied by an icon that reflects what extension it is, you can also install vim-devicons. But then you should also install one of the nerd-fonts and set it as the font for your terminal.

Sander Vanhove
  • 995
  • 4
  • 11
5

My way to handle this is :30vs. . "30" sets the width of the sidebar, "vs" splits your screen vertically and "." is for your current directory. With p your can preview the files.

Dominik
  • 51
  • 3
2

Nerdtree, devicons and nerdtree-git are doing a really nice job together.

NerdTree is just an window on the left side and I can simply switch to it with <ctrl>+w h.

That's how it looks with my config. Vim with nerdtree, devicons and nerdtree git. And some other plugins

Just in case you want to get a config to start: You can take mine

1
  1. press Esc button for canceling all modes(INPUT mode for example)

  2. Ctrl + x for activating completion mode

  3. Ctrl + f for watching files

If you all did right you should see the following

enter image description here

Artyom Vancyan
  • 5,029
  • 3
  • 12
  • 34
1

With Neovim-qt you have :GuiTreeviewToggle which does exactly this: show GUI treeview control for the current subdirectory tree.

With GVim you cannot.

Matt
  • 13,674
  • 1
  • 18
  • 27