Skip to main content

Settings

Struct Settings 

Source
pub struct Settings {
Show 57 fields pub shiftwidth: usize, pub tabstop: usize, pub ignore_case: bool, pub smartcase: bool, pub wrapscan: bool, pub textwidth: usize, pub expandtab: bool, pub softtabstop: usize, pub wrap: Wrap, pub readonly: bool, pub modifiable: bool, pub autoindent: bool, pub smartindent: bool, pub undo_levels: u32, pub undo_break_on_motion: bool, pub iskeyword: String, pub timeout_len: Duration, 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 commentstring: String, pub makeprg: String, pub errorformat: String, pub autopair: bool, pub autoclose_tag: bool, pub scrolloff: usize, pub sidescrolloff: usize, pub autoreload: bool, pub motion_sneak: bool, pub list: bool, pub tabline_icons: bool, pub blame_inline: bool, pub diagnostics_inline: DiagInlineMode, 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 scroll_duration_ms: u16, pub selection_exclusive: bool, pub undo_granularity: UndoGranularity,
}
Expand description

Vim-style options surfaced by :set. New fields land here as individual ex commands gain :set plumbing.

Fields§

§shiftwidth: usize

Spaces per shift step for >> / << / Ctrl-T / Ctrl-D.

§tabstop: usize

Visual width of a \t character. Stored for future render hookup; not yet consumed by the buffer renderer.

§ignore_case: bool

When true, / / ? patterns and :s/.../.../ ignore case without an explicit i flag.

§smartcase: bool

When true and ignore_case is true, an uppercase letter in the pattern flips that search back to case-sensitive. Matches vim’s :set smartcase. Default false.

§wrapscan: bool

Wrap searches past buffer ends. Matches vim’s :set wrapscan. Default true.

§textwidth: usize

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

§expandtab: bool

When true, the Tab key in insert mode inserts tabstop spaces instead of a literal \t. Matches vim’s :set expandtab. Default false.

§softtabstop: usize

Soft tab stop in spaces. When > 0, Tab inserts spaces to the next softtabstop boundary (when expandtab), and Backspace at the end of a softtabstop-aligned space run deletes the entire run as if it were one tab. 0 disables. Matches vim’s :set softtabstop.

§wrap: Wrap

Soft-wrap mode the renderer + scroll math + gj / gk use. Default is hjkl_buffer::Wrap::None — long lines extend past the right edge and top_col clips the left side. :set wrap flips to char-break wrap; :set linebreak flips to word-break wrap; :set nowrap resets.

§readonly: bool

When true, the engine drops every edit before it touches the buffer — undo, dirty flag, and change log all stay clean. Matches vim’s :set readonly / :set ro. Default false.

§modifiable: bool

When false, ALL buffer modifications are blocked, including entering insert/replace mode. Matches vim’s :set nomodifiable / :set noma. Default true.

§autoindent: bool

When true, pressing Enter in insert mode copies the leading whitespace of the current line onto the new line. Matches vim’s :set autoindent. Default true (vim parity).

§smartindent: bool

When true, bumps indent by one shiftwidth after a line ending in { / ( / [, and strips one indent unit when the user types } / ) / ] on a whitespace-only line. See compute_enter_indent in vim.rs for the tree-sitter plug-in seam. Default true.

§undo_levels: u32

Cap on undo-stack length. Older entries are pruned past this bound. 0 means unlimited. Matches vim’s :set undolevels. Default 1000.

§undo_break_on_motion: bool

When true, cursor motions inside insert mode break the current undo group (so a single u only reverses the run of keystrokes that preceded the motion). Default true. Currently a no-op — engine doesn’t yet break the undo group on insert-mode motions; field is wired through :set undobreak for forward compatibility.

§iskeyword: String

Vim-flavoured “what counts as a word” character class. Comma-separated tokens: @ = is_alphabetic(), _ = literal _, 48-57 = decimal char range, bare integer = single char code, single ASCII punctuation = literal. Default "@,48-57,_,192-255" matches vim.

§timeout_len: Duration

Multi-key sequence timeout (e.g. gg, dd). When the user pauses longer than this between keys, any pending prefix is abandoned and the next key starts a fresh sequence. Matches vim’s :set timeoutlen / :set tm (millis). Default 1000ms.

§number: bool

When true, render absolute line numbers in the gutter. Matches vim’s :set number / :set nu. Default true.

§relativenumber: bool

When true, render line numbers as offsets from the cursor row. Combined with number, the cursor row shows its absolute number while other rows show the relative offset (vim’s nu+rnu hybrid). Matches vim’s :set relativenumber / :set rnu. 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 false.

§cursorcolumn: bool

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

§signcolumn: SignColumnMode

Sign-column display mode. Matches vim’s :set signcolumn. Default crate::types::SignColumnMode::Auto.

§foldcolumn: u32

Number of cells reserved for a fold-marker gutter. Matches vim’s :set foldcolumn. Default 0.

§foldmethod: FoldMethod

How folds are automatically generated. Default Expr (tree-sitter). Alias fdm. Matches vim’s :set foldmethod.

§foldenable: bool

Enable automatic folds. Default true. Alias fen. Matches vim’s :set foldenable.

§foldlevelstart: u32

Level at which auto-folds start open. 99 = all open (default). Alias fls. Matches vim’s :set foldlevelstart.

§foldmarker: String

Open/close markers for foldmethod=marker, comma-separated open,close. Matches vim’s :set foldmarker / fmr. Default "{{{,}}}".

§colorcolumn: String

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

§formatoptions: String

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

§filetype: String

Active filetype (language name) for the current buffer. Used by comment-continuation and future language-aware features. Matches vim’s :set filetype / :set ft. Default "" (plain text).

§commentstring: String

Override comment-string for the current buffer.

When non-empty, used by toggle_comment_range instead of the per-filetype default from hjkl_lang::comment::commentstring_for_lang. Follows vim’s :set commentstring=… — use %s as the text placeholder (e.g. "// %s") for compatibility; the toggle strips/inserts only the prefix/suffix portion (before/after %s). An empty string means “use the filetype default”. Default "".

§makeprg: String

Program run by :make (vim’s makeprg). Its stdout+stderr are parsed via the errorformat into the quickfix list. Default "cargo check".

§errorformat: String

Comma-separated list of errorformat patterns used by :cexpr / :lgetexpr etc. to parse text into quickfix entries. Follows vim’s 'errorformat' / 'efm'. Default: "%f:%l:%c:%m,%f:%l:%m,%l:%c:%m".

§autopair: bool

When true, typing an opening bracket or quote automatically inserts the matching close character and parks the cursor between them. Matches vim’s set autopairs (Neovim) / nvim-autopairs behaviour. Default true.

§autoclose_tag: bool

When true, typing > to close an HTML/XML opening tag automatically inserts </tagname> after the cursor. Only fires for filetypes in the HTML/XML family (html, xml, svg, jsx, tsx, vue, svelte). Matches common editor “autoclose tag” behaviour. Default: true for those filetypes (the caller gates on filetype), true stored here so :set noautoclose-tag can disable it globally.

§scrolloff: usize

Minimum context rows kept visible above/below the cursor when scrolling. Capped at (height - 1) / 2 for tiny viewports. 0 = no margin. Matches vim’s :set scrolloff / :set so. Default 5.

§sidescrolloff: usize

Minimum context columns kept visible left/right of the cursor (no-wrap mode only). 0 = no margin (vim default). Matches :set sidescrolloff. Default 0.

§autoreload: bool

Auto-reload a clean buffer when its file changes on disk. Matches vim’s :set autoread. Default true. Consumed by the host’s :checktime.

§motion_sneak: bool

Enable vim-sneak style two-char digraph jump via s (forward) and S (backward). When true (default), s/S no longer behave as vim’s built-in substitute-char / substitute-line; ;/, smart-fall- back to sneak-repeat when the last horizontal motion was a sneak. Set :set nomotion_sneak to revert s/S to stock 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.

§tabline_icons: bool

Show Nerd-Font filetype icons in the tabline. :set tabline_icons / :set notabline_icons. Default true.

§blame_inline: bool

Show inline git blame as end-of-line virtual text on the cursor line (gitsigns-style). Default true. (#202)

§diagnostics_inline: DiagInlineMode

Inline diagnostic ghost-text mode (Error-Lens style // message at the end of the line). Default crate::types::DiagInlineMode::All.

§listchars: ListChars

Characters used to represent invisibles when list is on. Matches vim’s :set listchars / :set lcs.

§indent_guides: bool

Render thin vertical indent guides at every shiftwidth-aligned column. hjkl-specific. Default true.

§indent_guide_char: char

Character used to draw indent guides. Default '│'.

§colorizer: bool

Enable inline color-literal preview. hjkl-specific. Default true.

§colorizer_filetypes: Vec<String>

Filetype allowlist for the colorizer. Default CSS/template languages.

§format_on_save: bool

Run hjkl-mangler formatter before each :w save. Default false.

§trim_trailing_whitespace: bool

Strip trailing whitespace before each :w save. Default false.

§rainbow_brackets: bool

Enable helix-style rainbow bracket coloring. hjkl-specific. Default true.

§updatetime: u32

Milliseconds of inactivity before swap-file write. Default 4000. Matches Vim’s updatetime; alias ut.

§matchparen: bool

Highlight matching bracket pair under the cursor. hjkl-specific. Default true. :set nomatchparen / :set mps to toggle. Only the char-scan path (C-style brackets) is active; tag-pair matching is pending #240.

§scroll_duration_ms: u16

Smooth-scroll animation duration for page/recenter motions, ms. :set scroll_duration_ms. Default 0 (instant — animation off).

§selection_exclusive: bool

When true, char-wise Visual selections are treated as half-open (exclusive end): the cell at the cursor/head position is NOT included in the selection. This matches VSCode / kakoune bar-cursor semantics where the caret sits between characters. Default false (vim inclusive). The vim oracle path must leave this at false; set it programmatically for VSCode keybinding mode.

§undo_granularity: UndoGranularity

How coarsely a single u (or Ctrl+Z) step walks back through changes made during an insert session.

  • InsertSession (default, vim parity): one undo step reverts the entire session from i to <Esc>. This is byte-identical to vim’s behaviour and must never be changed for the vim path.
  • Word: mid-session undo breaks are inserted at word boundaries (non-whitespace char following whitespace, or a newline). One step of u then reverts roughly one word of typing at a time — matching VSCode’s “edit-chunked Ctrl+Z” experience.

The vim oracle path must leave this at InsertSession. VSCode keybinding mode sets it to Word via propagate_vscode_settings. Other future FSMs may choose freely.

Trait Implementations§

Source§

impl Clone for Settings

Source§

fn clone(&self) -> Settings

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 Settings

Source§

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

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

impl Default for Settings

Source§

fn default() -> Self

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

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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