From: mofiqul Date: Fri, 4 Jun 2021 10:16:24 +0000 (+0530) Subject: Finish up X-Git-Url: https://git.atheridis.org/?a=commitdiff_plain;h=dfbec17595cd0978e5edc480704a178f24ba82e2;p=nvim-plugins%2Fflatwhite.git Finish up --- diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..1b833b1 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 Mofiqul Islam + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..d974b86 --- /dev/null +++ b/README.md @@ -0,0 +1,60 @@ +

🧛‍♂️ dracula.nvim

+ +[Dracula](https://draculatheme.com/) colorscheme for [neovim](https://neovim.io/) written in Lua + +![TypeScript and NvimTree](./assets/react.png) + +![Lua](./assets/lua.png) + +## ✔️ Requirements +- Neovim >= 0.5.0 + +## #️ Supported Plugins +- [LSP](https://github.com/neovim/nvim-lspconfig) +- [Treesitter](https://github.com/nvim-treesitter/nvim-treesitter) +- [nvim-compe](https://github.com/hrsh7th/nvim-compe) +- [Telescope](https://github.com/nvim-telescope/telescope.nvim) +- [NvimTree](https://github.com/kyazdani42/nvim-tree.lua) +- [BufferLine](https://github.com/akinsho/nvim-bufferline.lua) +- [Git Signs](https://github.com/lewis6991/gitsigns.nvim) +- [Lualine](https://github.com/hoob3rt/lualine.nvim) + +## ⬇️ Installation + +Install via package manager + + ```lua + -- Using Packer: + use 'Mofiqul/dracula.nvim' + ``` + +```vim +" Using Vim-Plug: +Plug 'Mofiqul/dracula.nvim' +``` +## 🚀 Usage + +```lua +-- Lua: +vim.cmd[[colorscheme dracula]] + +``` +```vim +" Vim-Script: +colorscheme dracula +``` + +If you are using [`lualine`](https://github.com/hoob3rt/lualine.nvim), you can also enable the provided theme: +> Make sure to set theme as 'dracula-nvim' as dracula already exists in lualine built in themes + +```lua +require('lualine').setup { + options = { + -- ... + theme = 'dracula-nvim' + -- ... + } +}' +``` + + diff --git a/assets/lua.png b/assets/lua.png new file mode 100644 index 0000000..63a9898 Binary files /dev/null and b/assets/lua.png differ diff --git a/assets/react.png b/assets/react.png new file mode 100644 index 0000000..18d8d61 Binary files /dev/null and b/assets/react.png differ diff --git a/colors/dracula.vim b/colors/dracula.vim new file mode 100644 index 0000000..edad7fa --- /dev/null +++ b/colors/dracula.vim @@ -0,0 +1 @@ +lua require("dracula") diff --git a/lua/dracula/init.lua b/lua/dracula/init.lua index 8a8770e..ee78158 100644 --- a/lua/dracula/init.lua +++ b/lua/dracula/init.lua @@ -1,8 +1,8 @@ +-- Dracula color scheme + vim.api.nvim_command("set background=dark") vim.g.colors_name = "dracula" - - local colors = { bg = "#282A36", fg = "#F8F8F2", @@ -22,26 +22,42 @@ local colors = { bright_magenta = "#FF92DF", bright_cyan = "#A4FFFF", bright_white = "#FFFFFF", - cursor_line = "#2C2C2C", - menu = "#282C34", + menu = "#21222C", visual = "#3E4452", - split = "#181A1F", gutter_fg = "#4B5263", nontext = "#3B4048", white = "#ABB2BF", - black = "#1e1e1e" + black = "#191A21" } +vim.g.terminal_color_0 = colors.back +vim.g.terminal_color_1 = colors.red +vim.g.terminal_color_2 = colors.green +vim.g.terminal_color_3 = colors.yellow +vim.g.terminal_color_4 = colors.purple +vim.g.terminal_color_5 = colors.pink +vim.g.terminal_color_6 = colors.cyan +vim.g.terminal_color_7 = colors.white +vim.g.terminal_color_8 = colors.selection +vim.g.terminal_color_9 = colors.bright_red +vim.g.terminal_color_11 = colors.bright_yellow +vim.g.terminal_color_12 = colors.bright_blue +vim.g.terminal_color_13 = colors.bright_magenta +vim.g.terminal_color_14 = colors.bright_cyan +vim.g.terminal_color_15 = colors.bright_white +vim.g.terminal_color_background = colors.bg +vim.g.terminal_color_foreground = colors.fg + local highlight = function(group, fg, bg, attr, sp) - local fg = fg and "guifg=" .. fg or "guifg=NONE" - local bg = bg and "guibg=" .. bg or "guibg=NONE" - local attr = attr and "gui=" ..attr or "gui=NONE" - local sp = sp and "guisp=" .. sp or "" + fg = fg and "guifg=" .. fg or "guifg=NONE" + bg = bg and "guibg=" .. bg or "guibg=NONE" + attr = attr and "gui=" ..attr or "gui=NONE" + sp = sp and "guisp=" .. sp or "" vim.api.nvim_command("highlight " .. group .. " ".. fg .. " " .. bg .. " ".. attr .. " " .. sp) end --- Group Foreground Backgroud Attribute, Special +-- highlight(Group, Foreground, Backgroud, Attribute, Special) highlight("Normal", colors.fg, colors.bg, nil, nil) highlight("Comment", colors.comment, nil, nil, nil) highlight("Constant", colors.yellow, nil, nil, nil) @@ -50,14 +66,14 @@ highlight("Character", colors.green, nil, nil, nil) highlight("Number", colors.orange, nil, nil, nil) highlight("Boolean", colors.cyan, nil, nil, nil) highlight("Float", colors.orange, nil, nil, nil) +highlight("Operator", colors.purple, nil, nil, nil) +highlight("Keywords", colors.cyan, nil, nil, nil) highlight("Identifier", colors.cyan, nil, nil, nil) highlight("Function", colors.yellow, nil, nil, nil) highlight("Statement", colors.purple, nil, nil, nil) highlight("Conditional", colors.pink, nil, nil, nil) highlight("Repeat", colors.pink, nil, nil, nil) highlight("Label", colors.cyan, nil, nil, nil) -highlight("Operator", colors.purple, nil, nil, nil) -highlight("Keywords", colors.cyan, nil, nil, nil) highlight("Exception", colors.purple, nil, nil, nil) highlight("PreProc", colors.yellow, nil, nil, nil) highlight("Include", colors.purple, nil, nil, nil) @@ -74,41 +90,49 @@ highlight("SpecialComment", colors.comment, nil, nil, nil) highlight("Error", colors.bright_red, nil, nil, nil) highlight("Todo", colors.purple, nil, "bold,italic", nil) highlight("Underlined", colors.cyan, nil, "underline", nil) + highlight("Cursor", nil, nil, "reverse", nil) -highlight("CursorColumn", nil, colors.cursor_line, "reverse", nil) +highlight("CursorColumn", nil, colors.black, "reverse", nil) highlight("CursorLineNr", colors.fg, nil, "bold", nil) highlight("SignColumn", nil, colors.bg, nil, nil) highlight("Conceal", colors.comment, nil, nil, nil) -highlight("CursorColumn", nil, colors.cursor_line, nil, nil) -highlight("CursorLine", nil, colors.cursor_line, nil, nil) +highlight("CursorColumn", nil, colors.black, nil, nil) +highlight("CursorLine", nil, colors.selection, nil, nil) + +highlight("StatusLine", colors.white, colors.black, nil, nil) +highlight("StatusLineNC", colors.comment, nil, nil, nil) +highlight("StatusLineTerm", colors.white, colors.black, nil, nil) +highlight("StatusLineTermNC", colors.comment, nil, nil, nil) + highlight("Directory", colors.cyan, nil, nil, nil) highlight("DiffAdd", colors.bg, colors.green, nil, nil) highlight("DiffChange", colors.orange, nil, nil, nil) highlight("DiffDelete", colors.red, nil, nil, nil) highlight("DiffText", colors.comment, nil, nil, nil) + highlight("ErrorMsg", colors.bright_red, nil, nil, nil) -highlight("VertSplit", colors.split, nil, nil, nil) +highlight("VertSplit", colors.black, nil, nil, nil) highlight("Folded", colors.comment, nil, nil, nil) highlight("FoldColumn", nil, nil, nil, nil) -highlight("IncSearch", colors.yellow, colors.comment, nil, nil) +highlight("Search", colors.black, colors.orange, nil, nil) +highlight("IncSearch", colors.orange, colors.comment, nil, nil) highlight("LineNr", colors.comment, nil, nil, nil) highlight("MatchParen", colors.fg, nil, "underline", nil) highlight("NonText", colors.nontext, nil, nil, nil) -highlight("Pmenu", colors.white, nil, nil, nil) -highlight("PmenuSel", colors.black, colors.cyan, nil, nil) -highlight("PmenuSbar", nil, colors.nontext, nil, nil) -highlight("PmenuThumb", nil, colors.white, nil, nil) +highlight("Pmenu", colors.white, colors.menu, nil, nil) +highlight("PmenuSel", colors.black, colors.selection, nil, nil) +highlight("PmenuSbar", nil, colors.bg, nil, nil) +highlight("PmenuThumb", nil, colors.selection, nil, nil) + highlight("Question", colors.purple, nil, nil, nil) highlight("QuickFixLine", colors.black, colors.yellow, nil, nil) highlight("SpecialKey", colors.nontext, nil, nil, nil) + highlight("SpellBad", colors.bright_red, nil, "underline", nil) highlight("SpellCap", colors.yellow, nil, nil, nil) highlight("SpellLocal", colors.yellow, nil, nil, nil) highlight("SpellRare", colors.yellow, nil, nil, nil) -highlight("StatusLine", colors.white, colors.cursor_line, nil, nil) -highlight("StatusLineNC", colors.comment, nil, nil, nil) -highlight("StatusLineTerm", colors.white, colors.cursor_line, nil, nil) -highlight("StatusLineTermNC", colors.comment, nil, nil, nil) + highlight("TabLine", colors.comment, nil, nil, nil) highlight("TabLineSel", colors.white, nil, nil, nil) highlight("TabLineFill", nil, colors.bg, nil, nil) @@ -117,10 +141,9 @@ highlight("Visual", nil, colors.visual, nil, nil) highlight("VisualNOS", colors.visual, nil, nil, nil) highlight("WarningMsg", colors.yellow, nil, nil, nil) highlight("WildMenu", colors.black, colors.white, nil, nil) -highlight("EndOfBuffer", colors.black, nil, nil, nil) - - +highlight("EndOfBuffer", colors.bg, nil, nil, nil) +-- TreeSitter highlight("TSError", colors.bright_red, nil, nil, nil) highlight("TSPunctDelimiter", colors.fg, nil, nil, nil) highlight("TSPunctBracket", colors.fg, nil, nil, nil) @@ -170,18 +193,17 @@ highlight("TSInclude", colors.pink, nil, nil, nil) highlight("TSVariable", colors.fg, nil, nil, nil) highlight("TSVariableBuiltin", colors.purple, nil, nil, nil) -highlight("TSText", "#FFFF00", nil, nil, nil) -highlight("TSStrong", "#FFFF00", nil, nil, nil) -highlight("TSEmphasis", "#FFFF00", nil, nil, nil) -highlight("TSUnderline", "#FFFF00", nil, nil, nil) -highlight("TSTitle", "#FFFF00", nil, nil, nil) -highlight("TSLiteral", "#FFFF00", nil, nil, nil) -highlight("TSURI", "#FFFF00", nil, nil, nil) +highlight("TSText", "colors.orange", nil, nil, nil) +highlight("TSStrong", "colors.orange", nil, nil, nil) +highlight("TSEmphasis", "colors.orange", nil, nil, nil) +highlight("TSUnderline", "colors.orange", nil, nil, nil) +highlight("TSTitle", "colors.orange", nil, nil, nil) +highlight("TSLiteral", "colors.orange", nil, nil, nil) +highlight("TSURI", "colors.orange", nil, nil, nil) highlight("TSTag", colors.cyan, nil, nil, nil) highlight("TSTagDelimiter", colors.white, nil, nil, nil) - -- HTML highlight("htmlArg", colors.yellow, nil, nil, nil) highlight("htmlBold", colors.yellow, nil, "bold", nil) @@ -225,7 +247,7 @@ highlight("markdownListMarker", colors.cyan, nil, nil, nil) highlight("markdownOrderedListMarker", colors.red, nil, nil, nil) highlight("markdownRule", colors.comment, nil, nil, nil) - +-- Diff highlight("diffAdded", colors.green, nil, nil, nil) highlight("diffRemoved", colors.red, nil, nil, nil) highlight("diffFileId", colors.yellow, nil, "bold,reverse", nil) @@ -233,17 +255,16 @@ highlight("diffFile", colors.nontext, nil, nil, nil) highlight("diffNewFile", colors.green, nil, nil, nil) highlight("diffOldFile", colors.red, nil, nil, nil) - highlight("debugPc", nil, colors.cyan, nil, nil) highlight("debugBreakpoint", colors.red, nil, "reverse", nil) -- Git Signs -highlight('GitSignsAdd', colors.green, nil, nil, nil) -highlight('GitSignsChange', colors.yellow, nil, nil, nil) -highlight('GitSignsDelete', colors.red, nil, nil, nil) -highlight('GitSignsAddLn', colors.black, colors.green, nil, nil) -highlight('GitSignsChangeLn', colors.black, colors.yellow, nil, nil) -highlight('GitSignsDeleteLn', colors.black, colors.red, nil, nil) +highlight('GitSignsAdd', colors.bright_green, nil, nil, nil) +highlight('GitSignsChange', colors.cyan, nil, nil, nil) +highlight('GitSignsDelete', colors.bright_red, nil, nil, nil) +highlight('GitSignsAddLn', colors.black, colors.bright_green, nil, nil) +highlight('GitSignsChangeLn', colors.black, colors.cyan, nil, nil) +highlight('GitSignsDeleteLn', colors.black, colors.bright_red, nil, nil) -- Nvim compe vim.api.nvim_command("highlight! link CompeDocumentation Pmenu") @@ -257,7 +278,7 @@ highlight("TelescopePreviewBorder", colors.pink, nil, nil, nil) highlight("NvimTreeRootFolder", colors.purple, nil, 'bold', nil) highlight("NvimTreeNormal ", colors.bright_blue, nil, nil, nil) highlight("NvimTreeGitDirty", colors.yellow, nil, nil, nil) -highlight("NvimTreeGitNew", colors.green, nil, nil, nil) +highlight("NvimTreeGitNew", colors.bright_green, nil, nil, nil) highlight("NvimTreeImageFile", colors.pink, nil, nil, nil) highlight("NvimTreeFolderIcon", colors.purple, nil, nil, nil) highlight("NvimTreeIndentMarker", colors.nontext, nil, nil, nil) @@ -266,8 +287,8 @@ highlight("NvimTreeFolderName", colors.bright_blue, nil, nil, nil) highlight("NvimTreeSpecialFile", colors.pink, nil, 'underline', nil) -- Bufferline -highlight("BufferLineIndicatorSelected", colors.cyan , nil, nil, nil) -highlight("BufferLineFill", nil , colors.cursor_line, nil, nil) +highlight("BufferLineIndicatorSelected", colors.purple , nil, nil, nil) +highlight("BufferLineFill", nil , colors.black, nil, nil) -- LSP highlight('LspDiagnosticsDefaultError', colors.red, nil, nil, nil) diff --git a/lua/lualine/themes/dracula-nvim.lua b/lua/lualine/themes/dracula-nvim.lua new file mode 100644 index 0000000..ea9be54 --- /dev/null +++ b/lua/lualine/themes/dracula-nvim.lua @@ -0,0 +1,41 @@ +local dracula = {} + +local colors = { + black = "#191A21", + white = '#F8F8F2', + red = '#FF5555', + green = '#50FA7B', + purple = '#BD93F9', + pink = '#FF79C6', + yellow = '#F1FA8C', +} + +dracula.normal = { + b = {fg = colors.purple, bg = colors.black}, + a = {fg = colors.black, bg = colors.purple, gui = 'bold'}, + c = {fg = colors.white, bg = colors.black} +} + +dracula.visual = { + a = {fg = colors.black, bg = colors.pink, gui = 'bold'}, + b = {fg = colors.pink, bg = colors.black}, +} + +dracula.inactive = { + b = {fg = colors.black, bg = colors.white}, + a = {fg = colors.white, bg = colors.gray, gui = 'bold'} +} + +dracula.replace = { + b = {fg = colors.yellow, bg = colors.black}, + a = {fg = colors.black, bg = colors.yellow, gui = 'bold'}, + c = {fg = colors.white, bg = colors.black} +} + +dracula.insert = { + a = {fg = colors.black, bg = colors.green, gui = 'bold'}, + b = {fg = colors.green, bg = colors.black}, + c = {fg = colors.white, bg = colors.black} +} + +return dracula diff --git a/lua/lualine/themes/dracula.lua b/lua/lualine/themes/dracula.lua deleted file mode 100644 index d49706f..0000000 --- a/lua/lualine/themes/dracula.lua +++ /dev/null @@ -1,44 +0,0 @@ --- Copyright (c) 2020-2021 Mofiqul Islam --- MIT license, see LICENSE for more details. -local dracula = {} - -local colors = { - black = "#282A36", - white = '#F8F8F2', - red = '#FF5555', - green = '#50FA7B', - purple = '#BD93F9', - pink = '#FF79C6', - yellow = '#F1FA8C', -} - -dracula.normal = { - b = {fg = colors.purple, bg = colors.black}, - a = {fg = colors.white, bg = colors.purple, gui = 'bold'}, - c = {fg = colors.white, bg = colors.black} -} - -dracula.visual = { - a = {fg = colors.black, bg = colors.pink, gui = 'bold'}, - b = {fg = colors.pink, bg = colors.black}, -} - -dracula.inactive = { - b = {fg = colors.black, bg = colors.white}, - a = {fg = colors.white, bg = colors.gray, gui = 'bold'} -} - -dracula.replace = { - b = {fg = colors.yellow, bg = colors.black}, - a = {fg = colors.black, bg = colors.yellow, gui = 'bold'}, - c = {fg = colors.white, bg = colors.black} -} - -dracula.insert = { - a = {fg = colors.black, bg = colors.yellow, gui = 'bold'}, - b = {fg = colors.yellow, bg = colors.black}, - c = {fg = colors.white, bg = colors.black} -} - -return dracula -