VIM and the Classic Linux-Setup
If you want to try an editor suitable for working with our drones remotely and that it nicely tide up to a unique Linux environment for superb workflow, checkout VIM and the Linux Setup by Tomáš Báča.
Clang Formatting for VIM
The clang format plugin config is located in linux-setup/appconfig/nvim/dotvim/pluginconfig/vim-clang-format.vim
Use this profile:
let g:clang_format_f4f = {
\ 'Standard' : 'c++20',
\ 'AccessModifierOffset' : -2,
\ 'ColumnLimit' : 160,
\ 'MaxEmptyLinesToKeep' : 2,
\ 'AlignAfterOpenBracket' : 'Align',
\ 'AlignConsecutiveAssignments' : 'true',
\ 'AlignConsecutiveDeclarations' : 'true',
\ 'AllowShortBlocksOnASingleLine' : 'false',
\ 'AllowShortCaseLabelsOnASingleLine' : 'false',
\ 'AllowShortFunctionsOnASingleLine' : 'false',
\ 'AllowShortIfStatementsOnASingleLine' : 'false',
\ 'AllowShortLoopsOnASingleLine' : 'false',
\ 'AlwaysBreakTemplateDeclarations' : 'true',
\ 'BreakBeforeBinaryOperators' : 'false',
\ 'BreakBeforeBraces' : 'Custom',
\ 'BreakConstructorInitializers' : 'BeforeColon',
\ 'KeepEmptyLinesAtTheStartOfBlocks' : 'true',
\ 'NamespaceIndentation' : 'None',
\ 'SortIncludes' : 'false',
\ 'SpaceBeforeParens' : 'ControlStatements',
\ 'BraceWrapping' : {
\ 'AfterClass' : 'false',
\ 'AfterControlStatement' : 'false',
\ 'AfterEnum' : 'true',
\ 'AfterFunction' : 'false',
\ 'AfterNamespace' : 'true',
\ 'AfterObjCDeclaration' : 'true',
\ 'AfterStruct' : 'true',
\ 'AfterUnion' : 'true',
\ 'BeforeCatch' : 'true',
\ 'BeforeElse' : 'false',
\ 'IndentBraces' : 'false'
\ }
\ }
And then add this line to your ~/.config/nvim/init.vim to make nvim ignore the different EOF/EOL symbols used by VSCode:
set nofixeol