Skip to content

EditorOptions

原文链接

https://microsoft.github.io/monaco-editor/docs.html#variables/editor.EditorOptions.html

ts
EditorOptions: {
    acceptSuggestionOnCommitCharacter: IEditorOption<acceptSuggestionOnCommitCharacter, boolean>;
    acceptSuggestionOnEnter: IEditorOption<acceptSuggestionOnEnter, "on" | "off" | "smart">;
    accessibilityPageSize: IEditorOption<accessibilityPageSize, number>;
    accessibilitySupport: IEditorOption<accessibilitySupport, AccessibilitySupport>;
    ariaLabel: IEditorOption<ariaLabel, string>;
    ariaRequired: IEditorOption<ariaRequired, boolean>;
    autoClosingBrackets: IEditorOption<autoClosingBrackets, "always" | "languageDefined" | "beforeWhitespace" | "never">;
    autoClosingComments: IEditorOption<autoClosingComments, "always" | "languageDefined" | "beforeWhitespace" | "never">;
    autoClosingDelete: IEditorOption<autoClosingDelete, "always" | "never" | "auto">;
    autoClosingOvertype: IEditorOption<autoClosingOvertype, "always" | "never" | "auto">;
    autoClosingQuotes: IEditorOption<autoClosingQuotes, "always" | "languageDefined" | "beforeWhitespace" | "never">;
    autoIndent: IEditorOption<autoIndent, EditorAutoIndentStrategy>;
    autoSurround: IEditorOption<autoSurround, "languageDefined" | "never" | "quotes" | "brackets">;
    automaticLayout: IEditorOption<automaticLayout, boolean>;
    bracketPairColorization: IEditorOption<bracketPairColorization, Readonly<Required<IBracketPairColorizationOptions>>>;
    bracketPairGuides: IEditorOption<guides, Readonly<Required<IGuidesOptions>>>;
    codeLens: IEditorOption<codeLens, boolean>;
    codeLensFontFamily: IEditorOption<codeLensFontFamily, string>;
    codeLensFontSize: IEditorOption<codeLensFontSize, number>;
    colorDecoratorActivatedOn: IEditorOption<colorDecoratorsActivatedOn, "clickAndHover" | "click" | "hover">;
    colorDecorators: IEditorOption<colorDecorators, boolean>;
    colorDecoratorsLimit: IEditorOption<colorDecoratorsLimit, number>;
    columnSelection: IEditorOption<columnSelection, boolean>;
    comments: IEditorOption<comments, Readonly<Required<IEditorCommentsOptions>>>;
    contextmenu: IEditorOption<contextmenu, boolean>;
    copyWithSyntaxHighlighting: IEditorOption<copyWithSyntaxHighlighting, boolean>;
    cursorBlinking: IEditorOption<cursorBlinking, TextEditorCursorBlinkingStyle>;
    cursorSmoothCaretAnimation: IEditorOption<cursorSmoothCaretAnimation, "on" | "off" | "explicit">;
    cursorStyle: IEditorOption<cursorStyle, TextEditorCursorStyle>;
    cursorSurroundingLines: IEditorOption<cursorSurroundingLines, number>;
    cursorSurroundingLinesStyle: IEditorOption<cursorSurroundingLinesStyle, "default" | "all">;
    cursorWidth: IEditorOption<cursorWidth, number>;
    defaultColorDecorators: IEditorOption<defaultColorDecorators, boolean>;
    definitionLinkOpensInPeek: IEditorOption<definitionLinkOpensInPeek, boolean>;
    disableLayerHinting: IEditorOption<disableLayerHinting, boolean>;
    disableMonospaceOptimizations: IEditorOption<disableMonospaceOptimizations, boolean>;
    domReadOnly: IEditorOption<domReadOnly, boolean>;
    dragAndDrop: IEditorOption<dragAndDrop, boolean>;
    dropIntoEditor: IEditorOption<dropIntoEditor, Readonly<Required<IDropIntoEditorOptions>>>;
    editorClassName: IEditorOption<editorClassName, string>;
    emptySelectionClipboard: IEditorOption<emptySelectionClipboard, boolean>;
    experimentalWhitespaceRendering: IEditorOption<experimentalWhitespaceRendering, "off" | "svg" | "font">;
    extraEditorClassName: IEditorOption<extraEditorClassName, string>;
    fastScrollSensitivity: IEditorOption<fastScrollSensitivity, number>;
    find: IEditorOption<find, Readonly<Required<IEditorFindOptions>>>;
    fixedOverflowWidgets: IEditorOption<fixedOverflowWidgets, boolean>;
    folding: IEditorOption<folding, boolean>;
    foldingHighlight: IEditorOption<foldingHighlight, boolean>;
    foldingImportsByDefault: IEditorOption<foldingImportsByDefault, boolean>;
    foldingMaximumRegions: IEditorOption<foldingMaximumRegions, number>;
    foldingStrategy: IEditorOption<foldingStrategy, "auto" | "indentation">;
    fontFamily: IEditorOption<fontFamily, string>;
    fontInfo: IEditorOption<fontInfo, FontInfo>;
    fontLigatures2: IEditorOption<fontLigatures, string>;
    fontSize: IEditorOption<fontSize, number>;
    fontVariations: IEditorOption<fontVariations, string>;
    fontWeight: IEditorOption<fontWeight, string>;
    formatOnPaste: IEditorOption<formatOnPaste, boolean>;
    formatOnType: IEditorOption<formatOnType, boolean>;
    glyphMargin: IEditorOption<glyphMargin, boolean>;
    gotoLocation: IEditorOption<gotoLocation, Readonly<Required<IGotoLocationOptions>>>;
    hideCursorInOverviewRuler: IEditorOption<hideCursorInOverviewRuler, boolean>;
    hover: IEditorOption<hover, Readonly<Required<IEditorHoverOptions>>>;
    inDiffEditor: IEditorOption<inDiffEditor, boolean>;
    inlayHints: IEditorOption<inlayHints, Readonly<Required<IEditorInlayHintsOptions>>>;
    inlineCompletionsAccessibilityVerbose: IEditorOption<inlineCompletionsAccessibilityVerbose, boolean>;
    inlineEdit: IEditorOption<inlineEdit, Readonly<Required<IInlineEditOptions>>>;
    inlineSuggest: IEditorOption<inlineSuggest, Readonly<Required<IInlineSuggestOptions>>>;
    layoutInfo: IEditorOption<layoutInfo, EditorLayoutInfo>;
    letterSpacing: IEditorOption<letterSpacing, number>;
    lightbulb: IEditorOption<lightbulb, Readonly<Required<IEditorLightbulbOptions>>>;
    lineDecorationsWidth: IEditorOption<lineDecorationsWidth, number>;
    lineHeight: IEditorOption<lineHeight, number>;
    lineNumbers: IEditorOption<lineNumbers, InternalEditorRenderLineNumbersOptions>;
    lineNumbersMinChars: IEditorOption<lineNumbersMinChars, number>;
    linkedEditing: IEditorOption<linkedEditing, boolean>;
    links: IEditorOption<links, boolean>;
    matchBrackets: IEditorOption<matchBrackets, "always" | "never" | "near">;
    minimap: IEditorOption<minimap, Readonly<Required<IEditorMinimapOptions>>>;
    mouseStyle: IEditorOption<mouseStyle, "default" | "text" | "copy">;
    mouseWheelScrollSensitivity: IEditorOption<mouseWheelScrollSensitivity, number>;
    mouseWheelZoom: IEditorOption<mouseWheelZoom, boolean>;
    multiCursorLimit: IEditorOption<multiCursorLimit, number>;
    multiCursorMergeOverlapping: IEditorOption<multiCursorMergeOverlapping, boolean>;
    multiCursorModifier: IEditorOption<multiCursorModifier, "altKey" | "metaKey" | "ctrlKey">;
    multiCursorPaste: IEditorOption<multiCursorPaste, "spread" | "full">;
    occurrencesHighlight: IEditorOption<occurrencesHighlight, "off" | "singleFile" | "multiFile">;
    overviewRulerBorder: IEditorOption<overviewRulerBorder, boolean>;
    overviewRulerLanes: IEditorOption<overviewRulerLanes, number>;
    padding: IEditorOption<padding, Readonly<Required<IEditorPaddingOptions>>>;
    parameterHints: IEditorOption<parameterHints, Readonly<Required<IEditorParameterHintOptions>>>;
    pasteAs: IEditorOption<pasteAs, Readonly<Required<IPasteAsOptions>>>;
    peekWidgetDefaultFocus: IEditorOption<peekWidgetDefaultFocus, "tree" | "editor">;
    pixelRatio: IEditorOption<pixelRatio, number>;
    quickSuggestions: IEditorOption<quickSuggestions, InternalQuickSuggestionsOptions>;
    quickSuggestionsDelay: IEditorOption<quickSuggestionsDelay, number>;
    readOnly: IEditorOption<readOnly, boolean>;
    readOnlyMessage: IEditorOption<readOnlyMessage, any>;
    renameOnType: IEditorOption<renameOnType, boolean>;
    renderControlCharacters: IEditorOption<renderControlCharacters, boolean>;
    renderFinalNewline: IEditorOption<renderFinalNewline, "on" | "off" | "dimmed">;
    renderLineHighlight: IEditorOption<renderLineHighlight, "all" | "line" | "none" | "gutter">;
    renderLineHighlightOnlyWhenFocus: IEditorOption<renderLineHighlightOnlyWhenFocus, boolean>;
    renderValidationDecorations: IEditorOption<renderValidationDecorations, "on" | "off" | "editable">;
    renderWhitespace: IEditorOption<renderWhitespace, "all" | "none" | "boundary" | "selection" | "trailing">;
    revealHorizontalRightPadding: IEditorOption<revealHorizontalRightPadding, number>;
    roundedSelection: IEditorOption<roundedSelection, boolean>;
    rulers: IEditorOption<rulers, {}>;
    screenReaderAnnounceInlineSuggestion: IEditorOption<screenReaderAnnounceInlineSuggestion, boolean>;
    scrollBeyondLastColumn: IEditorOption<scrollBeyondLastColumn, number>;
    scrollBeyondLastLine: IEditorOption<scrollBeyondLastLine, boolean>;
    scrollPredominantAxis: IEditorOption<scrollPredominantAxis, boolean>;
    scrollbar: IEditorOption<scrollbar, InternalEditorScrollbarOptions>;
    selectOnLineNumbers: IEditorOption<selectOnLineNumbers, boolean>;
    selectionClipboard: IEditorOption<selectionClipboard, boolean>;
    selectionHighlight: IEditorOption<selectionHighlight, boolean>;
    showDeprecated: IEditorOption<showDeprecated, boolean>;
    showFoldingControls: IEditorOption<showFoldingControls, "always" | "never" | "mouseover">;
    showUnused: IEditorOption<showUnused, boolean>;
    smartSelect: IEditorOption<smartSelect, Readonly<Required<ISmartSelectOptions>>>;
    smoothScrolling: IEditorOption<smoothScrolling, boolean>;
    snippetSuggestions: IEditorOption<snippetSuggestions, "none" | "top" | "bottom" | "inline">;
    stickyScroll: IEditorOption<stickyScroll, Readonly<Required<IEditorStickyScrollOptions>>>;
    stickyTabStops: IEditorOption<stickyTabStops, boolean>;
    stopRenderingLineAfter: IEditorOption<stopRenderingLineAfter, number>;
    suggest: IEditorOption<suggest, Readonly<Required<ISuggestOptions>>>;
    suggestFontSize: IEditorOption<suggestFontSize, number>;
    suggestLineHeight: IEditorOption<suggestLineHeight, number>;
    suggestOnTriggerCharacters: IEditorOption<suggestOnTriggerCharacters, boolean>;
    suggestSelection: IEditorOption<suggestSelection, "first" | "recentlyUsed" | "recentlyUsedByPrefix">;
    tabCompletion: IEditorOption<tabCompletion, "on" | "off" | "onlySnippets">;
    tabFocusMode: IEditorOption<tabFocusMode, boolean>;
    tabIndex: IEditorOption<tabIndex, number>;
    unfoldOnClickAfterEndOfLine: IEditorOption<unfoldOnClickAfterEndOfLine, boolean>;
    unicodeHighlight: IEditorOption<unicodeHighlighting, any>;
    unusualLineTerminators: IEditorOption<unusualLineTerminators, "auto" | "off" | "prompt">;
    useShadowDOM: IEditorOption<useShadowDOM, boolean>;
    useTabStops: IEditorOption<useTabStops, boolean>;
    wordBreak: IEditorOption<wordBreak, "normal" | "keepAll">;
    wordSegmenterLocales: IEditorOption<wordSegmenterLocales, {}>;
    wordSeparators: IEditorOption<wordSeparators, string>;
    wordWrap: IEditorOption<wordWrap, "on" | "off" | "wordWrapColumn" | "bounded">;
    wordWrapBreakAfterCharacters: IEditorOption<wordWrapBreakAfterCharacters, string>;
    wordWrapBreakBeforeCharacters: IEditorOption<wordWrapBreakBeforeCharacters, string>;
    wordWrapColumn: IEditorOption<wordWrapColumn, number>;
    wordWrapOverride1: IEditorOption<wordWrapOverride1, "on" | "off" | "inherit">;
    wordWrapOverride2: IEditorOption<wordWrapOverride2, "on" | "off" | "inherit">;
    wrappingIndent: IEditorOption<wrappingIndent, WrappingIndent>;
    wrappingInfo: IEditorOption<wrappingInfo, EditorWrappingInfo>;
    wrappingStrategy: IEditorOption<wrappingStrategy, "simple" | "advanced">;
}

快捷链接

PacceptSuggestionOnCommitCharacter
PacceptSuggestionOnEnter
PaccessibilityPageSize
PaccessibilitySupport
PariaLabel
PariaRequired
PautoClosingBrackets
PautoClosingComments
PautoClosingDelete
PautoClosingOvertype
PautoClosingQuotes
PautoIndent
PautoSurround
PautomaticLayout
PbracketPairColorization
PbracketPairGuides
PcodeLens
PcodeLensFontFamily
PcodeLensFontSize
PcolorDecoratorActivatedOn
PcolorDecorators
PcolorDecoratorsLimit
PcolumnSelection
Pcomments
Pcontextmenu
PcopyWithSyntaxHighlighting
PcursorBlinking
PcursorSmoothCaretAnimation
PcursorStyle
PcursorSurroundingLines
PcursorSurroundingLinesStyle
PcursorWidth
PdefaultColorDecorators
PdefinitionLinkOpensInPeek
PdisableLayerHinting
PdisableMonospaceOptimizations
PdomReadOnly
PdragAndDrop
PdropIntoEditor
PeditorClassName
PemptySelectionClipboard
PexperimentalWhitespaceRendering
PextraEditorClassName
PfastScrollSensitivity
Pfind
PfixedOverflowWidgets
Pfolding
PfoldingHighlight
PfoldingImportsByDefault
PfoldingMaximumRegions
PfoldingStrategy
PfontFamily
PfontInfo
PfontLigatures2
PfontSize
PfontVariations
PfontWeight
PformatOnPaste
PformatOnType
PglyphMargin
PgotoLocation
PhideCursorInOverviewRuler
Phover
PinDiffEditor
PinlayHints
PinlineCompletionsAccessibilityVerbose
PinlineEdit
PinlineSuggest
PlayoutInfo
PletterSpacing
Plightbulb
PlineDecorationsWidth
PlineHeight
PlineNumbers
PlineNumbersMinChars
PlinkedEditing
Plinks
PmatchBrackets
Pminimap
PmouseStyle
PmouseWheelScrollSensitivity
PmouseWheelZoom
PmultiCursorLimit
PmultiCursorMergeOverlapping
PmultiCursorModifier
PmultiCursorPaste
PoccurrencesHighlight
PoverviewRulerBorder
PoverviewRulerLanes
Ppadding
PparameterHints
PpasteAs
PpeekWidgetDefaultFocus
PpixelRatio
PquickSuggestions
PquickSuggestionsDelay
PreadOnly
PreadOnlyMessage
PrenameOnType
PrenderControlCharacters
PrenderFinalNewline
PrenderLineHighlight
PrenderLineHighlightOnlyWhenFocus
PrenderValidationDecorations
PrenderWhitespace
PrevealHorizontalRightPadding
ProundedSelection
Prulers
PscreenReaderAnnounceInlineSuggestion
PscrollBeyondLastColumn
PscrollBeyondLastLine
PscrollPredominantAxis
Pscrollbar
PselectOnLineNumbers
PselectionClipboard
PselectionHighlight
PshowDeprecated
PshowFoldingControls
PshowUnused
PsmartSelect
PsmoothScrolling
PsnippetSuggestions
PstickyScroll
PstickyTabStops
PstopRenderingLineAfter
Psuggest
PsuggestFontSize
PsuggestLineHeight
PsuggestOnTriggerCharacters
PsuggestSelection
PtabCompletion
PtabFocusMode
PtabIndex
PunfoldOnClickAfterEndOfLine
PunicodeHighlight
PunusualLineTerminators
PuseShadowDOM
PuseTabStops
PwordBreak
PwordSegmenterLocales
PwordSeparators
PwordWrap
PwordWrapBreakAfterCharacters
PwordWrapBreakBeforeCharacters
PwordWrapColumn
PwordWrapOverride1
PwordWrapOverride2
PwrappingIndent
PwrappingInfo
PwrappingStrategy

acceptSuggestionOnCommitCharacter

acceptSuggestionOnEnter

accessibilityPageSize

accessibilitySupport

ariaLabel

ariaRequired

autoClosingBrackets

autoClosingComments

autoClosingDelete

autoClosingOvertype

autoClosingQuotes

autoIndent

autoSurround

automaticLayout

bracketPairColorization

bracketPairGuides

codeLens

codeLensFontFamily

codeLensFontSize

colorDecoratorActivatedOn

colorDecorators

colorDecoratorsLimit

columnSelection

comments

contextmenu

copyWithSyntaxHighlighting

cursorBlinking

cursorSmoothCaretAnimation

cursorStyle

cursorSurroundingLines

cursorSurroundingLinesStyle

cursorWidth

defaultColorDecorators

definitionLinkOpensInPeek

disableLayerHinting

disableMonospaceOptimizations

domReadOnly

dragAndDrop

dropIntoEditor

editorClassName

emptySelectionClipboard

experimentalWhitespaceRendering

extraEditorClassName

fastScrollSensitivity

find

fixedOverflowWidgets

folding

foldingHighlight

foldingImportsByDefault

foldingMaximumRegions

foldingStrategy

fontFamily

fontInfo

fontLigatures2

fontSize

fontVariations

fontWeight

formatOnPaste

formatOnType

glyphMargin

gotoLocation

hideCursorInOverviewRuler

hover

inDiffEditor

inlayHints

inlineCompletionsAccessibilityVerbose

inlineEdit

inlineSuggest

layoutInfo

letterSpacing

lightbulb

lineDecorationsWidth

lineHeight

lineNumbers

lineNumbersMinChars

linkedEditing

matchBrackets

minimap

mouseStyle

mouseWheelScrollSensitivity

mouseWheelZoom

multiCursorLimit

multiCursorMergeOverlapping

multiCursorModifier

multiCursorPaste

occurrencesHighlight

overviewRulerBorder

overviewRulerLanes

padding

parameterHints

pasteAs

peekWidgetDefaultFocus

pixelRatio

quickSuggestions

quickSuggestionsDelay

readOnly

readOnlyMessage

renameOnType

renderControlCharacters

renderFinalNewline

renderLineHighlight

renderLineHighlightOnlyWhenFocus

renderValidationDecorations

renderWhitespace

revealHorizontalRightPadding

roundedSelection

rulers

screenReaderAnnounceInlineSuggestion

scrollBeyondLastColumn

scrollBeyondLastLine

scrollPredominantAxis

scrollbar

selectOnLineNumbers

selectionClipboard

selectionHighlight

showDeprecated

showFoldingControls

showUnused

smartSelect

smoothScrolling

snippetSuggestions

stickyScroll

stickyTabStops

stopRenderingLineAfter

suggest

suggestFontSize

suggestLineHeight

suggestOnTriggerCharacters

suggestSelection

tabCompletion

tabFocusMode

tabIndex

unfoldOnClickAfterEndOfLine

unicodeHighlight

unusualLineTerminators

useShadowDOM

useTabStops

wordBreak

wordSegmenterLocales

wordSeparators

wordWrap

wordWrapBreakAfterCharacters

wordWrapBreakBeforeCharacters

wordWrapColumn

wordWrapOverride1

wordWrapOverride2

wrappingIndent

wrappingInfo

wrappingStrategy