如何使用 nerdtree 和 mvim 表现得像 netbeans 或 eclipse?
我想使用 mvim 作为代码开发的通用文本编辑器。我希望左侧垂直分割窗格中的默认视图为目录列表视图,而我双击的文件将位于右侧垂直分割窗格中。这与 netbeans 或 eclipse 中的情况大致相同。有没有办法将其设置为默认的 mvim 视图,或者使用热键将其置于此模式?
在我的 MacBook Pro 上,我可以通过键入以下内容打开 mvim:
mvim .
这将打开当前目录的目录树视图(不是拆分窗格)。如果我双击任何文件,整个屏幕都会被该文件替换,并且我的目录列表会消失。我想保留它。
如果我突出显示目录列表中的一个文件并单击“t”热键,则会打开一个新选项卡,显示该文件的内容(同样,不是拆分窗格,而是其自己的选项卡中的整个文件)。但是,如果我突出显示一个文件夹并单击“t”热键,则会打开一个新选项卡,但它有一个新的垂直分割,左侧列出了目录。此外,如果我双击该目录列表中的文件,它们就会进入右窗格,这就是我想要的。
是否有任何命令行参数可以设置我可以使用的别名?
I want to use mvim as my general purpose text editor for code development. I want the default view to directory list view on the left vertical split pane and the file I double click on will be in the right vertical split pane. This is much the same in netbeans or eclipse. Is there anyway to set this to be the default mvim view, or hotkeys to put it in this mode?
on my macbook pro, I can open mvim by typing:
mvim .
This opens a directory tree view of the current directory (not split pane). If I double click on any files, the whole screen is replaced with that file and my directory listing goes away. I want to keep it.
If I highlight a file from within the directory listing and click "t" hotkey, a new tab is opened showing the contents of that file (again, not split pane, but whole file in it's own tab). However, if I highlight a folder and click "t" hotkey, a new tab is opened BUT it has a new vertical split with directory listing on the left. Furthermore if I double click on the files in that directory listing, they go in the right pane, which is what I want.
Is there any command line arguments that set that up which I can alias?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您似乎正在描述 NERDTree 插件几乎到了“T”。您可能需要调整
$VIMRUNTIME
中的一些变量,使其完全按照您的描述工作(例如,“let NERDTreeQuitOnOpen=0
”),但需要一点时间有了文档,你应该能够得到你想要的。You seem to be describing NERDTree plugin almost to the "T". You might need to tweak some variables in your
$VIMRUNTIME
for it work exactly as you describe (e.g., 'let NERDTreeQuitOnOpen=0
'), but with a little bit of time with the docs you should be able to get what you want.我在 ~/.vimrc 中插入以下代码
然后,使用 ctrl+n 切换到双模式。
I insert the following code in my ~/.vimrc
Then, I use ctrl+n to switch to dual mode.