User:Vazhnov/PlatformIO + VIM + ccls + Sipeed Longan nano RISC-V

Intro
I'm not a developer.

For my job, I have to edit shell and Python scripts. I use VIM + vim-syntastic + linters (pylint, shellcheck) for it.

As a hobby, I'm trying to learn how to program in Asm and C for architecture RISC-V.

PlatformIO
PlatformIO is a popular platform with good support of multiple boards (like Arduino).

PlatformIO install
PlatformIO can be installed by Python's package management system pip. Here is an example how to install PlatformIO with Python virtualenv, to not interfere with your system:

Test: {{Cmd|pio boards|output= Platform: gd32v

=
=============================================================================== ID                      MCU            Frequency    Flash    RAM    Name --- -  ---  ---  -  --- gd32vf103v-eval          GD32VF103VBT6  108MHz       128KB    32KB   GD32VF103V-EVAL sipeed-longan-nano      GD32VF103CBT6  108MHz       128KB    32KB   Sipeed Longan Nano sipeed-longan-nano-lite GD32VF103C8T6  108MHz       64KB     20KB   Sipeed Longan Nano Lite wio_lite_risc-v         GD32VF103CBT6  108MHz       128KB    32KB   Wio Lite RISC-V }}

PlatformIO init
When run at the first time, PlatformIO downloads:


 * — from https://github.com/sipeed/platform-gd32v

After the last command, creates an empty structure + file  which is important for a syntax checker(s):

ccls
is required. It is still in testing.

Check:

Neovim
v0.5 supports the Language Server Protocol (LSP), which is needed, so testing versions should be allowed:

Install Neovim and Vim plug as it described in Neovim.

Create a configuration file:

Run, execute:

Then add at the end of code from https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#ccls:

Test:

Run, (open some C/C++ file?), execute: