Add simple syntax highlighting

This commit is contained in:
2026-05-04 21:33:35 +03:00
parent ef401b5aaa
commit e4462f9674
10 changed files with 245 additions and 3 deletions
+1 -1
View File
@@ -6,5 +6,5 @@ selected_style_fallback: "default-fallback" # Style for 8-color capable terminal
show_top_menu: true
show_line_index: true
extend_line_index: false # Extend line index to the bottom of the screen
buffer_info_message: "File: %f Cursor: (%x, %y, %p) Chars: %c"
buffer_info_message: "File: %f, Filetype: %t, Cursor: (%x, %y, %p), Chars: %c"
tab_indentation: 4 # Length of tab characters
+8
View File
@@ -19,3 +19,11 @@ colors:
message_bar_fg: "black" # Message bar text color
input_bar_bg: "245" # Input bar background color
input_bar_fg: "black" # Input bar text color
# Syntax highlighting
syntax_comment: "darkgray"
syntax_keyword: "lightgreen"
syntax_identifier: "yellow"
syntax_constant: "purple"
syntax_variable: "yellow"
syntax_string: "purple"
+10 -1
View File
@@ -5,6 +5,7 @@ style_type: "256-color"
# Colors
colors:
# Main colors
buffer_area_bg: "234" # Buffer area background color
buffer_area_fg: "white" # Buffer area text color
buffer_area_sel: "243" # Buffer area selected text and cursor background color
@@ -18,4 +19,12 @@ colors:
message_bar_bg: "236" # Message bar background color
message_bar_fg: "white" # Message bar text color
input_bar_bg: "236" # Input bar background color
input_bar_fg: "white" # Input bar text color
input_bar_fg: "white" # Input bar text color
# Syntax highlighting
syntax_comment: "gray"
syntax_keyword: "gold"
syntax_identifier: "purple"
syntax_constant: "teal"
syntax_variable: "purple"
syntax_string: "blue"
+15
View File
@@ -0,0 +1,15 @@
filetype: yaml
filenames: ".y[a]?ml$"
rules:
- type: string # Strings
regex: '(["''])(.*?)(["''])'
- type: comment
regex: "#.*"
- type: identifier # Keys
regex: '^[[:blank:]]*(-.)?([a-z0-9\._\-])+:'
multiline: true
- type: constant # Number values
regex: '\d+(\.\d+)?'
- type: constant # True/false values
regex: '\b(YES|yes|Y|y|ON|on|TRUE|True|true|NO|no|N|n|OFF|off|FALSE|False|false)\b'