diff --git a/.github/.DS_Store b/.github/.DS_Store deleted file mode 100644 index fbeb2c1..0000000 Binary files a/.github/.DS_Store and /dev/null differ 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/README.md b/README.md index 051c560..a24bcaa 100644 --- a/README.md +++ b/README.md @@ -91,9 +91,23 @@ require('lualine').setup { } ``` +### 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. -- [ ] support for other nvim plugins. +- [x] user configuration. +- [x] support for other nvim plugins. - [ ] light variant. diff --git a/lua/embark/init.lua b/lua/embark/init.lua index bcaae93..524b0b1 100644 --- a/lua/embark/init.lua +++ b/lua/embark/init.lua @@ -3,6 +3,45 @@ local none = 'NONE' local M = {} +-- stylua: ignore start +--- @class StyleProps +--- @field bold boolean +--- @field italic boolean +-- local style_props = { +-- bold = true, +-- italic = true, +-- } +-- stylua: ignore end + +--- @class EmbarkConf +--- @field styles table +M.config = { + styles = { + --- @type StyleProps + keywords = { bold = true, italic = true }, + --- @type StyleProps + comments = { bold = false, italic = true }, + }, +} + +--- @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', @@ -49,7 +88,7 @@ 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 +333,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' }) + 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' })