UE4 C++ without visual studio?

Which version of ureal are you using?
First the new project wizard can you make a new c++ project. If you are on UE5 you could follow this method to setup ide for your project. (check here)
If you are on UE4 there are some difference. On UE4 by opening a console from the project folder you can compile the project by giving command
$ make ProjectNameEditor
#(where prjectname is your project name)