Want to dynamically supplement file paths with vim

Asked 2 years ago, Updated 2 years ago, 86 views

For example, you want to access ~/hoge/fuga/piyo.
Emacs complements ~/h/f/p by typing ~/h/f/p and pressing Tab.
Is there a way to do this with vim?
If possible, it would be great if I could do this with just a few lines on vimrc instead of plug-ins.

vim

2022-09-30 20:52

1 Answers

Since it is equivalent to C-x C-f for Emacs, I would like to explain when I specify the filename with the :e command for Vim.(:h:edit_f)

Type ~/h/f/p and press Tab to complement ~/hoge/fuga/piyo.

The nearest one is ~/h*/f*/p and press Tab.

Also, explain how to supplement the directory names one by one.

On the other hand, if you only know the file name, you can use ** to search the entire directory tree.(:h starstar)
Type :e~/**/file and press Tab or ctrl-d.
(Too many directories and files take time.Please cancel with ctrl-c)


2022-09-30 20:52

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.