diff --git a/init.lua b/init.lua index 7805dd69..f776c6c5 100644 --- a/init.lua +++ b/init.lua @@ -139,7 +139,7 @@ vim.o.timeoutlen = 300 -- Configure how new splits should be opened vim.o.splitright = true -vim.o.splitbelow = true +vim.o.splitbelow = false -- Sets how neovim will display certain whitespace characters in the editor. -- See `:help 'list'` @@ -876,28 +876,6 @@ require('lazy').setup({ }, }, - { -- You can easily change to a different colorscheme. - -- Change the name of the colorscheme plugin below, and then - -- change the command in the config to whatever the name of that colorscheme is. - -- - -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. - 'folke/tokyonight.nvim', - priority = 999, -- Make sure to load this before all the other start plugins. - config = function() - ---@diagnostic disable-next-line: missing-fields - require('tokyonight').setup { - styles = { - comments = { italic = false }, -- Disable italics in comments - }, - } - - -- Load the colorscheme here. - -- Like many other themes, this one has different styles, and you could load - -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight-moon' - end, - }, - -- Highlight todo, notes, etc in comments { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, @@ -985,7 +963,7 @@ require('lazy').setup({ -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. { import = 'custom.plugins' }, - { import = 'custom.themes' }, + { import = 'custom.plugins.themes' }, -- -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` -- Or use telescope! @@ -1015,3 +993,5 @@ require('lazy').setup({ -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et + +require 'custom.themes' diff --git a/lua/custom/plugins/themes.lua b/lua/custom/plugins/themes.lua new file mode 100644 index 00000000..1d8d8cd3 --- /dev/null +++ b/lua/custom/plugins/themes.lua @@ -0,0 +1,5 @@ +return { + { 'folke/tokyonight.nvim', lazy = false, priority = 1000 }, + { 'ellisonleao/gruvbox.nvim', lazy = false, priority = 1000 }, + { 'catppuccin/nvim', name = 'catppuccin', lazy = false, priority = 1000 }, +} diff --git a/lua/custom/themes/catppuccin.lua b/lua/custom/themes/catppuccin.lua new file mode 100644 index 00000000..dd65987a --- /dev/null +++ b/lua/custom/themes/catppuccin.lua @@ -0,0 +1,14 @@ +return function() + -- setup Catppuccin + require('catppuccin').setup { + flavour = 'mocha', -- options: latte, frappe, macchiato, mocha + integrations = { + -- Optional: enable integrations for plugins like telescope, lualine, etc + telescope = true, + nvimtree = true, + cmp = true, + }, + } + -- load the colorscheme + vim.cmd.colorscheme 'catppuccin' +end diff --git a/lua/custom/themes/catpuccin.lua b/lua/custom/themes/catpuccin.lua deleted file mode 100644 index 87bffcd8..00000000 --- a/lua/custom/themes/catpuccin.lua +++ /dev/null @@ -1,19 +0,0 @@ -return { - { - 'catppuccin/nvim', - name = 'catppuccin', - priority = 1000, -- ensure it loads first - config = function() - require('catppuccin').setup { - flavour = 'mocha', -- latte, frappe, macchiato, mocha - transparent_background = true, - integrations = { - treesitter = true, - native_lsp = { enabled = true }, - telescope = true, - }, - } - vim.cmd.colorscheme 'catppuccin' - end, - }, -} diff --git a/lua/custom/themes/gruvbox.lua b/lua/custom/themes/gruvbox.lua new file mode 100644 index 00000000..bd16d166 --- /dev/null +++ b/lua/custom/themes/gruvbox.lua @@ -0,0 +1,26 @@ +return function() + require('gruvbox').setup { + terminal_colors = true, -- add neovim terminal colors + undercurl = true, + underline = true, + bold = true, + italic = { + strings = true, + emphasis = true, + comments = true, + operators = false, + folds = true, + }, + strikethrough = true, + invert_selection = false, + invert_signs = false, + invert_tabline = false, + inverse = true, -- invert background for search, diffs, statuslines and errors + contrast = 'soft', -- can be "hard", "soft" or empty string + palette_overrides = {}, + overrides = {}, + dim_inactive = false, + transparent_mode = true, + } + vim.cmd 'colorscheme gruvbox' +end diff --git a/lua/custom/themes/init.lua b/lua/custom/themes/init.lua new file mode 100644 index 00000000..aab9d6c2 --- /dev/null +++ b/lua/custom/themes/init.lua @@ -0,0 +1,11 @@ +-- Pick which theme to use +local theme_name = 'gruvbox' -- + +-- Loading it +local ok, theme = pcall(require, 'custom.themes.' .. theme_name) +if not ok then + vim.notify('Failed to load theme: ' .. theme_name, vim.log.levels.ERROR) + return +end + +theme() diff --git a/lua/custom/themes/tokyonight.lua b/lua/custom/themes/tokyonight.lua new file mode 100644 index 00000000..4b614779 --- /dev/null +++ b/lua/custom/themes/tokyonight.lua @@ -0,0 +1,8 @@ +-- ~/.config/nvim/lua/custom/themes/tokyonight.lua +return function() + require('tokyonight').setup { + style = 'moon', + transparent = false, + } + vim.cmd.colorscheme 'tokyonight' +end