Overview
Rode stores your editor preferences in a Lua configuration file located at~/.config/rode/preferences.lua. This file controls core editor behavior like indentation, tab handling, and theme selection.
Configuration File
Preferences are configured using a simple Lua table format. The configuration file is automatically created with default values when you first launch Rode.Available Preferences
tab_size
The number of spaces to use for indentation. This value is clamped between 1 and 16.Source:
src/config/preferences.rs:66-68Implementation Details
Implementation Details
The parser enforces a minimum of 1 and maximum of 16:
use_spaces
When
true, the editor inserts spaces when you press Tab. When false, the editor inserts tab characters (\t).Source: src/config/preferences.rs:70-72The indent unit is calculated based on this setting:theme_name
The name of the theme to use. Can be any built-in theme name or
"Custom (theme.lua)" to load a custom theme from ~/.config/rode/theme.lua.Source: src/config/preferences.rs:73-75Available built-in themes:"Catppuccin Mocha"(default)"Gruvbox Dark""GitHub Dark""Nord""TokyoNight""Ayu Dark""Custom (theme.lua)"
File Location
The preferences file is located at:HOME environment variable:
src/config/theme_manager.rs:165-168
Loading Behavior
Rode automatically loads preferences on startup. If the configuration file doesn’t exist, default values are used:src/config/preferences.rs:41-48 and src/config/preferences.rs:13-21
Parser Details
The Lua configuration parser is simple and robust:- Empty lines and lines starting with
--are treated as comments - Lines containing
return {or}are ignored - Key-value pairs are parsed as
key = value - Values are automatically trimmed of quotes, commas, and whitespace
Parser Implementation
Parser Implementation
src/config/preferences.rs:50-81Examples
Minimal Configuration
Tab-based Indentation
Custom Theme
Wide Indentation
Related
Themes
Customize editor colors and syntax highlighting
Keybindings
Learn about keyboard shortcuts