KConfig Editor
The KConfig Editor provides enhanced editing capabilities for ESP-IDF configuration files, including syntax highlighting, content assist, and intelligent editing features. It supports all KConfig file types used in ESP-IDF projects.
Supported File Types
The KConfig Editor automatically recognizes and provides enhanced editing for the following file types:
Kconfig- Main configuration filesKconfig.projbuild- Project-specific configuration files
Features
Syntax Highlighting
The editor provides comprehensive syntax highlighting for all KConfig language constructs:
Keywords:
config,menuconfig,choice,menu,endmenu,endchoiceTypes:
bool,tristate,string,hex,intProperties:
default,depends,select,help,promptValues:
y,n,m, string literals, hexadecimal and integer valuesComments: Line comments starting with
#
Content Assist
Intelligent content proposals are available when editing KConfig files:
Main Keywords: Proposals for
config,menuconfig,choice,menu, etc.Types: Suggestions for
bool,tristate,string,hex,intProperties: Auto-completion for
default,depends,select,help,promptValues: Context-aware suggestions for
y,n,m, and string values
Auto-closing Pairs
The editor automatically handles bracket and quote pairing:
Parentheses: Automatically closes
(with)Quotes: Automatically closes
"with"Smart Cursor Positioning: Cursor stays in the optimal position for continued typing
Example of auto-closing pairs:
config ESP32_WIFI_ENABLED
bool "Enable WiFi"
default y
depends on (IDF_TARGET="esp32" || IDF_TARGET="esp32s2")
help
"Enable WiFi support for ESP32"
When you type depends on (, the editor automatically adds ) and positions the cursor between them.
Smart Indentation
The editor provides intelligent indentation rules for KConfig structure:
Increase Indent: After
menu,config,menuconfig,choice,help,commentDecrease Indent: After
endmenu,endchoice,endifConsistent Formatting: Maintains proper KConfig file structure
Bracket Matching
Visual highlighting of matching bracket pairs:
Menu Blocks:
menuandendmenupairsChoice Blocks:
choiceandendchoicepairsParentheses:
(and)pairsQuotes:
"and"pairs
Code Folding
Support for folding KConfig blocks:
Menu Sections: Fold/unfold menu blocks
Choice Sections: Fold/unfold choice blocks
Comment Regions: Fold/unfold comment sections
Usage
Opening KConfig Files
KConfig files are automatically opened with the enhanced editor when:
Double-clicking on any
KconfigorKconfig.projbuildfile in the Project ExplorerRight-clicking and selecting “Open With > KConfig Editor”
Opening files from the File menu
The editor will automatically detect the file type and apply the appropriate syntax highlighting and features.
Editing KConfig Files
When editing KConfig files, you can take advantage of:
Content Assist: Press
Ctrl+Spaceto trigger content proposalsAuto-completion: Type partial keywords and press
Tabto completeBracket Navigation: Use
Ctrl+Shift+Pto jump between matching bracketsCode Folding: Click the fold icons in the editor gutter to collapse/expand sections
Example KConfig Entry
Here’s an example of a complete KConfig entry with syntax highlighting:
config ESP32_WIFI_ENABLED
bool "Enable WiFi Support"
default y
depends on IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2
select ESP32_WIFI
help
Enable WiFi support for ESP32 and ESP32-S2 chips.
This option enables the WiFi driver and related functionality.
It requires the ESP32 or ESP32-S2 target to be selected.
config ESP32_WIFI_MAX_CONN_NUM
int "Maximum number of WiFi connections"
range 1 10
default 4
depends on ESP32_WIFI_ENABLED
help
Maximum number of concurrent WiFi connections supported.