How To : Make Vim Apply C++ Syntax on Arduino Sketch Files ?

Abhishek Rawal

Abhishek Rawal

@abhishek-fg9tRh Oct 21, 2024
How can I make Vim apply C++ syntax highlighting ?

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • Ankita Katdare

    Ankita Katdare

    @abrakadabra Mar 27, 2013

    Arduino files - .ino or .pde right?

    Add autocmd BufNewFile,BufReadPost *.ino,*.pde set filetype=cpp

    to ~/.vimrc:
    or to ~/.vim/ftdetect/cpp.vim.
  • Abhishek Rawal

    Abhishek Rawal

    @abhishek-fg9tRh Mar 27, 2013

    Thanks AKD, you just saved my plenty of time.

    One more question,
    Do emacs have syntax highlighting for Arduino sketches ? I mean,can I make it understand that C++ file can be Arduino sketch & vice versa?

    I have too many sketches to be tweaked,merged & to be recompiled !

    If I wanna develop my own Arduino sketch editor which can help to write error free codes & with auto-correct feature with some helpful utilities,How to make one ? Which language is most preferred ?