From 58af96db82e0641a04f72bcd0b60394ae97a4719 Mon Sep 17 00:00:00 2001 From: punkfairie Date: Sat, 30 Nov 2024 11:31:11 -0800 Subject: [PATCH] feat: rose-pine --- nix/neovim-overlay.nix | 3 +++ nvim/init.lua | 2 ++ nvim/lua/plugins/colorscheme/init.lua | 5 +++++ nvim/lua/plugins/colorscheme/rose-pine.lua | 17 +++++++++++++++++ nvim/lua/plugins/ui/bufferline-nvim.lua | 14 ++++++++++++-- 5 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 nvim/lua/plugins/colorscheme/init.lua create mode 100644 nvim/lua/plugins/colorscheme/rose-pine.lua diff --git a/nix/neovim-overlay.nix b/nix/neovim-overlay.nix index 9b19285..383164c 100644 --- a/nix/neovim-overlay.nix +++ b/nix/neovim-overlay.nix @@ -36,6 +36,9 @@ with final.pkgs.lib; let # Util plenary-nvim + # Colorscheme + rose-pine + # UI mini-icons alpha-nvim diff --git a/nvim/init.lua b/nvim/init.lua index 7b4abab..7da2aeb 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -12,3 +12,5 @@ require('autocmds') require('snacks-nvim') require('lz.n').load('plugins') + +vim.cmd('colorscheme rose-pine') diff --git a/nvim/lua/plugins/colorscheme/init.lua b/nvim/lua/plugins/colorscheme/init.lua new file mode 100644 index 0000000..59ec20a --- /dev/null +++ b/nvim/lua/plugins/colorscheme/init.lua @@ -0,0 +1,5 @@ +local req = require('lib.marleyvim').localRequire('plugins.colorscheme') + +return { + req('rose-pine'), +} diff --git a/nvim/lua/plugins/colorscheme/rose-pine.lua b/nvim/lua/plugins/colorscheme/rose-pine.lua new file mode 100644 index 0000000..5b42c7e --- /dev/null +++ b/nvim/lua/plugins/colorscheme/rose-pine.lua @@ -0,0 +1,17 @@ +return { + 'rose-pine', + colorscheme = { + 'rose-pine', + 'rose-pine-main', + 'rose-pine-moon', + 'rose-pine-dawn', + }, + after = function() + require('rose-pine').setup({ + variant = 'main', + }) + + -- Reload the colorscheme once opts are set. + vim.cmd('colorscheme rose-pine') + end, +} diff --git a/nvim/lua/plugins/ui/bufferline-nvim.lua b/nvim/lua/plugins/ui/bufferline-nvim.lua index 4872654..3d0e617 100644 --- a/nvim/lua/plugins/ui/bufferline-nvim.lua +++ b/nvim/lua/plugins/ui/bufferline-nvim.lua @@ -27,9 +27,13 @@ return { }, before = function() require('lz.n').trigger_load('mini.icons') + + if vim.g.colors_name == 'rose-pine' then + require('lz.n').trigger_load('rose-pine') + end end, after = function() - require('bufferline').setup({ + local opts = { options = { always_show_bufferline = true, @@ -65,7 +69,13 @@ return { return icon, hl end, }, - }) + } + + if vim.g.colors_name == 'rose-pine' then + opts.highlights = require('rose-pine.plugins.bufferline') + end + + require('bufferline').setup(opts) vim.api.nvim_create_autocmd({ 'BufAdd', 'BufDelete' }, { desc = 'Fix bufferline when restoring a session',