diff --git a/index.ts b/index.ts index 07c6202..4454cc1 100644 --- a/index.ts +++ b/index.ts @@ -6,6 +6,7 @@ import previewSnippet from './src/preview/cli-snippet' import buildTOML from './src/build/toml' import buildYAML from './src/build/yaml' import buildKitty from './ports/kitty/src/build' +import buildNeovim from './ports/neovim/src/build' const program = new Command(); @@ -46,6 +47,7 @@ program if (options.verbose) console.info('Building Ports...') log(options.verbose, await buildKitty(), timer) + log(options.verbose, await buildNeovim(), timer) }); program.parse(); diff --git a/ports/neovim/README.md b/ports/neovim/README.md new file mode 100644 index 0000000..bb73c02 --- /dev/null +++ b/ports/neovim/README.md @@ -0,0 +1 @@ +https://neovim.io/doc/user/syntax.html diff --git a/ports/neovim/colors/verdigris.vim b/ports/neovim/colors/verdigris.vim new file mode 100644 index 0000000..4bae984 --- /dev/null +++ b/ports/neovim/colors/verdigris.vim @@ -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 + + + diff --git a/ports/neovim/estilo.yml b/ports/neovim/estilo.yml new file mode 100644 index 0000000..eeb61b1 --- /dev/null +++ b/ports/neovim/estilo.yml @@ -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' diff --git a/ports/neovim/estilos/palettes/verdigris.yml b/ports/neovim/estilos/palettes/verdigris.yml new file mode 100644 index 0000000..19cdfd9 --- /dev/null +++ b/ports/neovim/estilos/palettes/verdigris.yml @@ -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" diff --git a/ports/neovim/estilos/syntax/base.yml b/ports/neovim/estilos/syntax/base.yml new file mode 100644 index 0000000..44e49c1 --- /dev/null +++ b/ports/neovim/estilos/syntax/base.yml @@ -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' diff --git a/ports/neovim/estilos/terminal.yml b/ports/neovim/estilos/terminal.yml new file mode 100644 index 0000000..efd3201 --- /dev/null +++ b/ports/neovim/estilos/terminal.yml @@ -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: '' diff --git a/ports/neovim/index.ts b/ports/neovim/index.ts new file mode 100644 index 0000000..3c4e6ae --- /dev/null +++ b/ports/neovim/index.ts @@ -0,0 +1,3 @@ +import buildNeovim from './src/build' + +await buildNeovim() diff --git a/ports/neovim/src/build.ts b/ports/neovim/src/build.ts new file mode 100644 index 0000000..dec1048 --- /dev/null +++ b/ports/neovim/src/build.ts @@ -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) +}