Processing synthetic and split views in Vim

I recently started using synthetics, as it makes development a little easier.

The only thing that really bothers me is how it deals with separate views.

I also use the NERDtree plugin, and whenever I open another file in vsplit view, the following happens:

--------------------------------------------------------- | | | | |NERDTree| file | | | | | file | | | | | | |-------------------- | | | syntastic | | --------------------------------------------------------- | | | syntastic | | | --------------------------------------------------------- 

Is there a way to get rid of a little extra synthetic tile?

I would prefer to have two small tiles (one for each file) or only one tile displaying information for the current active file tile.

+9
source share
1 answer

NerdTree often interferes with a good split / window workflow. So you thought you weren’t using NerdTree?

A few issues with NerdTree:

  • Empty space. How often do you need to look at your file structure? 10% of the time? Less?
  • Vim has no concept of "Project Drawer". A value of NerdTree is suitable for emulating the behavior of Project Drawer and ultimately fails.
  • Separation of navigation - makes <cw>t much less useful. Often calls more window navigation commands than other workflows.
  • NerdTree does not play well when redistributing splits. Create several partitions, then execute <cw>J or <cw>H See how it ruined your layout. This is the case you have with the syntax.

Vim way

As stated in the Vimcasts post, Oil and Vinegar are split windows and a project drawer , Vim prefers to simply open the file explorer when you need it, and then disconnect from it when it is not needed. You can also use NerdTree in this method, just forget to bypass the bit of the file. There are other ways to open files in vim:

  • Use file completion via <tab> with commands like :e and :sp
  • Use <cd> instead of <tab> to get a list of completions
  • :e and :sp commands accept globs. for example :e *.c and :e foo/**/bar.c
  • :find and set the parameters 'path' and 'suffix'
  • Ctags or cscope to jump to tags
  • gf will go to the file under the cursor
  • Look for fuzzy crawlers like CtrlP , Command-T , or Unite
  • Create project-specific navigation through Projectionist ( Rails is a good example of this)

Personally, I would find a good fuzzy file finder that starts NerdTree from your workflow.

Wim split. Make sure you use splits as efficiently as you can. There are many separate commands, see :h opening-window . Better yet, read the entire help file :h window , there are many treasures.

+5
source

All Articles