Neovim Statusline is a VS Code extension leveraging Custom UI Style's CSS and JavaScript injection capabilities to style the UI based on current VSCode Neovim mode. Originally written to get a nicer-looking status bar with mode badge, it now also supports styling cursors, current line highlights, and other UI elements per mode.
Why not
|
| Setting | Type | Default | Description |
|---|---|---|---|
neovim-statusline.enabled |
boolean | true |
Turns styling on or off. If disabled, custom CSS and JS imports are removed from Custom UI Style’s external.imports |
neovim-statusline.autoInject |
boolean | true |
Automatically add the extension’s CSS/JS paths to Custom UI Style’s external.imports. Set to false to manage paths yourself (use the Copy CSS Path / Copy JS Path commands). |
neovim-statusline.variables |
object | see below | CSS variables to define at :root level |
neovim-statusline.styles |
object | see below | CSS property values per Neovim mode and UI element selector |
neovim-statusline.variables
These are standard CSS variables, prefixed with --. You can redefine the default ones and/or add your own. You can use standard CSS color functions like rgb(), hsl(), calc(), color-mix() and so on.
For reference, here are the default values:
{
"neovim-statusline.variables": {
"--nvim-normal-primary": "#79a2f8",
"--nvim-insert-primary": "#9ecf6a",
"--nvim-visual-primary": "#bc9af8",
"--nvim-replace-primary": "#f7768e",
"--nvim-command-primary": "#e0af68"
}
}
neovim-statusline.styles
Here's an annotated example of what you can do:
{
"neovim-statusline.styles": {
// "default" applies to all modes unless overridden by a mode-specific style
"default": {
// These are basically your regular CSS rulesets, except we can use a bunch of built-in
// predefined aliases, namely:
// - %statusBar - VS Code status bar
// - %statusBarItem - VSCode Neovim status bar item
// - %modeBadge - mode badge (NORMAL, INSERT etc.)
// - %message - the rest of status line (may include visual selection size, command message,
// macro recording status, etc.)
// - %messagePart - individual parts of %message
// The rest are self-explanatory:
// - %cursor
// - %currentLine
// - %currentLineNumber
// - %editor
// - %focusedEditor
// - %workbench
// These aliases can be used alone or as a part of your regular CSS selectors.
"%statusBarItem": {
// Default monospace font variable provided by Custom UI Style
"font-family": "var(--cus-mono)",
},
"%modeBadge": {
"color": "var(--vscode-statusBar-background)", // Using theme color variable provided by VS Code
"padding-left": "5px", // Change badge padding
"padding-right": "5px",
},
// Message parts have their text content doubled in 'data-text' attribute.
// For example, you can use it to make it really obvious when you're recording a macro:
"%messagePart[data-text^=\"recording @\"]": {
"background-color": "#d35ca5", // A bright badge background
"color": "var(--vscode-statusBar-background)", // Text color to match status bar background
"font-weight": "bold",
},
},
// Styles for specific modes
"normal": {
// Make the current line tint less subtle than the default mix
"%currentLine": {
"background-color": "color-mix(in srgb, var(--nvim-normal-primary) 10%, var(--vscode-editor-background))",
},
},
"insert": {
// You don't have to use the selector aliases if you don't want to.
// For example, the following is equivalent to "%focusedEditor .monaco-editor-background":
".monaco-editor.focused .monaco-editor-background": {
// This changes the background for the whole editor:
"background-color": "#112211",
},
// And this is the current line in ANY editor:
".monaco-editor .view-overlays .current-line": {
"background-color": "#112f11",
},
},
"visual": {},
"replace": {
// Remove the current line highlight override for replace mode:
"%currentLine": null,
},
"command": {
// Hide the mode badge in command mode:
"%modeBadge": {
"display": "none",
},
},
},
}
For default settings, please refer to package.json.
Commands
Available via the Command Palette under Neovim Statusline:
- Reload — Manually regenerate CSS from settings and reload Custom UI Style (requires VS Code restart).
- Toggle Styling — Toggle the
neovim-statusline.enabledsetting on or off. - Copy CSS Path — Copy the generated CSS file path to the clipboard (for manual injection when auto-inject is off).
- Copy JS Path — Copy the statusline JS file path to the clipboard (for manual injection when auto-inject is off).