diff options
author | Ekaitz Zarraga <ekaitz@elenq.tech> | 2024-11-06 13:33:37 +0100 |
---|---|---|
committer | Ekaitz Zarraga <ekaitz@elenq.tech> | 2024-11-06 18:20:01 +0100 |
commit | b744eb359f61936a68640dce5014b6a505cb948b (patch) | |
tree | d47886cb784a1a50a08ed33a4ab1fa8607a1cd1e | |
parent | 49497cc98d070d524bfbb0360825170e92f70c1a (diff) |
nvim: colors: Use Dracula with treesitter support
-rw-r--r-- | nvim/nvim/init.lua | 31 | ||||
-rw-r--r-- | nvim/nvim/lua/colors.lua | 27 |
2 files changed, 37 insertions, 21 deletions
diff --git a/nvim/nvim/init.lua b/nvim/nvim/init.lua index f294a5a..9428c32 100644 --- a/nvim/nvim/init.lua +++ b/nvim/nvim/init.lua @@ -8,7 +8,7 @@ vim.fn["plug#begin"]() Plug("julienvincent/nvim-paredit") -- Some paredit commands Plug("windwp/nvim-autopairs") -- Autobalance parens Plug('luizribeiro/vim-cooklang') - Plug("dracula/vim") + Plug('Mofiqul/dracula.nvim') Plug("othree/html5.vim") Plug("zaid/vim-rec") -- Plug("https://gitlab.com/Efraim/guix.vim") @@ -24,29 +24,16 @@ vim.fn["plug#end"]() vim.cmd.filetype("plugin", "on") --- Syntax -vim.cmd.syntax("on") -vim.cmd.syntax("sync", "fromstart") -vim.opt.redrawtime = 10000 - -- Colors vim.opt.termguicolors = true vim.opt.background = "dark" vim.env.NVIM_TUI_ENABLE_TRUE_COLOR = 1 vim.env.NVIM_TUI_ENABLE_CURSOR_SHAPE = 1 -vim.cmd.colorscheme("dracula") -vim.opt.cursorline = true -vim.cmd.highlight("CursorColumn", "ctermbg=DarkGrey", "guibg=#262626") -vim.cmd.highlight("CursorLine", "ctermbg=DarkGrey", "guibg=#262626") -vim.cmd.highlight("ColorColumn", "ctermbg=DarkGrey", "guibg=#262626") -vim.cmd.highlight("ExtraWhitespace", "ctermbg=red", "guibg=red") - --- Spell --- Only mark the underline, by default it also writes the text in red -vim.cmd.highlight("SpellBad", "cterm=underline", "gui=undercurl") -vim.cmd.highlight("SpellCap", "cterm=underline", "gui=undercurl") -vim.cmd.highlight("SpellRare", "cterm=underline", "gui=undercurl") -vim.cmd.highlight("SpellLocal", "cterm=underline", "gui=undercurl") + +-- Syntax +vim.cmd.syntax("on") +vim.cmd.syntax("sync", "fromstart") +vim.opt.redrawtime = 10000 -- HighLight search vim.opt.hlsearch = true @@ -82,6 +69,7 @@ vim.opt.mouse = "a" vim.opt.showmatch = true vim.opt.modeline = true vim.opt.path = {"**"} +vim.opt.cursorline = true -- Ignore Case in search vim.opt.ignorecase = true @@ -129,8 +117,8 @@ vim.api.nvim_create_autocmd({ "BufEnter" }, { require'nvim-treesitter.configs'.setup { -- A list of parser names, or "all" - ensure_installed = { "c", "cpp", "python", "scheme", "javascript", - "fennel", "zig", "clojure", "vimdoc", "vim", "bash" }, + ensure_installed = { "c", "cpp", "python", "scheme", "javascript", "fennel", + "zig", "clojure", "vimdoc", "vim", "bash", "markdown", "markdown_inline" }, -- Install parsers synchronously (only applied to `ensure_installed`) sync_install = false, @@ -167,4 +155,5 @@ end -- Extras require 'mappings' require 'highlight' +require 'colors' require 'parens' diff --git a/nvim/nvim/lua/colors.lua b/nvim/nvim/lua/colors.lua new file mode 100644 index 0000000..81b80bf --- /dev/null +++ b/nvim/nvim/lua/colors.lua @@ -0,0 +1,27 @@ +local dracula = require("dracula") +local colors = dracula.colors() + +dracula.setup({ + -- show the '~' characters after the end of buffers + show_end_of_buffer = true, -- default false + -- set italic comment + italic_comment = true, -- default false + -- overrides the default highlights with table see `:h synIDattr` + overrides = { + -- Spell + -- Only mark the underline, by default it also writes the text in red + SpellBad = { sp = colors.red, undercurl = true, }, + SpellCap = { sp = colors.cyan, undercurl = true, }, + SpellRare = { sp = colors.orange, undercurl = true, }, + SpellLocal = { sp = colors.yellow, undercurl = true, }, + + -- Column and cursor + CursorColumn = { bg = colors.menu }, + ColorColumn = { bg = colors.menu }, + CursorLine = { bg = colors.menu }, + + -- Whitespaces + ExtraWhitespace = { bg = colors.red }, + } +}) +vim.cmd.colorscheme("dracula") |