Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ideavim - open a file with command mode?

I'm used to quickly opening a file in vim with :e . Quick and simple, especially with tab filename completion.

However :e doesn't seem to be wired up to open files for ideavim. Typing :e has no response.

Any suggestions?

like image 862
ether_joe Avatar asked Oct 02 '17 01:10

ether_joe


4 Answers

You can use :e or :edit or :action OpenFile to open IntelliJ's 'Open File' dialog and then browse to the target file but there is no auto completion available for file paths/names.

There's an open issue against IDEA VIM for this:

  • https://youtrack.jetbrains.com/issue/VIM-268
like image 192
glytching Avatar answered Oct 10 '22 21:10

glytching


:sp (alias for :split, splits editor screen horizontally) and :vsp (split vertically) also work in the way glytching described.

It's nutz that autocomplete for filename/paths isn't a feature.

I guess one sort of cool (probably unintended) feature is that you can :e, :sp, whatever just the filename of any file in your entire project. no need for path specifying (ie :sp ../../dir1/filename is unnecessary, just :sp filename works), so that's a possible workaround for the missing autocomplete.

like image 24
nah doe Avatar answered Oct 10 '22 20:10

nah doe


Double tapping shift (at least in intellij's GoLand) allows super fast searching for files in your project and opening them in a new tab. Not exactly the same as what you (and I) are looking for, but handy and fast.

like image 3
JJC Avatar answered Oct 10 '22 19:10

JJC


nnoremap <leader>ff :action GotoFile<CR> works quite well for me.

like image 1
Testare Avatar answered Oct 10 '22 19:10

Testare