pub struct Options {Show 51 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 modifiable: 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,
pub fixendofline: 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: u32Display width of \t for column math + render. Default 8.
shiftwidth: u32Spaces per shift step (>>, <<, Ctrl-T, Ctrl-D).
expandtab: boolInsert spaces (true) or literal \t (false) for the Tab key.
softtabstop: u32Soft 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: StringCharacters 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: boolDefault false: search is case-sensitive.
smartcase: boolWhen true and ignorecase is true, an uppercase letter in the
pattern flips back to case-sensitive for that search.
hlsearch: boolHighlight all matches of the last search.
incsearch: boolIncrementally highlight matches while typing the search pattern.
wrapscan: boolWrap searches around the buffer ends.
autoindent: boolCopy previous line’s leading whitespace on Enter in insert mode.
smartindent: boolWhen 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: DurationMulti-key sequence timeout (e.g., <C-w>v). Vim’s timeoutlen.
undo_levels: u32Maximum undo-tree depth. Older entries pruned.
undo_break_on_motion: boolBreak the current undo group on cursor motion in insert mode. Matches vim default; turn off to merge multi-segment edits.
readonly: boolReject every edit. :set ro sets this; :w! clears it.
modifiable: boolWhen false, block ALL buffer modifications including entering insert/replace
mode. Used for special buffers (explorer). Matches vim’s :set nomodifiable /
:set noma. Default true.
wrap: WrapModeSoft-wrap behavior for lines that exceed the viewport width.
Maps directly to :set wrap / :set linebreak / :set nowrap.
textwidth: u32Wrap column for gq{motion} text reflow. Vim’s default is 79.
number: boolShow absolute line numbers in the gutter. Matches :set number.
Default true.
relativenumber: boolShow relative line offsets in the gutter. Combined with number,
enables hybrid mode. Matches :set relativenumber. Default false.
numberwidth: usizeMinimum 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: boolHighlight the row where the cursor sits. Matches vim’s :set cursorline.
Default true — a deliberate hjkl divergence from vim, which defaults
to nocursorline. Use :set nocul to turn it off. Must stay in
lockstep with crate::editor::Settings::default, which
settings_default_matches_options_default pins — the two disagreed
once and the Options side silently won in a fresh session.
cursorcolumn: boolHighlight the column where the cursor sits. Matches vim’s :set cursorcolumn.
Default false — vim parity (nocursorcolumn), and the same value
crate::editor::Settings::default carries. Kept in lockstep by the
same test as Self::cursorline.
signcolumn: SignColumnModeWhether to reserve a 1-cell sign column for diagnostics and git signs.
Matches vim’s :set signcolumn. Default SignColumnMode::Auto.
foldcolumn: u32Number of cells reserved for a fold-marker gutter (0 = none, max 12).
Matches vim’s :set foldcolumn. Default 0.
foldmethod: FoldMethodHow 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: boolEnable auto-folds. When false, no folds are generated regardless
of foldmethod. Matches vim’s :set foldenable. Alias fen.
Default true.
foldlevelstart: u32Level at which folds start open. 99 (default) means all folds open;
0 means all closed. Matches vim’s :set foldlevelstart. Alias fls.
foldmarker: StringOpen/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: StringComma-separated 1-based column indices for vertical rulers.
Empty string = no rulers. Matches vim’s :set colorcolumn. Default "".
formatoptions: StringFormat-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: StringActive filetype for the current buffer (e.g. "rust", "python").
Matches vim’s :set filetype / :set ft. Default "" (plain text).
scrolloff: usizeMinimum 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: usizeMinimum 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: boolEnable 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: u32Number of lines from each end to scan for vim modelines.
Matches vim’s :set modelines. Default 5.
autoreload: boolAuto-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: boolEnable 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 true — BREAKING for users relying on s = substitute-char.
list: boolRender invisible characters (tabs, trailing spaces, EOL markers).
Matches vim’s :set list / :set nolist. Default false.
listchars: ListCharsCharacters used to represent invisibles when list is on.
Matches vim’s :set listchars / :set lcs.
Default matches vim: tab:^I,eol:$.
indent_guides: boolRender 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: charCharacter painted as the indent guide. Default '│'.
:set indent_guide_char=<char> / :set igc=<char> to customize.
colorizer: boolEnable 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: boolRun 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: boolStrip 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: boolEnable helix-style rainbow bracket coloring via tree-sitter.
hjkl-specific. Alias rb. Default true.
updatetime: u32Milliseconds 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: boolHighlight 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.
fixendofline: boolVim 'fixendofline' / 'fixeol'. When true (the vim default), a
buffer whose last line has no terminating newline gets one added on
write. When false, the file’s original end-of-line state
('endofline') is preserved byte-for-byte.
This is a plain user option — unlike 'endofline' it is NEVER
derived from the file. 'endofline' is buffer-local state owned by
the host (it is set from the bytes actually read), so it has no
Options field; see hjkl’s save::EolState.
Implementations§
Source§impl Options
impl Options
Sourcepub fn set_by_name(
&mut self,
name: &str,
val: OptionValue,
) -> Result<(), EngineError>
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(_).
Sourcepub fn get_by_name(&self, name: &str) -> Option<OptionValue>
pub fn get_by_name(&self, name: &str) -> Option<OptionValue>
Read an option by name. None for unknown names.
Trait Implementations§
impl Eq for Options
impl StructuralPartialEq for Options
Auto Trait Implementations§
impl Freeze for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnsafeUnpin for Options
impl UnwindSafe for Options
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more