|
[Sponsors] |
September 26, 2018, 04:22 |
OpenFOAM and YouCompleteMe
|
#1 |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 15 |
Hi Foamers,
Does anyone use YouCompleteMe vim plugin? https://github.com/Valloric/YouCompleteMe Can anyone provide an exemplary .ycm_extra_conf.py file or tell how to set YCM for OpenFOAM?
__________________
best regards pblasiak |
|
August 16, 2021, 09:09 |
|
#2 |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 15 |
__________________
best regards pblasiak |
|
August 21, 2021, 12:59 |
Making YCM-Generator work
|
#3 |
Member
Sourav Mandal
Join Date: Jul 2019
Posts: 55
Rep Power: 6 |
Dear Przemek,
Thanks for posting it. However, I'm not able to make it work. I went into my OpenFOAM install directory, then ran PHP Code:
PHP Code:
PHP Code:
|
|
August 22, 2021, 08:40 |
|
#4 |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 15 |
__________________
best regards pblasiak |
|
August 23, 2021, 06:36 |
Debugging
|
#5 |
Member
Sourav Mandal
Join Date: Jul 2019
Posts: 55
Rep Power: 6 |
Hello,
I tried to follow this, but when I run this: PHP Code:
PHP Code:
I checked my shell environment, according to Wlydckat's blog post that you had mentioned in the GitHub issue : PHP Code:
|
|
August 23, 2021, 06:43 |
|
#6 |
Senior Member
Przemek
Join Date: Jun 2011
Posts: 249
Rep Power: 15 |
Please do these steps:
1. load OpenFOAM environment variables 2. Code:
cd /opt/OpenFOAM/OpenFOAM-8/applications/solvers/multiphase/interFoam Code:
vim interFoam.C Code:
:YcmGenerateConfig -e Code:
$WM_PROJECT_USER_DIR/dirToSolver Code:
$WM_PROJECT_DIR/dirToSolver So please try copy interFoam to user directory and than apply the steps 1-4.
__________________
best regards pblasiak |
|
August 23, 2021, 10:10 |
Maybe due to permission issue
|
#7 |
Member
Sourav Mandal
Join Date: Jul 2019
Posts: 55
Rep Power: 6 |
Thanks so much! So, this works perfectly now. I wanted this for learning purpose – OOP C++ for OpenFOAM. Imagine how much beneficial it would be to type namespaces like `Foam::` & having these nice autosuggestion (see the attached image). Someone needs vim with these two plugins: youcompleteme & ycm-generator.
I'll be looking forward to get the same with nvim in future. Only question remains: If all the OpenFoam namespaces are available in this way or only the ones related to interFoam, if someone does copy just one solver (interFoam here) to user directory & generates the required file using ycm-generator. Screenshot 2021-08-23 at 15.50.59.jpg |
|
|
|