Very fast way open relative and aliased imports in VIM.
Install plugin, place cursor on the line with path and type :OpenPath
. That's all!
For more details see How it works.
As search core there used The Silver Searcher which is defenetly fast 💫
-
Install The Silver Searcher
brew install the_silver_searcher
-
Install FZF vim plugin
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
-
Install this plugin
Plug 'guljeny/aliapath'
-
Enjoy 🔥
Place cursor on the line with path and type :OpenPath
.
Plugin understand as path any string wrapped in '
or "
.
Relative (starts from
./
or../
) and absolute (starts from/
) paths will be open imediately.
If only one file with name (last part of path, baz
in foo/bar/baz
) found, this file will be opened.
If there some files with the same name (baz.js
and baz.css
) - you will see the file picker window.
- Use
CTRL-K
/CTRL-J
to navigate up / down in this window. - Use
Enter
to open file. - For more details check Using FZF docs.
Still slowly? Try to create alias?
map <leader>o :OpenPath<CR>