I know that plugin that can do it almost certainly exists. Or maybe I could use something like LSP for this. But I want to make my simple command, that will go to file with definition of component / function / class in JS. It's not difficult, because in JS all imports are explicitly, so I wrote this command in my .vimrc
gd= go to definition (first occurrence of symbol)
/from= find from in this string (because string will be like
import smth from 'filename')
:noh= remove unnecessary highlighting
5l= skip from word to move to filename
gf= go file
This works well; it goes to required file.
When I return to my old file, my cursor is on the line with
import, but I want to remain in the line where I typed
gd. I heard about
:keepjump but I don't understand how can I use it here. How can I do this ?