neovim port
This commit is contained in:
parent
b49c2f4e84
commit
a66364abb6
9 changed files with 217 additions and 0 deletions
2
index.ts
2
index.ts
|
@ -6,6 +6,7 @@ import previewSnippet from './src/preview/cli-snippet'
|
||||||
import buildTOML from './src/build/toml'
|
import buildTOML from './src/build/toml'
|
||||||
import buildYAML from './src/build/yaml'
|
import buildYAML from './src/build/yaml'
|
||||||
import buildKitty from './ports/kitty/src/build'
|
import buildKitty from './ports/kitty/src/build'
|
||||||
|
import buildNeovim from './ports/neovim/src/build'
|
||||||
|
|
||||||
const program = new Command();
|
const program = new Command();
|
||||||
|
|
||||||
|
@ -46,6 +47,7 @@ program
|
||||||
|
|
||||||
if (options.verbose) console.info('Building Ports...')
|
if (options.verbose) console.info('Building Ports...')
|
||||||
log(options.verbose, await buildKitty(), timer)
|
log(options.verbose, await buildKitty(), timer)
|
||||||
|
log(options.verbose, await buildNeovim(), timer)
|
||||||
});
|
});
|
||||||
|
|
||||||
program.parse();
|
program.parse();
|
||||||
|
|
1
ports/neovim/README.md
Normal file
1
ports/neovim/README.md
Normal file
|
@ -0,0 +1 @@
|
||||||
|
https://neovim.io/doc/user/syntax.html
|
52
ports/neovim/colors/verdigris.vim
Normal file
52
ports/neovim/colors/verdigris.vim
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
""
|
||||||
|
" verdigris v0.0.1
|
||||||
|
"
|
||||||
|
|
||||||
|
" URL: https://git.basking.monster/gaiety/verdigris/ports/neovim
|
||||||
|
" Author: Gaiety
|
||||||
|
" License: GPL-3.0-only
|
||||||
|
""
|
||||||
|
|
||||||
|
set background=dark
|
||||||
|
hi clear
|
||||||
|
|
||||||
|
if exists("syntax_on")
|
||||||
|
syntax reset
|
||||||
|
endif
|
||||||
|
let g:colors_name="verdigris"
|
||||||
|
|
||||||
|
|
||||||
|
let Italic = ""
|
||||||
|
if exists('g:verdigris_italic')
|
||||||
|
let Italic = "italic"
|
||||||
|
endif
|
||||||
|
let g:verdigris_italic = get(g:, 'verdigris_italic', 0)
|
||||||
|
|
||||||
|
let Bold = ""
|
||||||
|
if exists('g:verdigris_bold')
|
||||||
|
let Bold = "bold"
|
||||||
|
endif
|
||||||
|
let g:verdigris_bold = get(g:, 'verdigris_bold', 0)
|
||||||
|
|
||||||
|
hi Conceal guifg=#4E6872 ctermfg=242 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
|
||||||
|
hi DiffAdd guifg=#98CCAC ctermfg=115 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
|
||||||
|
hi DiffChange guifg=#E1B392 ctermfg=180 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
|
||||||
|
hi DiffDelete guifg=#E8ADA9 ctermfg=181 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
|
||||||
|
hi ErrorMsg guifg=#E8ADA9 ctermfg=181 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
|
||||||
|
hi SpellBad guifg=#E8ADA9 ctermfg=181 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
|
||||||
|
hi WarningMsg guifg=#E1B392 ctermfg=180 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
|
||||||
|
hi Comment guifg=#19323B ctermfg=236 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
|
||||||
|
hi Constant guifg=#FF9F6F ctermfg=215 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
|
||||||
|
hi String guifg=#23DBC1 ctermfg=43 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
|
||||||
|
hi Identifier guifg=#8CC8E0 ctermfg=116 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
|
||||||
|
hi Statement guifg=#C6E4F0 ctermfg=254 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
|
||||||
|
hi Exception guifg=#E8ADA9 ctermfg=181 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
|
||||||
|
hi PreProc guifg=#4E6872 ctermfg=242 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
|
||||||
|
hi Type guifg=#E1B392 ctermfg=180 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
|
||||||
|
hi Special guifg=#E1B392 ctermfg=180 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
|
||||||
|
hi Ignore guifg=#4E6872 ctermfg=242 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
|
||||||
|
hi Error guifg=#E8ADA9 ctermfg=181 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
|
||||||
|
hi Todo guifg=#8CC8E0 ctermfg=116 guibg=NONE ctermbg=NONE gui=NONE cterm=NONE
|
||||||
|
|
||||||
|
|
||||||
|
|
10
ports/neovim/estilo.yml
Normal file
10
ports/neovim/estilo.yml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
name: 'verdigris'
|
||||||
|
version: '0.0.1'
|
||||||
|
license: 'GPL-3.0-only'
|
||||||
|
author: 'Gaiety'
|
||||||
|
url: 'https://git.basking.monster/gaiety/verdigris/ports/neovim'
|
||||||
|
description: 'undefined'
|
||||||
|
colorschemes:
|
||||||
|
- name: 'verdigris'
|
||||||
|
background: 'dark'
|
||||||
|
palette: 'verdigris'
|
11
ports/neovim/estilos/palettes/verdigris.yml
Normal file
11
ports/neovim/estilos/palettes/verdigris.yml
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
pit: "#00040B"
|
||||||
|
depths: "#19323B"
|
||||||
|
stope: "#4E6872"
|
||||||
|
text: "#C6E4F0"
|
||||||
|
orange: "#FF9F6F"
|
||||||
|
teal: "#23DBC1"
|
||||||
|
red: "#E8ADA9"
|
||||||
|
yellow: "#E1B392"
|
||||||
|
green: "#98CCAC"
|
||||||
|
blue: "#8CC8E0"
|
||||||
|
purple: "#BEB6E8"
|
82
ports/neovim/estilos/syntax/base.yml
Normal file
82
ports/neovim/estilos/syntax/base.yml
Normal file
|
@ -0,0 +1,82 @@
|
||||||
|
# BASE UI
|
||||||
|
ColorColumn: ''
|
||||||
|
Conceal: 'stope'
|
||||||
|
Cursor: ''
|
||||||
|
CursorIM: ''
|
||||||
|
CursorColumn: ''
|
||||||
|
CursorLine: ''
|
||||||
|
CursorLineNr: ''
|
||||||
|
Directory: ''
|
||||||
|
DiffAdd: 'green'
|
||||||
|
DiffChange: 'yellow'
|
||||||
|
DiffDelete: 'red'
|
||||||
|
DiffText: ''
|
||||||
|
ErrorMsg: 'red'
|
||||||
|
VertSplit: ''
|
||||||
|
Folded: ''
|
||||||
|
FoldColumn: ''
|
||||||
|
SignColumn: ''
|
||||||
|
IncSearch: ''
|
||||||
|
LineNr: ''
|
||||||
|
MatchParen: ''
|
||||||
|
ModeMsg: ''
|
||||||
|
MoreMsg: ''
|
||||||
|
NonText: ''
|
||||||
|
Normal: ''
|
||||||
|
PMenu: ''
|
||||||
|
PMenuSel: ''
|
||||||
|
PmenuSbar: ''
|
||||||
|
PmenuThumb: ''
|
||||||
|
Question: ''
|
||||||
|
Search: ''
|
||||||
|
SpecialKey: ''
|
||||||
|
SpellBad: 'red'
|
||||||
|
SpellLocal: ''
|
||||||
|
SpellCap: ''
|
||||||
|
SpellRare: ''
|
||||||
|
StatusLine: ''
|
||||||
|
StatusLineNC: ''
|
||||||
|
TabLine: ''
|
||||||
|
TabLineFill: ''
|
||||||
|
TabLineSel: ''
|
||||||
|
Title: ''
|
||||||
|
Visual: ''
|
||||||
|
VisualNOS: ''
|
||||||
|
WarningMsg: 'yellow'
|
||||||
|
WildMenu: ''
|
||||||
|
# BASE SYNTAX
|
||||||
|
Comment: 'depths'
|
||||||
|
Constant: 'orange'
|
||||||
|
String: 'teal' # Constant
|
||||||
|
Character: '' # Constant
|
||||||
|
Boolean: '' # Constant
|
||||||
|
Number: '' # Constant
|
||||||
|
Float: '' # Constant
|
||||||
|
Identifier: 'blue'
|
||||||
|
Function: '' # Identifier
|
||||||
|
Statement: 'text'
|
||||||
|
Conditional: '' # Statement
|
||||||
|
Repeat: '' # Statement
|
||||||
|
Label: '' # Statement
|
||||||
|
Operator: '' # Statement
|
||||||
|
Keyword: '' # Statement
|
||||||
|
Exception: 'red' # Statement
|
||||||
|
PreProc: 'stope'
|
||||||
|
Include: '' # PreProc
|
||||||
|
Define: '' # PreProc
|
||||||
|
Macro: '' # PreProc
|
||||||
|
PreCondit: '' # PreProc
|
||||||
|
Type: 'yellow'
|
||||||
|
StorageClass: '' # Type
|
||||||
|
Structure: '' # Type
|
||||||
|
Typedef: '' # Type
|
||||||
|
Special: 'yellow'
|
||||||
|
SpecialChar: '' # Special
|
||||||
|
Tag: '' # Special
|
||||||
|
Delimiter: '' # Special
|
||||||
|
SpecialComment: '' # Special
|
||||||
|
Debug: '' # Special
|
||||||
|
Underlined: ''
|
||||||
|
Ignore: 'stope'
|
||||||
|
Error: 'red'
|
||||||
|
Todo: 'blue'
|
18
ports/neovim/estilos/terminal.yml
Normal file
18
ports/neovim/estilos/terminal.yml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
color_foreground: ''
|
||||||
|
color_background: ''
|
||||||
|
color_0: ''
|
||||||
|
color_1: ''
|
||||||
|
color_2: ''
|
||||||
|
color_3: ''
|
||||||
|
color_4: ''
|
||||||
|
color_5: ''
|
||||||
|
color_6: ''
|
||||||
|
color_7: ''
|
||||||
|
color_8: ''
|
||||||
|
color_9: ''
|
||||||
|
color_10: ''
|
||||||
|
color_11: ''
|
||||||
|
color_12: ''
|
||||||
|
color_13: ''
|
||||||
|
color_14: ''
|
||||||
|
color_15: ''
|
3
ports/neovim/index.ts
Normal file
3
ports/neovim/index.ts
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
import buildNeovim from './src/build'
|
||||||
|
|
||||||
|
await buildNeovim()
|
38
ports/neovim/src/build.ts
Normal file
38
ports/neovim/src/build.ts
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
import appRoot from 'app-root-path'
|
||||||
|
import { rmFile, mkFilePath, appendToFile } from "../../../src/helpers/file"
|
||||||
|
import { common } from '../../../dist/palette.yml'
|
||||||
|
import { spawn } from 'bun'
|
||||||
|
|
||||||
|
const file = appRoot + '/ports/neovim/estilos/palettes/verdigris.yml'
|
||||||
|
const appendToEstilosPalette = async (content: string) => await appendToFile(file, content)
|
||||||
|
|
||||||
|
export default async function(isVerbose = false) {
|
||||||
|
if (isVerbose) console.info('Neovim: Removing previous build', file)
|
||||||
|
try {
|
||||||
|
await rmFile(file)
|
||||||
|
} catch (error) {
|
||||||
|
console.info('Neovim: Previous build already removed')
|
||||||
|
}
|
||||||
|
if (isVerbose) console.info('Neovim: Ensuring path and file exist', file)
|
||||||
|
await mkFilePath(file)
|
||||||
|
if (isVerbose) console.info('Neovim: Writing color palette into file', file)
|
||||||
|
await appendToEstilosPalette(colors())
|
||||||
|
if (isVerbose) console.info('Neovim: Running estilo to compile `.vim`', file)
|
||||||
|
await runEstilo(isVerbose)
|
||||||
|
|
||||||
|
return appRoot + '/ports/neovim/colors/verdigris.vim'
|
||||||
|
}
|
||||||
|
|
||||||
|
function colors(): string {
|
||||||
|
return Object
|
||||||
|
.keys(common)
|
||||||
|
.reduce((acc, key) => acc += `${key}: "${common[key]}"\n`, '')
|
||||||
|
}
|
||||||
|
|
||||||
|
async function runEstilo(isVerbose: boolean) {
|
||||||
|
const proc = spawn(['bun', 'estilo', 'render', appRoot + '/ports/neovim/'], {
|
||||||
|
cwd: appRoot.toString(),
|
||||||
|
});
|
||||||
|
const output = await proc.stdout.text();
|
||||||
|
if (isVerbose) console.info(output)
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue