Skip to main content

Options

Struct Options 

Source
pub struct Options {
Show 49 fields pub tabstop: u32, pub shiftwidth: u32, pub expandtab: bool, pub softtabstop: u32, pub iskeyword: String, pub ignorecase: bool, pub smartcase: bool, pub hlsearch: bool, pub incsearch: bool, pub wrapscan: bool, pub autoindent: bool, pub smartindent: bool, pub timeout_len: Duration, pub undo_levels: u32, pub undo_break_on_motion: bool, pub readonly: bool, pub wrap: WrapMode, pub textwidth: u32, pub number: bool, pub relativenumber: bool, pub numberwidth: usize, pub cursorline: bool, pub cursorcolumn: bool, pub signcolumn: SignColumnMode, pub foldcolumn: u32, pub foldmethod: FoldMethod, pub foldenable: bool, pub foldlevelstart: u32, pub foldmarker: String, pub colorcolumn: String, pub formatoptions: String, pub filetype: String, pub scrolloff: usize, pub sidescrolloff: usize, pub modeline: bool, pub modelines: u32, pub autoreload: bool, pub motion_sneak: bool, pub list: bool, pub listchars: ListChars, pub indent_guides: bool, pub indent_guide_char: char, pub colorizer: bool, pub colorizer_filetypes: Vec<String>, pub format_on_save: bool, pub trim_trailing_whitespace: bool, pub rainbow_brackets: bool, pub updatetime: u32, pub matchparen: bool,
}
Expand description

Editor settings surfaced via :set. Per SPEC. Consumed once trait extraction lands; today’s legacy Settings (in [crate::editor]) continues to drive runtime behaviour.

Fields§

§tabstop: u32

Display width of \t for column math + render. Default 8.

§shiftwidth: u32

Spaces per shift step (>>, <<, Ctrl-T, Ctrl-D).

§expandtab: bool

Insert spaces (true) or literal \t (false) for the Tab key.

§softtabstop: u32

Soft tab stop in spaces. When > 0, the Tab key (with expandtab) inserts spaces to the next softtabstop boundary, and Backspace at the end of a softtabstop-aligned space run deletes the whole run. 0 disables softtabstop semantics. Matches vim’s :set softtabstop.

§iskeyword: String

Characters considered part of a “word” for w/b/*/#. Default "@,48-57,_,192-255" (ASCII letters, digits, _, plus extended Latin); host may override per language.

§ignorecase: bool

Default false: search is case-sensitive.

§smartcase: bool

When true and ignorecase is true, an uppercase letter in the pattern flips back to case-sensitive for that search.

§hlsearch: bool

Highlight all matches of the last search.

§incsearch: bool

Incrementally highlight matches while typing the search pattern.

§wrapscan: bool

Wrap searches around the buffer ends.

§autoindent: bool

Copy previous line’s leading whitespace on Enter in insert mode.

§smartindent: bool

When true, bump indent by one shiftwidth after a line ending in { / ( / [, and strip one indent unit when the user types the matching } / ) / ] on an otherwise-whitespace-only line. Supersedes autoindent’s plain copy when on. Future: a tree-sitter indents.scm provider will replace the heuristic; see compute_enter_indent in vim.rs for the plug-in point.

§timeout_len: Duration

Multi-key sequence timeout (e.g., <C-w>v). Vim’s timeoutlen.

§undo_levels: u32

Maximum undo-tree depth. Older entries pruned.

§undo_break_on_motion: bool

Break the current undo group on cursor motion in insert mode. Matches vim default; turn off to merge multi-segment edits.

§readonly: bool

Reject every edit. :set ro sets this; :w! clears it.

§wrap: WrapMode

Soft-wrap behavior for lines that exceed the viewport width. Maps directly to :set wrap / :set linebreak / :set nowrap.

§textwidth: u32

Wrap column for gq{motion} text reflow. Vim’s default is 79.

§number: bool

Show absolute line numbers in the gutter. Matches :set number. Default true.

§relativenumber: bool

Show relative line offsets in the gutter. Combined with number, enables hybrid mode. Matches :set relativenumber. Default false.

§numberwidth: usize

Minimum gutter width in cells for the line-number column. Width grows past this to fit the largest displayed number. Matches vim’s :set numberwidth / :set nuw. Default 4. Range 1..=20.

§cursorline: bool

Highlight the row where the cursor sits. Matches vim’s :set cursorline. Default true (hjkl diverges from vim’s false — improves visual orientation, matches most modern editor defaults).

§cursorcolumn: bool

Highlight the column where the cursor sits. Matches vim’s :set cursorcolumn. Default false.

§signcolumn: SignColumnMode

Whether to reserve a 1-cell sign column for diagnostics and git signs. Matches vim’s :set signcolumn. Default SignColumnMode::Auto.

§foldcolumn: u32

Number of cells reserved for a fold-marker gutter (0 = none, max 12). Matches vim’s :set foldcolumn. Default 0.

§foldmethod: FoldMethod

How folds are automatically generated. Matches vim’s :set foldmethod. Default FoldMethod::Expr (tree-sitter) — diverges from vim’s manual default; functions/if/match/blocks fold when folds.scm ships. Alias fdm.

§foldenable: bool

Enable auto-folds. When false, no folds are generated regardless of foldmethod. Matches vim’s :set foldenable. Alias fen. Default true.

§foldlevelstart: u32

Level at which folds start open. 99 (default) means all folds open; 0 means all closed. Matches vim’s :set foldlevelstart. Alias fls.

§foldmarker: String

Open/close markers for FoldMethod::Marker, as a comma-separated pair open,close. Matches vim’s :set foldmarker / fmr. Default "{{{,}}}". An invalid value (no comma, or an empty side) falls back to the default at fold-extraction time.

§colorcolumn: String

Comma-separated 1-based column indices for vertical rulers. Empty string = no rulers. Matches vim’s :set colorcolumn. Default "".

§formatoptions: String

Format-options flags (subset of vim’s formatoptions / fo). r — auto-continue line comments on <Enter> in insert mode. o — auto-continue line comments on o / O in normal mode. Default "ro" (both on).

§filetype: String

Active filetype for the current buffer (e.g. "rust", "python"). Matches vim’s :set filetype / :set ft. Default "" (plain text).

§scrolloff: usize

Minimum number of context rows kept visible above and below the cursor when scrolling. 999 (or any value ≥ half the viewport height) keeps the cursor centred. 0 disables the margin. Matches vim’s :set scrolloff / :set so. Default 5.

§sidescrolloff: usize

Minimum number of context columns kept visible left and right of the cursor when scrolling horizontally (no-wrap mode only). 0 disables. Matches vim’s :set sidescrolloff / :set siso. Default 0.

§modeline: bool

Enable vim modeline parsing on file open. When true, hjkl scans the first/last modelines lines for vim: / ex: / vi: markers and applies per-buffer option overrides. Matches vim’s :set modeline. Default true.

§modelines: u32

Number of lines from each end to scan for vim modelines. Matches vim’s :set modelines. Default 5.

§autoreload: bool

Auto-reload a clean (non-dirty) buffer when its file changes on disk (detected by :checktime / focus-regain). When false, an external change is reported as a warning and the buffer is left untouched. Matches vim’s :set autoread. Default true.

§motion_sneak: bool

Enable vim-sneak style two-char digraph jump on s / S in normal mode. When true (default), s/S operate as sneak jumps rather than vim’s built-in substitute-char / substitute-line. :set nomotion_sneak reverts to standard vim behavior. Default trueBREAKING for users relying on s = substitute-char.

§list: bool

Render invisible characters (tabs, trailing spaces, EOL markers). Matches vim’s :set list / :set nolist. Default false.

§listchars: ListChars

Characters used to represent invisibles when list is on. Matches vim’s :set listchars / :set lcs. Default matches vim: tab:^I,eol:$.

§indent_guides: bool

Render thin vertical indent guides at every shiftwidth-aligned column in the viewport. hjkl-specific option. Default true. :set noindent_guides / :set noig disables.

§indent_guide_char: char

Character painted as the indent guide. Default '│'. :set indent_guide_char=<char> / :set igc=<char> to customize.

§colorizer: bool

Enable inline color-literal preview (hex, rgb, hsl, named CSS colors). hjkl-specific. Default true. :set nocolorizer disables globally regardless of filetype.

§colorizer_filetypes: Vec<String>

Allowlist of filetypes for which the colorizer runs. Comma-separated in :set colorizer_filetypes=css,scss,toml. Default: ["css","scss","sass","less","html","vue","svelte","tailwindcss","toml","lua","vim"].

§format_on_save: bool

Run the registered hjkl-mangler formatter for the buffer’s path before each :w save. On formatter error the save is aborted. When no formatter is registered for the file extension, or the tool is not installed, the save proceeds without formatting (warn-and-fall-through for missing tool). hjkl-specific. Alias fos. Default true.

§trim_trailing_whitespace: bool

Strip trailing [ \t] from every line in the buffer before each :w save. Applied in-place so post-save :e reflects the trimmed content. hjkl-specific. Alias tts. Default false.

§rainbow_brackets: bool

Enable helix-style rainbow bracket coloring via tree-sitter. hjkl-specific. Alias rb. Default true.

§updatetime: u32

Milliseconds of inactivity after which the swap file is written. Matches Vim’s :set updatetime / :set ut. Default 4000. hjkl-specific swap-file write cadence; does NOT affect CursorHold.

§matchparen: bool

Highlight matching bracket pair under the cursor (vim matchparen). When true (default), both the bracket under the cursor and its matching partner are highlighted with the match_paren theme style. C-style brackets only: ()[]{} and <>. Alias mps. :set nomatchparen disables. hjkl-specific.

Implementations§

Source§

impl Options

Source

pub fn set_by_name( &mut self, name: &str, val: OptionValue, ) -> Result<(), EngineError>

Set an option by name. Vim-flavored option naming. Returns EngineError::Ex for unknown names or type-mismatched values.

Booleans accept OptionValue::Bool(_) directly or OptionValue::Int(0)/Int(non_zero). Integers accept only Int(_). Strings accept only String(_).

Source

pub fn get_by_name(&self, name: &str) -> Option<OptionValue>

Read an option by name. None for unknown names.

Trait Implementations§

Source§

impl Clone for Options

Source§

fn clone(&self) -> Options

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Options

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Options

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for Options

Source§

impl PartialEq for Options

Source§

fn eq(&self, other: &Options) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Options

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more