简体   繁体   English

是否可以配置vim选项卡完成 <Enter> 键?

[英]Is it possible to configure the vim tab completion <Enter> key?

I like vim's tab completion, when I'm using a command it can help me complete the command, and when I'm open a file it can help me complete the path or file name. 我喜欢vim的制表符补全,当我使用命令时,它可以帮助我完成命令,而当我打开文件时,它可以帮助我完成路径或文件名。

But when I'm using it to complete the path, for example that I'm about to open test1/vimrc to edit, but I don't want to type the path manually, so I pressed Tab : 但是,当我使用它来完成路径时,例如,我将要打开test1/vimrc进行编辑,但是我不想手动键入路径,因此我按下了Tab

test/ test1/ test2/

This is the list for my directories, then I pressed Tab twice to select the test1/ . 这是我的目录的列表,然后按两次Tab来选择test1/ But now, if I press Enter , then vim will open the directory(However I don't want to do that). 但是现在,如果我按Enter ,那么vim将打开目录(但是我不想这样做)。

I can only press Space + BackSpace to select the test1/ and press Tab again to list all files in test1/ . 我只能按Space + BackSpace选择test1/ ,然后再次按Tab列出test1/中的所有文件。


Now my problem is, is it possible to configure if the select is a directory, press Enter will only select it but won't open it untill I press Enter again? 现在我的问题是,是否可以配置select是否为目录,按Enter只会选择它,直到我再次按Enter才能打开它? (like oh-my-zsh default tab completion configuration) (例如oh-my-zsh默认选项卡完成配置)

您可以按向下箭头↓,这将选择目录

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM