# Vim

Vim is an open-source, powerful and configurable text editor. Vim is designed for use both from a command-line interface and as a standalone application in a graphical user interface.

Contents

- Vim

  - Integration

    - “Neomake-PlatformIO” Plugin

    - Project Generator

  - Articles / Manuals

## Integration

Integration process consists of these steps:

1. Open system Terminal and install PlatformIO Core (CLI)

2. Create new folder for your project and change directory (`cd`) to it

3. Generate a project using PIO Core Project Generator (`platformio project init --ide`)

4. Import project in IDE.

### “Neomake-PlatformIO” Plugin

Please visit neomake-platformio for the further installation steps and documentation.

### Project Generator

Choose board `ID` using platformio boards or Embedded Boards Explorer command and generate project via `platformio project init --ide` command:

    platformio project init --ide vim --board <ID>

Recommended bundles:

- C/C++/ language server supporting cross references, hierarchies, completion and semantic highlighting - CCLS: vim lsp

- Syntax highlight - Arduino-syntax-file

- Code Completion - YouCompleteMe (see configuration example by Anthony Ford PlatformIO/YouCompleteMe Integration)

- Syntax checking - Syntastic

Put to the project directory `Makefile` wrapper with contents:

    # Uncomment lines below if you have problems with $PATH
    #SHELL := /bin/bash
    #PATH := /usr/local/bin:$(PATH)

    all:
            platformio -f -c vim run

    upload:
            platformio -f -c vim run --target upload

    clean:
            platformio -f -c vim run --target clean

    program:
            platformio -f -c vim run --target program

    uploadfs:
            platformio -f -c vim run --target uploadfs

    update:
            platformio -f -c vim update

Pre-defined targets:

- `Build` - Build project without auto-uploading

- `Clean` - Clean compiled objects.

- `Upload` - Build and upload (if no errors)

- `Upload using Programmer` see Upload using Programmer

- `Upload SPIFFS image` see Uploading files to file system SPIFFS

- `Update platforms and libraries` - Update installed platforms and libraries via platformio update.

Now, in VIM `cd /path/to/this/project` and press `Ctrl+B` or `Cmd+B` (Mac). PlatformIO should compile your source code from the `src` directory, make firmware and upload it.

Note

If hotkey doesn’t work for you, try to add this line `nnoremap <C-b> :make<CR>` to `~/.vimrc`

## Articles / Manuals

- コマンドラインでArduino開発 : vim + platformio (Arduino development at the command line: VIM + PlatformIO, Japanese)

See a full list with Articles about us.