From ebc341b8530308da24c5fdaf1cefe5e8ff9dbea6 Mon Sep 17 00:00:00 2001 From: pika Date: Tue, 30 Jul 2024 18:39:46 +0200 Subject: [PATCH] removed lualine and addet witch-dark colorscheme. Also changed the way to install colorschemes + configs under ./lua/pika/plugins/colorschemes.lua --- init.lua | 11 +++ lua/pika/lazy.lua | 30 +++--- lua/pika/plugins/colorscheme.lua | 26 ------ lua/pika/plugins/colorschemes.lua | 38 ++++++++ lua/pika/plugins/init.lua | 8 ++ lua/pika/plugins/lualine.lua | 71 -------------- lua/pika/plugins/lualine.lua.disabled | 71 ++++++++++++++ lua/pika/plugins/telescope.lua | 127 +++++++++++++------------- 8 files changed, 207 insertions(+), 175 deletions(-) delete mode 100644 lua/pika/plugins/colorscheme.lua create mode 100644 lua/pika/plugins/colorschemes.lua delete mode 100644 lua/pika/plugins/lualine.lua create mode 100644 lua/pika/plugins/lualine.lua.disabled diff --git a/init.lua b/init.lua index 5c2c381..5572deb 100644 --- a/init.lua +++ b/init.lua @@ -1,2 +1,13 @@ +-- ─< Function to apply the colorscheme >─────────────────────────────────────────────── +local function apply_colorscheme(name) + vim.cmd.colorscheme(name) +end + require("pika.core") require("pika.lazy") + +-- ─< Call the function to set the desired colorscheme >──────────────────────────────── +-- ╭──────────────────────────────────────────────────────╮ +-- │ themes are under ./lua/pika/plugins/colorschemes.lua │ +-- ╰──────────────────────────────────────────────────────╯ +apply_colorscheme("witch-dark") -- Change "witch" to your desired colorscheme name diff --git a/lua/pika/lazy.lua b/lua/pika/lazy.lua index 91a1262..cf32538 100644 --- a/lua/pika/lazy.lua +++ b/lua/pika/lazy.lua @@ -1,22 +1,22 @@ local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - "git", - "clone", - "--filter=blob:none", - "https://github.com/folke/lazy.nvim.git", - "--branch=stable", -- latest stable release - lazypath, - }) + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) end vim.opt.rtp:prepend(lazypath) require("lazy").setup({ { import = "pika.plugins" }, { import = "pika.plugins.lsp" } }, { - checker = { - enabled = true, - notify = false, - }, - change_detection = { - notify = false, - }, + checker = { + enabled = true, + notify = true, + }, + change_detection = { + notify = true, + }, }) diff --git a/lua/pika/plugins/colorscheme.lua b/lua/pika/plugins/colorscheme.lua deleted file mode 100644 index 9fb5a7f..0000000 --- a/lua/pika/plugins/colorscheme.lua +++ /dev/null @@ -1,26 +0,0 @@ -return { - "ribru17/bamboo.nvim", - lazy = false, - priority = 1000, -- Make sure to load this before all the other start plugins. - config = function() - require("bamboo").setup({ - -- ────────────────────────────< optional configuration here >───────────────────────── - code_style = { - comments = { italic = false, bold = true }, - conditionals = { italic = true }, - keywords = { bold = true }, - functions = {}, - namespaces = { italic = true }, - parameters = { italic = true }, - strings = {}, - variables = { bold = true }, - }, - -- ─< Custom Highlights -- >──────────────────────────────────────────────────────────── - colors = {}, -- Override default colors - highlights = { -- Override highlight groups - ["@comment"] = { fg = "#555653" }, - }, - }) - require("bamboo").load() - end, -} diff --git a/lua/pika/plugins/colorschemes.lua b/lua/pika/plugins/colorschemes.lua new file mode 100644 index 0000000..d9ebb58 --- /dev/null +++ b/lua/pika/plugins/colorschemes.lua @@ -0,0 +1,38 @@ +return { + + { + "sontungexpt/witch", + priority = 1000, + lazy = false, + config = function(_, opts) + require("witch").setup(opts) + end, + }, + + { + "ribru17/bamboo.nvim", + lazy = false, + priority = 1000, -- Make sure to load this before all the other start plugins. + config = function() + require("bamboo").setup({ + -- ────────────────────────────< optional configuration here >───────────────────────── + code_style = { + comments = { italic = false, bold = true }, + conditionals = { italic = true }, + keywords = { bold = true }, + functions = {}, + namespaces = { italic = true }, + parameters = { italic = true }, + strings = {}, + variables = { bold = true }, + }, + -- ─< Custom Highlights -- >──────────────────────────────────────────────────────────── + colors = {}, -- Override default colors + highlights = { -- Override highlight groups + ["@comment"] = { fg = "#555653" }, + }, + }) + -- require("bamboo").load() + end, + }, +} diff --git a/lua/pika/plugins/init.lua b/lua/pika/plugins/init.lua index 2299bb6..431faa6 100644 --- a/lua/pika/plugins/init.lua +++ b/lua/pika/plugins/init.lua @@ -2,4 +2,12 @@ return { "nvim-lua/plenary.nvim", -- lua functions that many plugins use "christoomey/vim-tmux-navigator", -- tmux & split window navigation "dstein64/nvim-scrollview", + { + "sontungexpt/witch", + priority = 1000, + lazy = false, + config = function(_, opts) + require("witch").setup(opts) + end, + }, } diff --git a/lua/pika/plugins/lualine.lua b/lua/pika/plugins/lualine.lua deleted file mode 100644 index bbb0851..0000000 --- a/lua/pika/plugins/lualine.lua +++ /dev/null @@ -1,71 +0,0 @@ -return { - "nvim-lualine/lualine.nvim", - dependencies = { "nvim-tree/nvim-web-devicons" }, - config = function() - local lualine = require("lualine") - local lazy_status = require("lazy.status") -- to configure lazy pending updates count - - local colors = { - blue = "#57a5e5", - green = "#70c2be", - violet = "#aaaaff", - yellow = "#dbb651", - red = "#e75a7c", - fg = "#f1e9dc", - bg = "#31332e", - inactive_bg = "#3a3d37", - } - - local my_lualine_theme = { - normal = { - a = { bg = colors.blue, fg = colors.bg, gui = "bold" }, - b = { bg = colors.bg, fg = colors.fg }, - c = { bg = colors.bg, fg = colors.fg }, - }, - insert = { - a = { bg = colors.green, fg = colors.bg, gui = "bold" }, - b = { bg = colors.bg, fg = colors.fg }, - c = { bg = colors.bg, fg = colors.fg }, - }, - visual = { - a = { bg = colors.violet, fg = colors.bg, gui = "bold" }, - b = { bg = colors.bg, fg = colors.fg }, - c = { bg = colors.bg, fg = colors.fg }, - }, - command = { - a = { bg = colors.yellow, fg = colors.bg, gui = "bold" }, - b = { bg = colors.bg, fg = colors.fg }, - c = { bg = colors.bg, fg = colors.fg }, - }, - replace = { - a = { bg = colors.red, fg = colors.bg, gui = "bold" }, - b = { bg = colors.bg, fg = colors.fg }, - c = { bg = colors.bg, fg = colors.fg }, - }, - inactive = { - a = { bg = colors.inactive_bg, fg = colors.semilightgray, gui = "bold" }, - b = { bg = colors.inactive_bg, fg = colors.semilightgray }, - c = { bg = colors.inactive_bg, fg = colors.semilightgray }, - }, - } - - -- configure lualine with modified theme - lualine.setup({ - options = { - theme = my_lualine_theme, - }, - sections = { - lualine_x = { - { - lazy_status.updates, - cond = lazy_status.has_updates, - color = { fg = "#ff9e64" }, - }, - { "encoding" }, - { "fileformat" }, - { "filetype" }, - }, - }, - }) - end, -} diff --git a/lua/pika/plugins/lualine.lua.disabled b/lua/pika/plugins/lualine.lua.disabled new file mode 100644 index 0000000..aed533d --- /dev/null +++ b/lua/pika/plugins/lualine.lua.disabled @@ -0,0 +1,71 @@ +-- return { +-- "nvim-lualine/lualine.nvim", +-- dependencies = { "nvim-tree/nvim-web-devicons" }, +-- config = function() +-- local lualine = require("lualine") +-- local lazy_status = require("lazy.status") -- to configure lazy pending updates count +-- +-- local colors = { +-- blue = "#57a5e5", +-- green = "#70c2be", +-- violet = "#aaaaff", +-- yellow = "#dbb651", +-- red = "#e75a7c", +-- fg = "#f1e9dc", +-- bg = "#31332e", +-- inactive_bg = "#3a3d37", +-- } +-- +-- local my_lualine_theme = { +-- normal = { +-- a = { bg = colors.blue, fg = colors.bg, gui = "bold" }, +-- b = { bg = colors.bg, fg = colors.fg }, +-- c = { bg = colors.bg, fg = colors.fg }, +-- }, +-- insert = { +-- a = { bg = colors.green, fg = colors.bg, gui = "bold" }, +-- b = { bg = colors.bg, fg = colors.fg }, +-- c = { bg = colors.bg, fg = colors.fg }, +-- }, +-- visual = { +-- a = { bg = colors.violet, fg = colors.bg, gui = "bold" }, +-- b = { bg = colors.bg, fg = colors.fg }, +-- c = { bg = colors.bg, fg = colors.fg }, +-- }, +-- command = { +-- a = { bg = colors.yellow, fg = colors.bg, gui = "bold" }, +-- b = { bg = colors.bg, fg = colors.fg }, +-- c = { bg = colors.bg, fg = colors.fg }, +-- }, +-- replace = { +-- a = { bg = colors.red, fg = colors.bg, gui = "bold" }, +-- b = { bg = colors.bg, fg = colors.fg }, +-- c = { bg = colors.bg, fg = colors.fg }, +-- }, +-- inactive = { +-- a = { bg = colors.inactive_bg, fg = colors.semilightgray, gui = "bold" }, +-- b = { bg = colors.inactive_bg, fg = colors.semilightgray }, +-- c = { bg = colors.inactive_bg, fg = colors.semilightgray }, +-- }, +-- } +-- +-- -- configure lualine with modified theme +-- lualine.setup({ +-- options = { +-- theme = my_lualine_theme, +-- }, +-- sections = { +-- lualine_x = { +-- { +-- lazy_status.updates, +-- cond = lazy_status.has_updates, +-- color = { fg = "#ff9e64" }, +-- }, +-- { "encoding" }, +-- { "fileformat" }, +-- { "filetype" }, +-- }, +-- }, +-- }) +-- end, +-- } diff --git a/lua/pika/plugins/telescope.lua b/lua/pika/plugins/telescope.lua index 60b4f9e..e8bdba6 100644 --- a/lua/pika/plugins/telescope.lua +++ b/lua/pika/plugins/telescope.lua @@ -1,74 +1,75 @@ return { - 'nvim-telescope/telescope.nvim', - branch = '0.1.x', - dependencies = { - 'nvim-lua/plenary.nvim', - { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }, - 'nvim-tree/nvim-web-devicons', - 'folke/todo-comments.nvim', - }, - config = function() - local telescope = require 'telescope' - local actions = require 'telescope.actions' - local transform_mod = require('telescope.actions.mt').transform_mod + "nvim-telescope/telescope.nvim", + branch = "0.1.x", + dependencies = { + "nvim-lua/plenary.nvim", + { "nvim-telescope/telescope-fzf-native.nvim", build = "make" }, + "nvim-tree/nvim-web-devicons", + "folke/todo-comments.nvim", + }, + config = function() + local telescope = require("telescope") + local actions = require("telescope.actions") + local transform_mod = require("telescope.actions.mt").transform_mod - local trouble = require 'trouble' - local trouble_telescope = require 'trouble.providers.telescope' + local trouble = require("trouble") + local trouble_telescope = require("trouble.providers.telescope") - -- or create your custom action - local custom_actions = transform_mod { - open_trouble_qflist = function(prompt_bufnr) - trouble.toggle 'quickfix' - end, - } + -- or create your custom action + local custom_actions = transform_mod({ + open_trouble_qflist = function(prompt_bufnr) + trouble.toggle("quickfix") + end, + }) - local trouble_telescope = require 'trouble.sources.telescope' + local trouble_telescope = require("trouble.sources.telescope") - telescope.setup { - defaults = { - path_display = { 'smart' }, - mappings = { - i = { - [''] = actions.move_selection_previous, -- move to prev result - [''] = actions.move_selection_next, -- move to next result - [''] = actions.send_selected_to_qflist + custom_actions.open_trouble_qflist, - [''] = trouble_telescope.open, -- Updated line - }, - }, - }, - } + telescope.setup({ + defaults = { + path_display = { "smart" }, + mappings = { + i = { + [""] = actions.move_selection_previous, -- move to prev result + [""] = actions.move_selection_next, -- move to next result + [""] = actions.send_selected_to_qflist + custom_actions.open_trouble_qflist, + [""] = trouble_telescope.open, -- Updated line + }, + }, + }, + }) - telescope.load_extension 'fzf' + telescope.load_extension("fzf") - -- set keymaps - local map = vim.keymap.set -- for conciseness + -- set keymaps + local map = vim.keymap.set -- for conciseness - -- Telescope mappings - map('n', 'sf', 'Telescope find_files', { noremap = true, silent = true, desc = 'Find Files' }) - map('n', 'sw', 'Telescope live_grep', { noremap = true, silent = true, desc = 'Search Word' }) - map('n', 'sn', 'Telescope neovim', { noremap = true, silent = true, desc = 'Neovim Files' }) - map('n', '', 'Telescope buffers', { noremap = true, silent = true, desc = 'Buffers' }) - local builtin = require 'telescope.builtin' + -- Telescope mappings + map("n", "sf", "Telescope find_files", { noremap = true, silent = true, desc = "Find Files" }) + map("n", "sw", "Telescope live_grep", { noremap = true, silent = true, desc = "Search Word" }) + map("n", "sn", "Telescope neovim", { noremap = true, silent = true, desc = "Neovim Files" }) + map("n", "", "Telescope buffers", { noremap = true, silent = true, desc = "Buffers" }) + local builtin = require("telescope.builtin") - map('n', 'sn', function() - builtin.find_files { cwd = vim.fn.stdpath 'config' } - end, { desc = '[S]earch [N]eovim files' }) - map('n', 'ff', builtin.find_files, { desc = '[S]earch [F]iles' }) - map('n', 'sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) - map('n', 'sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) - map('n', 'sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) - map('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) - map('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) - map('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) - map('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) - map('n', 'q', vim.cmd.q) + map("n", "sn", function() + builtin.find_files({ cwd = vim.fn.stdpath("config") }) + end, { desc = "[S]earch [N]eovim files" }) + map("n", "ff", builtin.find_files, { desc = "[S]earch [F]iles" }) + map("n", "sh", builtin.help_tags, { desc = "[S]earch [H]elp" }) + map("n", "sk", builtin.keymaps, { desc = "[S]earch [K]eymaps" }) + map("n", "sg", builtin.live_grep, { desc = "[S]earch by [G]rep" }) + map("n", "sd", builtin.diagnostics, { desc = "[S]earch [D]iagnostics" }) + map("n", "sr", builtin.resume, { desc = "[S]earch [R]esume" }) + map("n", "s.", builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) + map("n", "", builtin.buffers, { desc = "[ ] Find existing buffers" }) - -- Additional custom mappings - map('n', '/', function() - builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown()) - end, { desc = '[/] Fuzzily search in current buffer' }) - map('n', 's/', function() - builtin.live_grep { grep_open_files = true, prompt_title = 'Live Grep in Open Files' } - end, { desc = '[S]earch [/] in Open Files' }) - end, + map("n", "T", ":Telescope colorscheme") + + -- Additional custom mappings + map("n", "/", function() + builtin.current_buffer_fuzzy_find(require("telescope.themes").get_dropdown()) + end, { desc = "[/] Fuzzily search in current buffer" }) + map("n", "s/", function() + builtin.live_grep({ grep_open_files = true, prompt_title = "Live Grep in Open Files" }) + end, { desc = "[S]earch [/] in Open Files" }) + end, }