Skip to content

Editor Settings

Taufik Nurrohman edited this page Aug 28, 2021 · 7 revisions

TL;DR

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

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

Visual Studio Code

{
  "editor.detectIndentation": false,
  "editor.insertSpaces": true,
  "editor.tabSize": 4,
  "files.encoding": "utf8",
  "files.eol": "\n",
  "files.trimFinalNewlines": true
}
Clone this wiki locally