Editor Settings

Various settings for code editors that might be used to develop Mecha.

Table of Contents
  1. Git
  2. Notepad
  3. Notepad++
  4. Vim
  5. Visual Studio Code

TL;DR

  1. 4 <Space> instead of 1 <Tab>.
  2. No <CR>, only <LF>.
  3. No <EOL>.
  4. UTF-8.

The recommended line width is 120. But this is just to tidy up the comment paragraph. If your code line turns out to be more than that long then that’s okay.

Git

[core]
  autocrlf = false
  eol = lf

Notepad

You probably don’t need to change anything.

Notepad++

TODO

Vim

" Use UTF-8
set encoding=utf-8

" Use `<LF>`
set fileformat=unix

" Use 4 `<Space>`
set shiftwidth=4
set softtabstop=4
set tabstop=4

" Remove `<EOL>`
set binary
set noeol
set nofixeol

" Remove `<CR>` and `<EOL>` on write
autocmd BufWritePre * setlocal fileformat=unix noeol

" Add right margin ruler
set colorcolumn=120

Visual Studio Code

{
  "editor.detectIndentation": false,
  "editor.insertSpaces": true,
  "editor.rulers": [120],
  "editor.tabSize": 4,
  "files.encoding": "utf8",
  "files.eol": "\n",
  "files.trimFinalNewlines": true,
  "files.trimTrailingWhitespace": true
}

Editor Settings

Various settings for code editors that might be used to develop Mecha.