Page 1 of 1

[linux] Vim/NeoVim + chibios + YouCompleteMe + Ycm-Generator

Posted: Wed Aug 17, 2016 10:39 am
by totalkrill
Hello!

I guess this might actually be a kind of a niche topic :D but still. I just wanted to show people that are using vim as an editor while doing projects with ChibiOs (Like I am) that there is a way to get the supernice autocompletion in vim and the ChibiOs project, from what I have seen it also finds the correct files for even specific structures for specific processors.

So what I am using is NeoVim under manjaro linux, To complement me with some autocompletion and also some edit-time warnings and errors I am using the absolutely amazing project https://github.com/Valloric/YouCompleteMe. This project takes care of all the autocompletion. The problem is that this needs to know what compiler flags you are setting and such to be usable. To fix this I am using the https://github.com/rdnetto/YCM-Generator project, but a bit patched to actually read the output from stdout and parse those flags and generate the file that YouCompleteMe needs.

link to patched generator: https://github.com/TotalKrill/YCM-Generator/tree/stdout

Now with this I can use the following bash command, also i am doing verbose builds:

Code: Select all

~/.config/nvim/bundle/YCM-Generator/config_gen.py -s -B arm-none-eabi-gcc -f .

(This will make clean and then run make)

This then gives me autocompletion for internal ChibiOs stuff, a quick test in the testhal/STM32F37x/ADC/ folder looks like this:

2016-08-17-111759_844x244_scrot.png


I am using the following nvim setup if anyone is interested, there is also very basic installation tips there ( the correct version of the YCM-Generator has to be downloaded separatly for now, pull is request pending)

https://github.com/TotalKrill/.nvim

Re: [linux] Vim/NeoVim + chibios + YouCompleteMe + Ycm-Generator

Posted: Wed Aug 17, 2016 1:34 pm
by utzig
Hey,

Nice! I use Vim+YCM for programming Python and Rust. Might as well give this a try when I get some time to hack on ChibiOS again.

Cheers,
Fabio Utzig

Re: [linux] Vim/NeoVim + chibios + YouCompleteMe + Ycm-Generator

Posted: Wed Aug 17, 2016 11:13 pm
by Korken
This was a really good script!
Not my Nvim workflow is even better, it even gets the correct files in ChibiOS without any problem (including the ones added via defines).

Re: [linux] Vim/NeoVim + chibios + YouCompleteMe + Ycm-Generator

Posted: Tue Sep 27, 2016 11:03 am
by totalkrill
Now the development branch contains support for the arm-none-eabi compiler. Making it easier and faster to use. :) very recommended :)