mirror of
https://github.com/joshdick/onedark.vim.git
synced 2025-11-16 06:53:47 -05:00
Add alacritty support (#132)
This commit is contained in:
@@ -116,7 +116,7 @@ try {
|
||||
const xresources = readFileSync(resolve(__dirname, '../term/One Dark.Xresources'), 'utf8')
|
||||
const terminalPalette = termcolors.xresources.import(xresources)
|
||||
|
||||
let itermTemplate, terminalAppTemplate
|
||||
let itermTemplate, terminalAppTemplate, alacrittyTemplate
|
||||
|
||||
// Compile custom terminal color templates based on ones that ship with termcolors
|
||||
try {
|
||||
@@ -128,6 +128,13 @@ try {
|
||||
})
|
||||
)
|
||||
|
||||
alacrittyTemplate = termcolors.export(
|
||||
readFileSync(resolve(__dirname, 'templates/One Dark.alacritty')),
|
||||
_.partialRight(_.mapValues, function (color) {
|
||||
return color.toHex().slice(1)
|
||||
})
|
||||
)
|
||||
|
||||
// From termcolors/lib/formats/terminal-app.js
|
||||
const code = [
|
||||
new Buffer('62706c6973743030d40102030405061516582476657273696f6e58246f626a65637473592461726368697665725424746f7012000186a0a307080f55246e756c6cd3090a0b0c0d0e554e535247425c4e53436f6c6f7253706163655624636c6173734f1027', 'hex'),
|
||||
@@ -155,6 +162,7 @@ try {
|
||||
try {
|
||||
writeFileSync(resolve(__dirname, '../term/One Dark.itermcolors'), itermTemplate(terminalPalette))
|
||||
writeFileSync(resolve(__dirname, '../term/One Dark.terminal'), terminalAppTemplate(terminalPalette))
|
||||
writeFileSync(resolve(__dirname, '../term/One Dark.alacritty'), alacrittyTemplate(terminalPalette))
|
||||
} catch (e) {
|
||||
handleError('Error writing terminal color file', e)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user