Vim中的同步和拆分视图处理 [英] Syntastic and split view handling in Vim

查看:136
本文介绍了Vim中的同步和拆分视图处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我开始使用syntastic,因为它大大简化了开发过程.

Recently, I started using syntastic, as it eases up development quite a bit.

真正令我困扰的是它如何处理分割视图.

The only thing that realy bothers me is how it deals with split views.

我也使用NERDtree插件,每当我在vsplit视图中打开另一个文件时,就会发生以下情况:

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

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

有没有一种方法可以消除额外的小合成砖?

Is there a way to get rid of the small additional syntastic tile?

我宁愿有两个小图块(每个文件一个),或者只有一个图块显示当前活动文件图块的信息.

I would rather have two small tiles (one for each file), or only one tile displaying information for the currently active file tile.

推荐答案

NerdTree通常会妨碍良好的拆分/窗口工作流程.那么您是否考虑过不使用NerdTree?

NerdTree often gets in the way of a a good split/window workflow. So have you thought about not using NerdTree?

NerdTree的一些问题:

A few problems with NerdTree:

  • 浪费的空间.您需要多久查看一次文件结构? 10%的时间?少一点?
  • Vim没有项目抽屉"的概念.意思是NerdTree竭尽全力模仿"Project Drawer"行为并最终失败.
  • 拆分导航-使<c-w>t的使用率大大降低.与其他工作流程相比,通常会导致使用更多的窗口导航命令.
  • 重新排列拆分时,NerdTree的播放效果不佳.创建一些拆分,然后执行<c-w>J<c-w>H.看看它如何弄乱您的布局.这就是您使用合成法的情况.
  • Wasted space. How often do you need look at your file structure? 10% of the time? Less?
  • Vim has no concept of a "Project Drawer". Meaning NerdTree goes to great lengths to emulate "Project Drawer" behavior and ultimately fails.
  • Splits navigation - Makes <c-w>t much less useful. Often causing more window navigation commands to be used compared to other workflows.
  • NerdTree doesn't play well when rearranging splits. Create some splits then do <c-w>J or <c-w>H. See how it messed up your layout. This is the case you are having with syntastic.

Vimcasts 所述,

As laid out in the Vimcasts post, Oil and vinegar - split windows and the project drawer, Vim prefers to just open a file explorer when you need it then switch away from it when it isn't needed. You can user NerdTree in this fashion too, just forget the alway on file explorer bit. There are other ways of opening files in vim:

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

我个人会发现一个不错的模糊文件查找器会开始使NerdTree淡出您的工作流程.

Personally, I would find a good fuzzy file finder start fading NerdTree out of your workflow.

Vim很高兴.确保您尽可能有效地使用拆分.有许多分割的命令,请参见:h opening-window.最好还是阅读整个:h window帮助文件,那里有很多宝藏.

Vim is split happy. Make sure you use splits as effectively as you can. There are many split commmands, see :h opening-window. Better yet read the whole :h window help file, there are many treasures in there.

这篇关于Vim中的同步和拆分视图处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆