Settings
Onivim's settings are designed to be mostly compatible with VSCode's User Settings.
Editing the user settings
- Press
Command+Shift+P
(Mac) orControl+Shift+P
(Windows, Linux) to bring up the command palette - Select
Preferences: Open Configuration File
Directly editing the user settings
Sometimes, it is necessary to directly edit the configuration in another editor, for example, if a setting is inadvertently set that makes the editor unusable.
The configuration file, configuration.json
is in the Oni2 directory, whose location varies by operating system:
- On Unix-like operating systems such as Linux:
$HOME/.config/oni2
- On Windows,
%LOCALAPPDATA%\Oni2
Configuration Settings
Editor
editor.acceptSuggestionOnEnter
(bool default:true
) - Whentrue
, the enter key can be used to accept a suggestion. Users may wish to set tofalse
to avoid a conflict with inserting a new line.editor.acceptSuggestionOnTab
(bool default:true
) - Whentrue
, the tab key can be used to accept a suggestion. Users may wish to turn tofalse
to avoid ambiguity with inserting a tab character.editor.autoClosingBrackets
("LanguageDefined"|"Never" default:"LanguageDefined"
)__ - When set to"LanguageDefined"
, Onivim will automatically close brackets and pairs, based on language configuration.editor.codeLens
(bool default:true
) - Whether to show codelens, when available from a language extension.editor.cursorSurroundingLines
(int default:1
) - The number of view lines to keep visible above and below the cursor when scrolling. Equivalent to the Vimscrolloff
setting.editor.detectIndentation
(bool default:true
) - Allow Onivim to auto-detect indentation settings (tab vs space, indent size)editor.fontFamily
(string) - The font family used by the editor surface. This must be a monospace font.editor.fontWeight
(int|string 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | "normal" | "bold" default:"normal"
) - The font weight used by the editor surface.editor.fontSize
(int default:14
) - The font size used by the editor surface.editor.fontSmoothing
("none"|"antialiased"|"subpixel-antialiased" default:"subpixel-antialiased"
)__ - The smoothing strategy used when rendering fonts. The"antialiased"
setting smooths font edges, and"subpixel-antialiased"
means characters may be positioned fractionally on the pixel grid.editor.fontLigatures
(string|bool default:true
) - Sets whether or not font ligatures are enabled. Whentrue
, the font's default features are enabled. Whenfalse
, contextual alternates and standard ligatues are disabled. If a string is entered, it must be of the form"'tag1', 'tag2', ..."
, where each tag listed will be enabled. This is particularly useful for enabling stylistic sets, i.e."'ss01', 'ss02', ..."
.editor.hover.delay
(int default:1000
) - The delay in milliseconds before showing the hover UI.editor.hover.enabled
(bool default:true
) - Controls whether or not the hover UI is enabled.editor.largeFileOptimizations
(bool default:true
) - Whentrue
, Onivim will turn off certain settings like syntax highlighting for large files.editor.showDeprecated
(bool default:true
) - Whentrue
, Onivim will render deprecated code with a strike-through.editor.showUnused
(bool default:true
) - Whentrue
, Onivim will fade out unused code.workbench.editor.enablePreview
(bool default:true
) - Whentrue
, Onivim will open files in preview mode unless a change is made or the tab is double-clicked. In preview mode, the editor tab will be re-used.editor.lightBulb.enabled
(bool default:true
) - Whentrue
, show a lightbulb icon in the editor if there are quick fixes or refactorings available.editor.lineHeight
(float default:0.
) - Controls the absolute height of lines on the editor surface. Use 0 to compute lineHeight from the font size.editor.lineNumbers
("on"|"off"|"relative" default:"on"
)__ - Controls how line numbers are rendered on the editor surface- "on" - absolute line numbers are displayed
- "relative" - the absolute line number of the line with the cursor is displayed, other line numbers are shown relative. (This is helpful for motions in Vim!)
- "off" - do not render line numbers.
editor.matchBrackets
(bool default:true
) - Highlight bracket matches on the editor surface.editor.minimapEnabled
(bool default:true
) - Controls whether or not the minimap is rendered on the editor surface.editor.minimapShowSlider
(bool default:true
) - Controls where or not a slider representing the current viewport is shown on the minimap.editor.minimapMaxColumn
(int default:80
) - Sets the maximum column that will be rendered in the minimap. By default, we size the minimap proportionally to the editor surface - this puts a constraint on that size.editor.insertSpaces
(bool default:true
) - Whentrue
, the Onivim will use spaces for indentation as opposed to tabs.editor.occurrencesHighlight
(bool default:true
) Whentrue
, and provided by a language extension, Onivim will highlight all occurrences of the token under the cursor in the active editor.editor.parameterHints.enabled
(bool default:true
) - Whentrue
, and provided by a language extension, Onivim will display a pop-up showing hints for the current function invocation.editor.quickSuggestions
(bool default:true
) - Whentrue
, code completions will be enabled. Whenfalse
, code completions will be disabled.Code completions also support finer-grained configuration, via a JSON object of the form:
{ "comments": true, "strings": true, "others": true }
.This allows enabling code-completions based on the current syntax scope.
editor.renderWhitespace
("all"|"boundary"|"selection"|"none" default:"selection"
)__ - Controls how whitespace (tabs/spaces) are rendered:- "all" - Render all whitespace
- "boundary" - Render whitespace except for single characters between text
- "selection" - Render whitespace characters in visual mode selected text
- "none" - Don't render whitespace at all
editor.scrollbar.horizontalScrollbarSize
(int default:8
) - The size, in pixels, of the horizontal scroll bar on the editor surface.editor.scrollbar.verticalScrollbarSize
(int default:15
) - The size, in pixels, of the vertical scroll bar on the editor surface.editor.snippetSuggestions
__(string default:"inline"
) - controls how snippets are presented in the suggestion UI:- "top" - Show snippets at the top of the suggestion list
- "bottom" - Show snippets at the bottom of the suggestion list
- "inline" - Show snippets sorted in-line with other suggestion items
- "hidden" - Don't show snippet suggestions at all
editor.suggest.itemsToShow
(int default:5
) - The maximum number of suggestions to show in the suggestion UI.editor.wordBasedSuggestions
(bool default:true
) Whentrue
, keywords are provided as completion suggestions.editor.wordWrap
(bool default:true
) Whentrue
, Onivim will soft-wrap lines at the viewport boundary.editor.rulers
(list of int default:[]
) - Render vertical rulers at given columns.editor.scrollShadow
(bool default:true
) - Whentrue
, show a drop-shadow effect at the borders when there is additional content past the visible area.editor.smoothScroll
(bool default:true
) - Whentrue
, smoothly scroll the editor when the viewport is adjusted due to a cursor motion.editor.zenMode.singleFile
(bool default:true
) - Whentrue
, the Onivim will automatically enter zen mode when started up with a single file. Zen mode hides most of the UI until disabled via the command pallette.editor.zenMode.hideTabs
(bool default:true
) - Whentrue
, the Onivim will hide the buffer tabs from the user whilst in zen mode. Zen mode can be toggled in the command pallette, or automatically enabled with theeditor.zenMode.singleFile
configuration option.files.exclude
(list of string default:[".git", "_esy", "node_modules"]
) - When usingQuick Open
orFind in files
, Onivim will ignore the files inside the directories listed herefiles.autoSave
(string default:"off"
) - controls when buffers are auto-saved:- "off" - Do not auto-save at all
- "afterDelay" - Auto-save after the delay specified by
"files.autoSaveDelay"
- "onFocusChange" - Auto-save when changing focus between buffers
- "onWindowChange" - Auto-save when the Onivim application window loses focus
files.autoSaveDelay
(int default:1000
) - specifies the time, in milliseconds, to wait to auto-save a buffer whenfiles.autoSave
is set to"afterDelay"
search.exclude
(list of string default:[]
) - When usingFind in files
Onivim will not look at files located at the directories listed here, this inherit all the values fromfiles.exclude
search.followSymlinks
(bool default:true
) - Set whether to follow symlinks when searchingsearch.useIgnoreFiles
(bool default:true
) - Set whether to.gitignore
should be respected when searchingworkbench.colorCustomizations
(json default:{}
) - Color theme overrides, using the same Theme Colors as Code - for example:
"workbench.colorCustomizations": {
"terminal.background": "#0F0",
"terminal.foreground": "#FFF"
},
workbench.colorTheme
(string default:"One Dark Pro"
) - Color theme to use.workbench.iconTheme
(string default:"vs-seti"
) - Icon theme to use.workbench.tree.indent
(int default:5
) - Indentation of the tree explorer.workbench.tree.renderIndentGuides
(bool default:true
) - Controls whether indent guide lines are rendered in tree views.vim.highlightedyank.enable
(bool default:true
) - Whentrue
, briefly highlight yanks on the editor surface.vim.highlightedyank.color
(string) - Hex string defining a color, ie#FF00FFFF
.vim.highlightedyank.duration
(int default:300
) - The time, in milliseconds, the yank highlight is visible.
Input
vim.leader
(string) - Specify a custom leader key.vim.timeout
(int default:1000
) Sets the timeout, in milliseconds, when Onivim is waiting for a pending chord. When the timeout is reached, any pending keys that are partially mapped will be flushed. Equivalent to thetimeoutlen
Vim setting. Can be set to0
to disable the timeout entirely.
Explorer
explorer.autoReveal
(string|bool default:true
) - Whentrue
, the file explorer will jump to highlight the file current focused. Whenfalse
the file explorer will remain static. If a string is entered it must be"focusNoScroll"
which will still highlight the currently focused file in the file explorer but the file explorer will not scroll to it. Any other string supplied will be treated as iffalse
was entered and the file explorer will remain static and not highlight the currently focused file.files.useExperimentalFileWatcher
(bool default:true
) Whentrue
, a file watcher will be used to monitor file system changes and update the explorer in the sidebar.
Layout
workbench.activityBar.visible
(bool default:true
) - Controls whether or not the activity bar (icon bar) is visible.workbench.editor.showTabs
(bool default:true
) - Whenfalse
, hides the editor tabs.workbench.sideBar.location
("left"|"right" default:"left"
)__ - Controls the location of the sidebar.workbench.sideBar.visible
(bool default:true
) - Controls the visibility of the sidebar.workbench.statusBar.visible
(bool default:true
) - Controls the visibility of the status bar.window.menuBarVisibility
("visible" | "hidden" default:"visible"
)__ - Controls the visibility of the menu bar.window.titleBarStyle
("native" | "custom" default:"native"
on Windows,"custom"
otherwise)__ - Controls whether the titlebar is custom-rendered.oni.layout.showLayoutTabs
("always"|"smart"|"never" default:"smart"
)__ - Controls the display of layout tabs."smart"
will only show the tabs if there's more than one.oni.layout.layoutTabPosition
("top"|"bottom" default:"bottom"
)__ - Controls the position of the layout tabs.oni.layout.singleTabMode
(bool default:false
) - Whentrue
, groups will only hold a single editor, and closing this editor will always close the group. It will also hide the editor tabs, and therefore essentially hide the concept of editor groups.
Proxy
Onivim 2 can be configured to send requests through an HTTP/HTTPs proxy with the following configuration:
http.proxy
__(string default:null
) - A URL to be used as a proxy server, including the name and password. ie,"http.proxy": "http://user@pass:127.0.0.1:8888"
https.proxy
- __(string default:null
) - A URL to be used as a proxy server for HTTPs requests. If not specified, Onivim will fall back to thehttp.proxy
setting.
Rendering
vsync
(bool default:false
) - Whether rendering should sync with vertical retrace of the monitor. VSync adds input latency, as rendering must sync with the refresh rate of the monitor, but it reduces screen tearing.
UI
ui.shadows
(bool default:true
) - Use drop-shadows in the rendering of menus, overlays, etc.ui.zoom
(float default:1.0
) - Zoom setting for UI. Factor to scale UI elements. A value of2.0
will scale the UI by 200%.oni.inactiveWindowOpacity
(float default:0.75
) - The opacity value, from 0.0 to 1.0, of inactive windows.
Vim
vim.useSystemClipboard
(true
|false
|["yank", "paste", "delete"]
default:["yank"]
)__ - Whether or not deletes / yanks should integrate with the system clipboard:true
- all deletes and yanks, regardless of register used, will be pushed to the system clipboard. Equivalent to["yank", "paste", "delete"]
.["yank", "paste", "delete"]
- An array of strings. Each specified operation will always use the system clipboard. For example,["yank"]
will send all yanks to the system clipboard, but deletes and pastes will require using the+
or*
registers.["delete", "paste"]
means that all deletes will be sent to the system clipboard, and pastes using the unnamed register will come from the system clipboard, but only yanks with register+
and*
would be sent to the clipboard.false
- only deletes / yanks using the+
or*
registers will be pushed to the system clipboard. Equivalent to[]
.
High-DPI / UI Scaling
Onivim 2 should automatically pick up your scaling settings via the following per-platform strategies:
- Windows: On 8.1+, we use the 'scale factor' of the display device.
- OSX: - High-DPI / retina displays are automatically detected.
- Linux: - The
GDK_SCALE
environment variable is used, if available.
If the display scaling is not correct, you can override by using the --force-device-scale-factor
command-line argument, like:
oni2 --force-device-scale-factor=2.0
Experimental
Experimental features are features that we are working to stabilize and turn on-by-default.
NOTE: Experimental features may cause instability, like crashes. Use with caution!
experimental.editor.cursorSmoothCaretAnimation
- (bool default:false
) - Use an animation for moving the cursor caret.experimental.viml
- (string|list of string default:[]
) - Execute some VimL upon load. Example:"experimental.viml": ["nnoremap ; :"]
NOTE: The full set and scope of VimL compatibility is not currently tested. We are still working to enable test cases in
libvim
. Use at your own risk, in the meantime!
Language-specific configuration
Configuration can be specified per-filetype, by specifying a filetype in the configuration.json
, ie:
{
"editor.insertSpaces": true,
"[reason]": {
"editor.detectIndentation": false,
"editor.insertSpaces": false,
}
}
In the above example, the editor.insertSpaces
value of false
in the reason
section overrides the default of true
- this configures the editor to use tabs in reason files for indentation, and spaces elsewhere.