Skip to content

Instantly share code, notes, and snippets.

@gsag
Last active April 14, 2020 04:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gsag/105ff21a91bcc841dc1d0adc1f4b0035 to your computer and use it in GitHub Desktop.
Save gsag/105ff21a91bcc841dc1d0adc1f4b0035 to your computer and use it in GitHub Desktop.
Dart Settings (VS Code)
{
// Copied from: https://dartcode.org/docs/recommended-settings/
// Causes the debug view to automatically appear when a breakpoint is hit. This
// setting is global and not configurable per-language.
"debug.openDebug": "openOnDebugBreak",
// Enables sdk default formatter - It enforces rules above VS Code settings
// Copied from: https://github.com/Dart-Code/Dart-Code/issues/914#issuecomment-536053940
// Why? https://github.com/dart-lang/dart_style/wiki/FAQ#why-cant-i-configure-it
"dart.enableSdkFormatter": true,
// You must turn off dartfmt (dart.enableSdkFormatter) to apply VS Code settings
"[dart]": {
// Automatically format code on save and during typing of certain characters
// (like `;` and `}`).
"editor.formatOnSave": true,
"editor.formatOnType": true,
// Draw a guide line at 120 characters, where Dart's formatting will wrap code.
"editor.rulers": [120],
// Disables built-in highlighting of words that match your selection. Without
// this, all instances of the selected text will be highlighted, interfering
// with Dart's ability to highlight only exact references to the selected variable.
"editor.selectionHighlight": false,
// By default, VS Code prevents code completion from popping open when in
// "snippet mode" (editing placeholders in inserted code). Setting this option
// to `false` stops that and allows completion to open as normal, as if you
// weren't in a snippet placeholder.
"editor.suggest.snippetsPreventQuickSuggestions": false,
// By default, VS Code will pre-select the most recently used item from code
// completion. This is usually not the most relevant item.
//
// "first" will always select top item
// "recentlyUsedByPrefix" will filter the recently used items based on the
// text immediately preceeding where completion was invoked.
"editor.suggestSelection": "first",
// Allows pressing <TAB> to complete snippets such as `for` even when the
// completion list is not visible.
"editor.tabCompletion": "onlySnippets",
// By default, VS Code will populate code completion with words found in the
// current file when a language service does not provide its own completions.
// This results in code completion suggesting words when editing comments and
// strings. This setting will prevent that.
"editor.wordBasedSuggestions": false,
// Force all files to have a trailing newline for consistency and reduced diffs
// when adding new lines at the bottom of the file.
"files.insertFinalNewline": true,
//formating with 4 spaces tab size, without inserting spaces.
"editor.tabSize": 4,
"editor.insertSpaces": false,
"editor.detectIndentation": false,
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment