遍历与VIM文件名完成目录的插入模式(CTRL-X CTRL-F) [英] Traversing directories with vim file name completion in insert mode (Ctrl-X Ctrl-F)

查看:944
本文介绍了遍历与VIM文件名完成目录的插入模式(CTRL-X CTRL-F)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用vim的并发症文件名功能( CTRL-X 按Ctrl-F )以在 INSERT完整路径模式,但我不能工作了如何遍历到目录,而(暂时)结束的完成方式:

I’m trying to use vim’s compl-filename feature (Ctrl-XCtrl-F) to complete paths in INSERT mode, but I can’t work out how to traverse into directories without (temporarily) ending the completion mode:

比方说,我要完成的路径的/ etc / sysconfig / network中的脚本/ ifup的

Let’s say I want to complete the path /etc/sysconfig/network-scripts/ifup.

我希望能够做这样的事情:

I would like to be able to do something like:


/eCtrl-XCtrl-F
/etc/
/etc/sysCtrl-F
/etc/sysconfig/
/etc/sysconfig/netCtrl-F
/etc/sysconfig/netconsoleCtrl-N
/etc/sysconfig/networkCtrl-N
/etc/sysconfig/network-scripts/
/etc/sysconfig/network-scripts/ifupCtrl-Y
/etc/sysconfig/network-scripts/ifup

的问题是,当我开始键入*路径比赛后(如的/ etc / ),它结束文件名完成 。我想它留在文件名完成,这样我仍然可以使用<大骨节病>按Ctrl-F 按Ctrl-N 等。由于它结束后,我必须键入<大骨节病> CTRL-X 按Ctrl-F 再次重新启动它,并且乐于助人完成弹出菜单中同时消失。

The issue is, as soon as I start typing* after a path match (like /etc/), it ends file name completion. I would like it to stay in file name completion, so that I can still use Ctrl-F, Ctrl-N, etc. Since it ends completion, I have to type Ctrl-XCtrl-F again to restart it, and the helpful completion popup menu disappears in the meantime.

有没有我可以设置更改此选项?

Is there an option I can set to change this?

* 通过'输入'在这里,我指的是字符'isfname'里 - 当然,打字其他字符(如空间或标点符号),不应该继续补全文件名。

* By ‘typing’ here, I am referring to characters in 'isfname' -- of course, typing other characters (like space or punctuation) should not continue file name completion.

推荐答案

我不知道你在说什么,但你可以preSS <大骨节病> CTRL-X <大骨节病>按Ctrl-F 上的目录再次当你在完成菜单是将其展开。您不必先关闭菜单出来。我只是不停地<大骨节病>控制按住并点击 XF 来遍历目录, N p 来上下移动和是W 回去了。

I'm not sure exactly what you're saying, but you can just press Ctrl-XCtrl-F again on a directory while you're in the completion menu to expand it. You don't have to close out of the menu first. I just keep Ctrl held down and tap xf to traverse a directory, n and p to move up and down and w to go back up.

如果你不使用:小时i_CTRL-F ,那么你可以重新映射。例如,

If you don't use :h i_CTRL-F then you could remap it. For example,

inoremap <C-f> <C-x><C-f>

这篇关于遍历与VIM文件名完成目录的插入模式(CTRL-X CTRL-F)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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