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
vim.keymap.set("n", "<C-e>", ":Lexplore<cr>")
-- Windows
vim.keymap.set("n", "<M-O>d", "<C-w>h")
vim.keymap.set("n", "<M-O>c", "<C-w>l")
vim.keymap.set("n", "<M-O>a", "<C-w>k")
vim.keymap.set("n", "<M-O>b", "<C-w>j")
vim.keymap.set("n", "<C-Left>", "<C-w>h")
vim.keymap.set("n", "<C-Right>", "<C-w>l")
vim.keymap.set("n", "<C-Up>", "<C-w>k")
vim.keymap.set("n", "<C-Down>", "<C-w>j")
-- Resize
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>")
--- Statusline
vim.cmd "highlight StatusNormal ctermbg=blue ctermfg=black"
vim.cmd "highlight StatusModified ctermbg=red ctermfg=black"
vim.cmd "highlight StatusGitBranch ctermbg=yellow ctermfg=black"
vim.cmd "highlight StatusGitDiffAdd ctermbg=green ctermfg=black"
vim.cmd "highlight StatusGitdiffRemove ctermbg=red ctermfg=black"
vim.cmd("highlight StatusNormal ctermbg=blue ctermfg=black")
vim.cmd("highlight StatusModified ctermbg=red ctermfg=black")
vim.cmd("highlight StatusGitBranch ctermbg=yellow ctermfg=black")
vim.cmd("highlight StatusGitDiffAdd ctermbg=green ctermfg=black")
vim.cmd("highlight StatusGitdiffRemove ctermbg=red ctermfg=black")
local function command(cmd)
local handle = io.popen(cmd)
local result = handle:read()
handle:close()
return result or ""
local handle = io.popen(cmd)
local result = handle:read()
handle:close()
return result or ""
end
vim.o.statusline = "%#StatusNormal# "
.. "%#StatusGitBranch#"
.. command("git branch 2> /dev/null | sed -e 's/..//'")
.. "%#StatusNormal# "
.. "%#StatusGitDiffAdd#"
.. command("git diff --numstat | awk '{print \"+\"$1}'")
.. "%#StatusNormal# "
.. "%#StatusGitDiffRemove#"
.. command("git diff --numstat | awk '{print \"-\"$2}'")
.. "%#StatusNormal# "
.. ">>"
.. " %F "
.. "%#StatusModified#"
.. "%M"
.. "%#StatusNormal#"
.. " >>"
.. "%="
.. "<<"
.. " %Y "
.. "<<"
.. " %l,%c "
.. "<<"
.. " %p%% "
.. "%#StatusGitBranch#"
.. command("git branch 2> /dev/null | sed -e 's/..//'")
.. "%#StatusNormal# "
.. "%#StatusGitDiffAdd#"
.. command("git diff --numstat | awk '{print \"+\"$1}'")
.. "%#StatusNormal# "
.. "%#StatusGitDiffRemove#"
.. command("git diff --numstat | awk '{print \"-\"$2}'")
.. "%#StatusNormal# "
.. ">>"
.. " %F "
.. "%#StatusModified#"
.. "%M"
.. "%#StatusNormal#"
.. " >>"
.. "%="
.. "<<"
.. " %Y "
.. "<<"
.. " %l,%c "
.. "<<"
.. " %p%% "
require("core")
require("lazy.load")

View File

@@ -5,11 +5,71 @@ if not ok then
end
--- Plugin options
local frappe = require("catppuccin.palettes").get_palette("frappe")
local opts = {
options = {
-- mode = "tabs",
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

View File

@@ -6,7 +6,7 @@ require("config/lualine")
require("config/nvim-autopairs")
require("config/nvim-tree")
require("config/nvim-treesitter")
require("config/onedark")
require("config/catppuchin")
require("config/rainbow-delimiters")
require("config/telescope")
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 {
"akinsho/bufferline.nvim",
version = "*",
dependencies = "nvim-tree/nvim-web-devicons",
return {
"akinsho/bufferline.nvim",
version = "*",
dependencies = {
"nvim-tree/nvim-web-devicons",
"catppuccin/nvim",
},
after = "catppuccin",
}

View File

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

View File

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