Skip to content

Commit 9029241

Browse files
committed
fix: initial nano support
1 parent ebe7479 commit 9029241

File tree

8 files changed

+311
-0
lines changed

8 files changed

+311
-0
lines changed

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,67 @@ The theme files can be located in:
174174
- `~/.config/ghostty/themes` (recommended)
175175
- You can also use absolute paths in your config file
176176

177+
## Nano Editor Installation
178+
179+
### Manual Installation
180+
1. Create the required directories:
181+
```bash
182+
mkdir -p ~/.nano/syntax
183+
```
184+
185+
2. Copy the theme files:
186+
```bash
187+
cp nano/main-oscura.nanorc ~/.nanorc
188+
cp -r nano/syntax/* ~/.nano/syntax/
189+
```
190+
191+
### Color Scheme
192+
The theme uses the following color mappings:
193+
- Keywords: yellow
194+
- Functions and Types: green
195+
- Comments: bright blue
196+
- Strings and Numbers: yellow
197+
- Decorators and Special: cyan
198+
- Background: black
199+
- Foreground: white
200+
201+
### Note
202+
- Nano's color support is limited to basic terminal colors
203+
- The theme adapts the Oscura color scheme to work within nano's limitations
204+
- For best results, ensure your terminal supports basic colors
205+
- Some terminals may display colors differently
206+
207+
### TypeScript Support
208+
The theme includes comprehensive syntax highlighting for TypeScript:
209+
210+
- **Language Features**
211+
- Type annotations and interfaces
212+
- Generics and type parameters
213+
- Decorators
214+
- Modern TypeScript keywords
215+
- JSX/TSX syntax
216+
217+
- **Color Scheme**
218+
- Keywords: yellow
219+
- Types and Classes: green
220+
- Type Annotations: cyan
221+
- Decorators: magenta
222+
- Strings: yellow
223+
- Numbers: red
224+
- Comments: bright blue
225+
- Special Characters: magenta
226+
- Function Calls: green
227+
228+
- **File Types**
229+
- `.ts` - TypeScript files
230+
- `.tsx` - TypeScript React files
231+
232+
### Usage
233+
TypeScript highlighting is automatically enabled for files with `.ts` and `.tsx` extensions.
234+
235+
### Note
236+
For TSX files, ensure your nano version supports JSX syntax highlighting (nano 4.0 or later recommended).
237+
177238
## License
178239

179240
MIT License - see LICENSE file for details

nano/main-oscura.nanorc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## Oscura theme for nano
2+
## Author: Vinit Kumar
3+
## License: MIT
4+
5+
# Basic Colors
6+
set titlecolor white,black
7+
set statuscolor white,black
8+
set errorcolor red,black
9+
set selectedcolor white,blue
10+
set stripecolor black
11+
set numbercolor cyan
12+
set keycolor yellow
13+
set functioncolor green
14+
15+
# Include the syntax files
16+
include "~/.nano/syntax/*.nanorc"

nano/oscura-dusk.nanorc

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
## Oscura Dusk theme for nano
2+
## Author: Vinit Kumar
3+
## License: MIT
4+
5+
# Basic Colors
6+
set titlecolor #E6E6E6,#131419
7+
set statuscolor #E6E6E6,#131419
8+
set errorcolor #FF5C5C,#131419
9+
set selectedcolor #E6E6E6,#5A5B63
10+
set stripecolor #232323
11+
set numbercolor #46474F
12+
set keycolor #9099A1
13+
set functioncolor #E6E7A3
14+
15+
# Common Syntax Colors
16+
set functioncolor #E6E7A3
17+
set numbercolor #F9B98C
18+
set stringcolor #F9B98C
19+
set commentcolor #46474F
20+
set specialcolor #9592A4
21+
set keywordcolor #9099A1
22+
set constantcolor #F9B98C
23+
24+
# General Programming Syntax
25+
color #9099A1 "\<(if|else|for|while|do|return|break|continue|switch|case|default|try|catch|finally|throw|throws)\>"
26+
color #F9B98C ""([^"]|\\")*"|'([^']|\\')*'"
27+
color #46474F "(^|[[:space:]])//.*"
28+
color #46474F start="/\*" end="\*/"
29+
color #F9B98C "\<([0-9]+)\>"
30+
color #9592A4 "[.,;:{}()<>!=&|+\-/*%^]"
31+
color #E6E7A3 "\<[A-Za-z_][0-9A-Za-z_]+\s*\("
32+
33+
# Python Specific
34+
color #9099A1 "\<(def|class|import|from|as|with|in|is|not|and|or|True|False|None|try|except|finally|raise|assert|lambda|yield|global|nonlocal)\>"
35+
color #E6E7A3 "\<(__init__|__main__|__name__|__file__|__doc__|__dict__|__module__|__bases__|__class__)\>"
36+
color #46474F "#.*"
37+
color #F9B98C start="'''[^']*" end="'''"
38+
color #F9B98C start="\"\"\"[^\"]*" end="\"\"\""
39+
color #9592A4 "@[A-Za-z_][0-9A-Za-z_]*"
40+
41+
# Ruby Specific
42+
color #9099A1 "\<(begin|end|def|class|module|rescue|ensure|when|unless|until|while|for|break|next|redo|retry|in|do|yield|self|super|return|alias|undef|BEGIN|END|__FILE__|__LINE__|private|protected|public|require|include|extend|attr_reader|attr_writer|attr_accessor)\>"
43+
color #E6E7A3 "\<[A-Z][A-Za-z0-9_]*\>"
44+
color #46474F "#.*"
45+
color #9592A4 "@{1,2}[A-Za-z_][0-9A-Za-z_]*"
46+
color #9592A4 ":[A-Za-z_][0-9A-Za-z_]*"
47+
color #F9B98C start="=begin" end="=end"
48+
49+
# JavaScript/TypeScript Common
50+
color #9099A1 "\<(const|let|var|function|class|extends|implements|constructor|super|this|static|public|private|protected|readonly|interface|type|enum|namespace|module|export|import|default|as|from|async|await|of|new|delete|instanceof|typeof|void)\>"
51+
color #E6E7A3 "\<(Array|Boolean|Date|Error|Function|Math|Number|Object|RegExp|String|Promise|Map|Set|Symbol|any|never|unknown|null|undefined)\>"
52+
color #9592A4 "\$[A-Za-z_][0-9A-Za-z_]*"
53+
color #F9B98C start="`" end="`"
54+
color #9592A4 "\${.*?}"
55+
56+
# TypeScript Specific
57+
color #9099A1 "\<(declare|abstract|implements|type|interface|keyof|typeof|infer|is|as|satisfies)\>"
58+
color #E6E7A3 ":[[:space:]]*[A-Za-z_][0-9A-Za-z_<>]*"
59+
color #9592A4 "<[^>]*>"
60+
61+
# Keywords
62+
color #9099A1 "\<(class|namespace|interface|struct|enum|union|typedef|extends|implements|instanceof|new|delete|throw|throws|try|catch|finally|public|private|protected|internal|static|final|const|abstract|override|virtual|sealed|readonly|partial|ref|out|params|volatile|unsafe|fixed|readonly|stackalloc|operator|event|delegate|explicit|implicit|get|set|add|remove|value|async|await|yield|from|where|select|group|into|orderby|join|let|in|on|equals|by|ascending|descending|return|break|continue|goto|if|else|switch|case|default|while|do|for|foreach|lock|using|checked|unchecked|is|as|sizeof|typeof|null|true|false|void|bool|byte|char|decimal|double|float|int|long|object|sbyte|short|string|uint|ulong|ushort|var)\>"
63+
64+
# Types
65+
color #E6E7A3 "\<(bool|byte|char|decimal|double|float|int|long|object|sbyte|short|string|uint|ulong|ushort|void)\>"
66+
67+
# Strings
68+
color #F9B98C ""([^"]|\\")*""
69+
color #F9B98C "'([^']|\\')*'"
70+
71+
# Comments
72+
color #46474F "//.*"
73+
color #46474F start="/\*" end="\*/"
74+
75+
# Special
76+
color #9592A4 "[.,;:{}()<>!=&|+\-/*%^]"
77+
color #9592A4 "\["
78+
color #9592A4 "\]"
79+
80+
# Numbers
81+
color #F9B98C "\<([0-9]+)\>"
82+
83+
# Function calls
84+
color #E6E7A3 "\<[A-Za-z_][0-9A-Za-z_]+\s*\("

nano/oscura.nanorc

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
## Oscura theme for nano
2+
## Author: Vinit Kumar
3+
## License: MIT
4+
5+
# Basic Colors
6+
set titlecolor #E6E6E6,#0B0B0F
7+
set statuscolor #E6E6E6,#0B0B0F
8+
set errorcolor #FF5C5C,#0B0B0F
9+
set selectedcolor #E6E6E6,#5A5B63
10+
set stripecolor #232323
11+
set numbercolor #46474F
12+
set keycolor #9099A1
13+
set functioncolor #E6E7A3
14+
15+
# Common Syntax Colors
16+
set functioncolor #E6E7A3
17+
set numbercolor #F9B98C
18+
set stringcolor #F9B98C
19+
set commentcolor #46474F
20+
set specialcolor #9592A4
21+
set keywordcolor #9099A1
22+
set constantcolor #F9B98C
23+
24+
# General Programming Syntax
25+
color #9099A1 "\<(if|else|for|while|do|return|break|continue|switch|case|default|try|catch|finally|throw|throws)\>"
26+
color #F9B98C ""([^"]|\\")*"|'([^']|\\')*'"
27+
color #46474F "(^|[[:space:]])//.*"
28+
color #46474F start="/\*" end="\*/"
29+
color #F9B98C "\<([0-9]+)\>"
30+
color #9592A4 "[.,;:{}()<>!=&|+\-/*%^]"
31+
color #E6E7A3 "\<[A-Za-z_][0-9A-Za-z_]+\s*\("
32+
33+
# Python Specific
34+
color #9099A1 "\<(def|class|import|from|as|with|in|is|not|and|or|True|False|None|try|except|finally|raise|assert|lambda|yield|global|nonlocal)\>"
35+
color #E6E7A3 "\<(__init__|__main__|__name__|__file__|__doc__|__dict__|__module__|__bases__|__class__)\>"
36+
color #46474F "#.*"
37+
color #F9B98C start="'''[^']*" end="'''"
38+
color #F9B98C start="\"\"\"[^\"]*" end="\"\"\""
39+
color #9592A4 "@[A-Za-z_][0-9A-Za-z_]*"
40+
41+
# Ruby Specific
42+
color #9099A1 "\<(begin|end|def|class|module|rescue|ensure|when|unless|until|while|for|break|next|redo|retry|in|do|yield|self|super|return|alias|undef|BEGIN|END|__FILE__|__LINE__|private|protected|public|require|include|extend|attr_reader|attr_writer|attr_accessor)\>"
43+
color #E6E7A3 "\<[A-Z][A-Za-z0-9_]*\>"
44+
color #46474F "#.*"
45+
color #9592A4 "@{1,2}[A-Za-z_][0-9A-Za-z_]*"
46+
color #9592A4 ":[A-Za-z_][0-9A-Za-z_]*"
47+
color #F9B98C start="=begin" end="=end"
48+
49+
# JavaScript/TypeScript Common
50+
color #9099A1 "\<(const|let|var|function|class|extends|implements|constructor|super|this|static|public|private|protected|readonly|interface|type|enum|namespace|module|export|import|default|as|from|async|await|of|new|delete|instanceof|typeof|void)\>"
51+
color #E6E7A3 "\<(Array|Boolean|Date|Error|Function|Math|Number|Object|RegExp|String|Promise|Map|Set|Symbol|any|never|unknown|null|undefined)\>"
52+
color #9592A4 "\$[A-Za-z_][0-9A-Za-z_]*"
53+
color #F9B98C start="`" end="`"
54+
color #9592A4 "\${.*?}"
55+
56+
# TypeScript Specific
57+
color #9099A1 "\<(declare|abstract|implements|type|interface|keyof|typeof|infer|is|as|satisfies)\>"
58+
color #E6E7A3 ":[[:space:]]*[A-Za-z_][0-9A-Za-z_<>]*"
59+
color #9592A4 "<[^>]*>"

nano/syntax/javascript.nanorc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
syntax "javascript" "\.js$"
2+
3+
# Keywords
4+
color yellow "\<(const|let|var|function|class|extends|implements|constructor|super|this|static|public|private|protected|readonly|export|import|default|as|from|async|await|of|new|delete|instanceof|typeof|void)\>"
5+
6+
# Built-in Types
7+
color green "\<(Array|Boolean|Date|Error|Function|Math|Number|Object|RegExp|String|Promise|Map|Set|Symbol|null|undefined)\>"
8+
9+
# Template Strings
10+
color yellow start="`" end="`"
11+
color cyan "\${.*?}"
12+
13+
# Comments
14+
color brightblue "(^|[[:space:]])//.*"
15+
color brightblue start="/\*" end="\*/"

nano/syntax/python.nanorc

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
syntax "python" "\.py$" "\.pyw$"
2+
3+
# Keywords
4+
color yellow "\<(def|class|import|from|as|with|in|is|not|and|or|True|False|None|try|except|finally|raise|assert|lambda|yield|global|nonlocal)\>"
5+
color green "\<(__init__|__main__|__name__|__file__|__doc__|__dict__|__module__|__bases__|__class__)\>"
6+
7+
# Comments
8+
color brightblue "#.*"
9+
color yellow start="'''[^']*" end="'''"
10+
color yellow start="\"\"\"[^\"]*" end="\"\"\""
11+
12+
# Decorators
13+
color cyan "@[A-Za-z_][0-9A-Za-z_]*"
14+
15+
# Strings and Numbers
16+
color yellow ""([^"]|\\")*"|'([^']|\\')*'"
17+
color yellow "\<([0-9]+)\>"
18+
19+
# Function calls
20+
color green "\<[A-Za-z_][0-9A-Za-z_]+\s*\("

nano/syntax/ruby.nanorc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
syntax "ruby" "\.rb$" "Gemfile" "Rakefile"
2+
3+
# Keywords
4+
color yellow "\<(begin|end|def|class|module|rescue|ensure|when|unless|until|while|for|break|next|redo|retry|in|do|yield|self|super|return|alias|undef|BEGIN|END|__FILE__|__LINE__|private|protected|public|require|include|extend|attr_reader|attr_writer|attr_accessor)\>"
5+
6+
# Constants and Symbols
7+
color green "\<[A-Z][A-Za-z0-9_]*\>"
8+
color cyan ":[A-Za-z_][0-9A-Za-z_]*"
9+
10+
# Instance/Class Variables
11+
color cyan "@{1,2}[A-Za-z_][0-9A-Za-z_]*"
12+
13+
# Comments
14+
color brightblue "#.*"
15+
color yellow start="=begin" end="=end"

nano/syntax/typescript.nanorc

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
syntax "typescript" "\.ts$" "\.tsx$"
2+
3+
# TypeScript Keywords
4+
color yellow "\<(const|let|var|function|class|extends|implements|constructor|super|this|static|public|private|protected|readonly|interface|type|enum|namespace|module|export|import|default|as|from|async|await|of|new|delete|instanceof|typeof|void|declare|abstract|keyof|infer|is|satisfies)\>"
5+
6+
# Types and Built-ins
7+
color green "\<(string|number|boolean|any|never|unknown|null|undefined|object|Array|Promise|Map|Set|Symbol|Date|RegExp|Error|BigInt)\>"
8+
color green "\<[A-Z][A-Za-z0-9_]*\>"
9+
10+
# Type Annotations and Generics
11+
color cyan ":[[:space:]]*[A-Za-z_][0-9A-Za-z_]*"
12+
color cyan "<[^>]*>"
13+
color cyan "\<[A-Z][A-Za-z0-9_]*<.*>"
14+
15+
# Decorators
16+
color magenta "@[A-Za-z_][0-9A-Za-z_]*"
17+
18+
# Strings and Template Literals
19+
color yellow ""([^"]|\\")*"|'([^']|\\')*'"
20+
color yellow start="`" end="`"
21+
color cyan "\$\{[^}]*\}"
22+
23+
# Numbers
24+
color red "\<[0-9]+\>"
25+
26+
# Comments
27+
color brightblue "//.*"
28+
color brightblue start="/\*" end="\*/"
29+
30+
# Special Characters
31+
color magenta "[.,;:]"
32+
color magenta "[<>()]"
33+
color magenta "[!&|=+\-*/%^]"
34+
35+
# Function Calls
36+
color green "\<[A-Za-z_][0-9A-Za-z_]+\s*\("
37+
38+
# JSX/TSX Specific
39+
color cyan "</?[A-Za-z_][A-Za-z0-9_]*"
40+
color cyan ">"
41+
color yellow "\<(true|false)\>"

0 commit comments

Comments
 (0)