From 2c5704a510568da2c3c4c8b329ffaabacee13a78 Mon Sep 17 00:00:00 2001 From: Rishit Date: Sun, 11 Feb 2024 00:31:25 +0530 Subject: [PATCH 1/9] feat: user config --- lua/embark/init.lua | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/lua/embark/init.lua b/lua/embark/init.lua index bcaae93..519cffb 100644 --- a/lua/embark/init.lua +++ b/lua/embark/init.lua @@ -3,6 +3,25 @@ local none = 'NONE' local M = {} +--- @class StyleProps +--- @field bold boolean +--- @field italic boolean +local style_props = { + bold = true, + italic = true, +} + +--- @class EmbarkConf +--- @field style table + M.config = { + styles = { + --- @type StyleProps + keywords = { bold = true, italic = true }, + --- @type StyleProps + comments = { bold = false, italic = true }, + } +} + local colors = { bg = '#1e1c31', bg_dark = '#100e23', @@ -49,7 +68,8 @@ M.colorscheme = function() highlight(0, 'ModeMsg', { fg = colors.norm_subtle }) -- Comments - highlight(0, 'Comment', { fg = colors.norm_subtle }) + highlight(0, 'Comment', + { fg = colors.norm_subtle, bold = M.config.styles.comments.bold, italic = M.config.styles.comments.italic }) -- Functions highlight(0, 'Function', { fg = colors.red }) @@ -294,7 +314,8 @@ M.colorscheme = function() highlight(0, '@lsp.type.operator', { link = '@operator' }) highlight(0, '@lsp.type.parameter', { link = '@parameter' }) highlight(0, '@lsp.type.property', { link = '@property' }) - highlight(0, '@lsp.type.selfKeyword', { link = '@variable.builtin' }) + highlight(0, '@lsp.type.selfKeyword', + { link = '@variable.builtin', bold = M.config.styles.keywords.bold, italic = M.config.styles.keywords.italic, }) highlight(0, '@lsp.type.selfParameter', { link = '@variable.builtin' }) highlight(0, '@lsp.type.string', { link = '@string' }) highlight(0, '@lsp.type.struct', { link = '@type' }) From 6a7770a615bad4eb62c3c6a1c959ee8813161d6c Mon Sep 17 00:00:00 2001 From: Rishit Date: Sat, 17 Feb 2024 13:33:46 +0530 Subject: [PATCH 2/9] feat: use user config --- lua/embark/init.lua | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/lua/embark/init.lua b/lua/embark/init.lua index 519cffb..8bc6cf1 100644 --- a/lua/embark/init.lua +++ b/lua/embark/init.lua @@ -12,8 +12,8 @@ local style_props = { } --- @class EmbarkConf ---- @field style table - M.config = { +--- @field styles table +M.config = { styles = { --- @type StyleProps keywords = { bold = true, italic = true }, @@ -22,6 +22,24 @@ local style_props = { } } +--- @param config EmbarkConf? +function M.setup(config) + if config ~= nil then + M.config = { + styles = { + keywords = { + italic = config.styles.keywords.italic or M.config.styles.keywords.italic, + bold = config.styles.keywords.bold or M.config.styles.keywords.bold, + }, + comments = { + italic = config.styles.comments.italic or M.config.styles.comments.italic, + bold = config.styles.comments.bold or M.config.styles.comments.bold, + } + } + } + end +end + local colors = { bg = '#1e1c31', bg_dark = '#100e23', From 7dbb8894e0c8ada9316cae670557008fd042bc90 Mon Sep 17 00:00:00 2001 From: Rishit Date: Sat, 17 Feb 2024 13:34:49 +0530 Subject: [PATCH 3/9] fix: format --- lua/embark/init.lua | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lua/embark/init.lua b/lua/embark/init.lua index 8bc6cf1..a3e1366 100644 --- a/lua/embark/init.lua +++ b/lua/embark/init.lua @@ -19,7 +19,7 @@ M.config = { keywords = { bold = true, italic = true }, --- @type StyleProps comments = { bold = false, italic = true }, - } + }, } --- @param config EmbarkConf? @@ -34,8 +34,8 @@ function M.setup(config) comments = { italic = config.styles.comments.italic or M.config.styles.comments.italic, bold = config.styles.comments.bold or M.config.styles.comments.bold, - } - } + }, + }, } end end @@ -86,8 +86,7 @@ M.colorscheme = function() highlight(0, 'ModeMsg', { fg = colors.norm_subtle }) -- Comments - highlight(0, 'Comment', - { fg = colors.norm_subtle, bold = M.config.styles.comments.bold, italic = M.config.styles.comments.italic }) + highlight(0, 'Comment', { fg = colors.norm_subtle, bold = M.config.styles.comments.bold, italic = M.config.styles.comments.italic }) -- Functions highlight(0, 'Function', { fg = colors.red }) @@ -332,8 +331,7 @@ M.colorscheme = function() highlight(0, '@lsp.type.operator', { link = '@operator' }) highlight(0, '@lsp.type.parameter', { link = '@parameter' }) highlight(0, '@lsp.type.property', { link = '@property' }) - highlight(0, '@lsp.type.selfKeyword', - { link = '@variable.builtin', bold = M.config.styles.keywords.bold, italic = M.config.styles.keywords.italic, }) + highlight(0, '@lsp.type.selfKeyword', { link = '@variable.builtin', bold = M.config.styles.keywords.bold, italic = M.config.styles.keywords.italic }) highlight(0, '@lsp.type.selfParameter', { link = '@variable.builtin' }) highlight(0, '@lsp.type.string', { link = '@string' }) highlight(0, '@lsp.type.struct', { link = '@type' }) From d6574b124c173955cf403cc0beb6c0f3b2fd2498 Mon Sep 17 00:00:00 2001 From: Rishit Date: Sat, 17 Feb 2024 13:38:52 +0530 Subject: [PATCH 4/9] fix: ignore unused variable --- lua/embark/init.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/embark/init.lua b/lua/embark/init.lua index a3e1366..6e3a1a0 100644 --- a/lua/embark/init.lua +++ b/lua/embark/init.lua @@ -6,6 +6,7 @@ local M = {} --- @class StyleProps --- @field bold boolean --- @field italic boolean +-- stylua: ignore local style_props = { bold = true, italic = true, From 53777cc14deed016af83ff3c36ea65673b2a23fb Mon Sep 17 00:00:00 2001 From: Rishit Date: Sat, 17 Feb 2024 13:43:24 +0530 Subject: [PATCH 5/9] fix: stylua ignore --- .github/.DS_Store | Bin 6148 -> 0 bytes lua/embark/init.lua | 3 ++- 2 files changed, 2 insertions(+), 1 deletion(-) delete mode 100644 .github/.DS_Store diff --git a/.github/.DS_Store b/.github/.DS_Store deleted file mode 100644 index fbeb2c1146b85d4b90e103289c4e2f068597b2e6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKO>fgc5S>j^ny5m`0i+%+ajlY2MWBj{Ny7mNallXxfPzg-Yt{8e{-}kbNIt_K z;+ODu;LYv?QN_I?M0cdwH#;Be-M5z4OGIi~EgljLh^Pl;?DWyJ2*+8sq$8ePpfY28 zrj#_*R6I|&vYq2!WPtasj~&yL(*^ypfBI9D>IhMOHJ(C;KaId@t%&MkDHY$NWttS_ zc>F_kcDlQF_8|LvAA)mT2W41R#Wc*{aqqR(X|%D!=roDz`QYA(&dM;!;@lJ@ix?^I z-zM2Y*Hc|(i^9|fHqeL62M4RwWHLVVCXXlULvM9_#P;#gdfo5ce=vITYJQPkX8Nm{ zJ1M-YM(zr3;2VqWvm@a8Vr{FE63U&-9+CyoKf zz%6D#z6HJgTg-u5x?{jG(9QsVA3P|dFW6W#pAIzU3IOcFZ3H&|FmjD2=nFO$5rHUM z3bdt4t{BRe!|zF+FW6YL<)q~Dq2$R*ZYat;9pif@os@6UwT=PDz;y<8YZM&S3@0Q!QB SMR*|YN5IhF8ppt2W#AVQtAZZ@ diff --git a/lua/embark/init.lua b/lua/embark/init.lua index 6e3a1a0..c36d8c2 100644 --- a/lua/embark/init.lua +++ b/lua/embark/init.lua @@ -3,14 +3,15 @@ local none = 'NONE' local M = {} +-- stylua: ignore start --- @class StyleProps --- @field bold boolean --- @field italic boolean --- stylua: ignore local style_props = { bold = true, italic = true, } +-- stylua: ignore end --- @class EmbarkConf --- @field styles table From 2e08490158942557287f389df98599bbbf090162 Mon Sep 17 00:00:00 2001 From: Rishit Date: Sat, 17 Feb 2024 13:51:25 +0530 Subject: [PATCH 6/9] fix: format again --- .luacheckrc | 5 +++-- lua/embark/init.lua | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index c7cbc3f..7ee0e6e 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -1,9 +1,10 @@ std = luajit ignore = { - "631", -- Line is too long. + "631", -- Line is too long. + "211", -- Ignore unused variables. } globals = { - "vim", + "vim", } diff --git a/lua/embark/init.lua b/lua/embark/init.lua index c36d8c2..524b0b1 100644 --- a/lua/embark/init.lua +++ b/lua/embark/init.lua @@ -7,10 +7,10 @@ local M = {} --- @class StyleProps --- @field bold boolean --- @field italic boolean -local style_props = { - bold = true, - italic = true, -} +-- local style_props = { +-- bold = true, +-- italic = true, +-- } -- stylua: ignore end --- @class EmbarkConf From ecf7495131ebdcb5c998e339e434fc1e0f95c5b8 Mon Sep 17 00:00:00 2001 From: Rishit Date: Sat, 17 Feb 2024 13:54:49 +0530 Subject: [PATCH 7/9] fix: update readme --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 051c560..877df1e 100644 --- a/README.md +++ b/README.md @@ -89,11 +89,25 @@ require('lualine').setup { theme = 'embark', } } + +### User configuration + +```lua + config = function() + require("embark").setup({ + styles = { + keywords = { italic = true, bold = true }, -- default + comments = { italic = true, bold = false }, -- default + }, + }) + end + +``` ``` ### Todo -- [ ] user configuration. +- [x] user configuration. - [ ] support for other nvim plugins. - [ ] light variant. From b7f49501ef3bcf134bcc57595a12cfd6a2d1c9cd Mon Sep 17 00:00:00 2001 From: Rishit Date: Sat, 17 Feb 2024 13:56:05 +0530 Subject: [PATCH 8/9] fix: readme format --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 877df1e..ee476f5 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,7 @@ require('lualine').setup { theme = 'embark', } } +``` ### User configuration @@ -103,7 +104,6 @@ require('lualine').setup { end ``` -``` ### Todo From ef98ba5c4634e36971fa635a464217bc87fea852 Mon Sep 17 00:00:00 2001 From: Rishit Date: Sat, 17 Feb 2024 13:56:43 +0530 Subject: [PATCH 9/9] fix: update reamd --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ee476f5..a24bcaa 100644 --- a/README.md +++ b/README.md @@ -109,5 +109,5 @@ require('lualine').setup { ### Todo - [x] user configuration. -- [ ] support for other nvim plugins. +- [x] support for other nvim plugins. - [ ] light variant.