adding catppuchin theme

This commit is contained in:
SALVI Jérémie
2024-08-17 05:37:44 +02:00
parent 5764e98ae6
commit 3cd1c8f79f
7 changed files with 111 additions and 60 deletions

View File

@@ -38,10 +38,10 @@ vim.keymap.set("n", "<leader>r", ":source ~/.config/nvim/init.lua<cr>")
-- Explorer -- Explorer
vim.keymap.set("n", "<C-e>", ":Lexplore<cr>") vim.keymap.set("n", "<C-e>", ":Lexplore<cr>")
-- Windows -- Windows
vim.keymap.set("n", "<M-O>d", "<C-w>h") vim.keymap.set("n", "<C-Left>", "<C-w>h")
vim.keymap.set("n", "<M-O>c", "<C-w>l") vim.keymap.set("n", "<C-Right>", "<C-w>l")
vim.keymap.set("n", "<M-O>a", "<C-w>k") vim.keymap.set("n", "<C-Up>", "<C-w>k")
vim.keymap.set("n", "<M-O>b", "<C-w>j") vim.keymap.set("n", "<C-Down>", "<C-w>j")
-- Resize -- Resize
vim.keymap.set("n", "-", ":vertical resize -3<cr>") vim.keymap.set("n", "-", ":vertical resize -3<cr>")
vim.keymap.set("n", "+", ":vertical resize +3<cr>") vim.keymap.set("n", "+", ":vertical resize +3<cr>")
@@ -64,44 +64,42 @@ vim.keymap.set("n", "<leader>nh", ":nohl<cr>")
--vim.keymap.set ("i", "[", "[]<Left>") --vim.keymap.set ("i", "[", "[]<Left>")
--- Statusline --- Statusline
vim.cmd "highlight StatusNormal ctermbg=blue ctermfg=black" vim.cmd("highlight StatusNormal ctermbg=blue ctermfg=black")
vim.cmd "highlight StatusModified ctermbg=red ctermfg=black" vim.cmd("highlight StatusModified ctermbg=red ctermfg=black")
vim.cmd "highlight StatusGitBranch ctermbg=yellow ctermfg=black" vim.cmd("highlight StatusGitBranch ctermbg=yellow ctermfg=black")
vim.cmd "highlight StatusGitDiffAdd ctermbg=green ctermfg=black" vim.cmd("highlight StatusGitDiffAdd ctermbg=green ctermfg=black")
vim.cmd "highlight StatusGitdiffRemove ctermbg=red ctermfg=black" vim.cmd("highlight StatusGitdiffRemove ctermbg=red ctermfg=black")
local function command(cmd) local function command(cmd)
local handle = io.popen(cmd) local handle = io.popen(cmd)
local result = handle:read() local result = handle:read()
handle:close() handle:close()
return result or "" return result or ""
end end
vim.o.statusline = "%#StatusNormal# " vim.o.statusline = "%#StatusNormal# "
.. "%#StatusGitBranch#" .. "%#StatusGitBranch#"
.. command("git branch 2> /dev/null | sed -e 's/..//'") .. command("git branch 2> /dev/null | sed -e 's/..//'")
.. "%#StatusNormal# " .. "%#StatusNormal# "
.. "%#StatusGitDiffAdd#" .. "%#StatusGitDiffAdd#"
.. command("git diff --numstat | awk '{print \"+\"$1}'") .. command("git diff --numstat | awk '{print \"+\"$1}'")
.. "%#StatusNormal# " .. "%#StatusNormal# "
.. "%#StatusGitDiffRemove#" .. "%#StatusGitDiffRemove#"
.. command("git diff --numstat | awk '{print \"-\"$2}'") .. command("git diff --numstat | awk '{print \"-\"$2}'")
.. "%#StatusNormal# " .. "%#StatusNormal# "
.. ">>" .. ">>"
.. " %F " .. " %F "
.. "%#StatusModified#" .. "%#StatusModified#"
.. "%M" .. "%M"
.. "%#StatusNormal#" .. "%#StatusNormal#"
.. " >>" .. " >>"
.. "%=" .. "%="
.. "<<" .. "<<"
.. " %Y " .. " %Y "
.. "<<" .. "<<"
.. " %l,%c " .. " %l,%c "
.. "<<" .. "<<"
.. " %p%% " .. " %p%% "
require("core") require("core")
require("lazy.load") require("lazy.load")

View File

@@ -5,11 +5,71 @@ if not ok then
end end
--- Plugin options --- Plugin options
local frappe = require("catppuccin.palettes").get_palette("frappe")
local opts = { local opts = {
options = { options = {
-- mode = "tabs", -- mode = "tabs",
separator_style = "slant", separator_style = "slant",
}, },
highlights = require("catppuccin.groups.integrations.bufferline").get({
styles = { "italic", "bold" },
custom = {
all = {
fill = { -- bg before buffer
fg = frappe.text,
bg = frappe.crust,
},
background = { -- buffer bg
fg = frappe.text,
bg = frappe.base,
},
buffer_visible = { -- buffer displayed when in another tab
fg = frappe.text,
bg = frappe.surface0,
},
buffer_selected = { -- bufferline displayed when in tab
fg = frappe.text,
bg = frappe.overlay0,
},
close_button = {
fg = frappe.text,
bg = frappe.base,
},
close_button_visible = {
fg = frappe.text,
bg = frappe.surface0,
},
close_button_selected = {
fg = frappe.text,
bg = frappe.overlay0,
},
modified = {
fg = frappe.text,
bg = frappe.base,
},
modified_visible = {
fg = frappe.text,
bg = frappe.surface0,
},
modified_selected = {
fg = frappe.text,
bg = frappe.overlay0,
},
separator = {
fg = frappe.crust,
bg = frappe.base,
},
separator_visible = {
fg = frappe.crust,
bg = frappe.surface0,
},
separator_selected = {
fg = frappe.crust,
bg = frappe.overlay0,
},
},
},
}),
} }
--- Load plugin --- Load plugin

View File

@@ -6,7 +6,7 @@ require("config/lualine")
require("config/nvim-autopairs") require("config/nvim-autopairs")
require("config/nvim-tree") require("config/nvim-tree")
require("config/nvim-treesitter") require("config/nvim-treesitter")
require("config/onedark") require("config/catppuchin")
require("config/rainbow-delimiters") require("config/rainbow-delimiters")
require("config/telescope") require("config/telescope")
require("config/which-key") require("config/which-key")

View File

@@ -1,6 +0,0 @@
local ok, onedark = pcall(require, "onedark")
if not ok then
return
end
onedark.load()

View File

@@ -1,5 +1,9 @@
return { return {
"akinsho/bufferline.nvim", "akinsho/bufferline.nvim",
version = "*", version = "*",
dependencies = "nvim-tree/nvim-web-devicons", dependencies = {
"nvim-tree/nvim-web-devicons",
"catppuccin/nvim",
},
after = "catppuccin",
} }

View File

@@ -1,8 +1,8 @@
return { return {
"nvim-tree/nvim-tree.lua", "nvim-tree/nvim-tree.lua",
version = "*", version = "*",
lazy = false, lazy = false,
dependencies = { dependencies = {
"nvim-tree/nvim-web-devicons", "nvim-tree/nvim-web-devicons",
}, },
} }

View File

@@ -1,5 +0,0 @@
return {
"navarasu/onedark.nvim",
priority = 1000,
config = config
}